#No API key found for provider "ollama".

1 messages · Page 1 of 1 (latest)

grim yoke
#

Hey everyone — I’m running into an issue with my embedded agent setup and hoping someone here has experience with this.

I originally configured everything using the Gemini API, then later switched the model to Ollama (running locally on my server). It was working perfectly for a while.

Now I’ve hit a Gemini rate limit, and I’m also getting this error when the agent tries to reply:

Embedded agent failed before reply: All models failed (2):
ollama/gpt-oss:20b: No API key found for provider "ollama".
Auth store: /home/node/.openclaw/agents/main/agent/auth-profiles.json
Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir.
(auth) | google/gemini-3-flash-preview: Provider google is in cooldown (all profiles unavailable) (rate_limit)

From what I understand:

  • Gemini is rate-limited right now
  • Ollama should be local (so no API key needed?), but the agent still complains about missing auth

Has anyone dealt with this before or knows the correct way to configure Ollama auth for an embedded agent?

Any help would be really appreciated 🙏

vital roseBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

north pagoda
#

same problem

hasty wyvernBOT
#

Yeah, this one’s a bit confusing the first time: Ollama doesn’t need a “real” API key, but OpenClaw still requires that an apiKey value exists (it’s basically used as the “provider is enabled / auth is present” flag, and for model auto-discovery).

So when Gemini is rate-limited and it falls back to ollama/..., you get:

No API key found for provider "ollama"

Fix (pick one)

Option A (recommended): set a dummy key via env
Put this on the gateway host (or in ~/.openclaw/.env if you run the gateway as a service and it doesn’t inherit your shell env):

OLLAMA_API_KEY=ollama-local

Then restart the gateway and retry.

#

Option B: set it in OpenClaw config

openclaw config set models.providers.ollama.apiKey "ollama-local"

If this is an embedded / multi-agent setup

Auth is per-agent. New/embedded agents often have an empty auth store:

~/.openclaw/agents/<agentId>/agent/auth-profiles.json

The FAQ’s suggested fixes are exactly:

  • re-run openclaw agents add <id> and configure auth during the wizard, or
  • copy auth-profiles.json from the main agent into the embedded agent’s agentDir.

Docs (the two relevant bits)

#

If you paste openclaw --version + openclaw models status (redact tokens), I can tell you which agent/store it’s actually trying to use and whether it’s picking up OLLAMA_API_KEY.

rare kelp
#

I have the same problem; my Minimax (cloud) is not fully running one of the two local models I installed, it tells me the same thing, that it needs an api_key but it's local

hasty wyvernBOT
#

Even for “local” providers, OpenClaw still wants an apiKey value present to treat the provider as enabled / eligible (and for Ollama it also gates auto-discovery). It can be a dummy string — Ollama won’t validate it.

Fix (Ollama)

Pick one:

1) Put a dummy key in ~/.openclaw/.env (best if you run the gateway as a service):

OLLAMA_API_KEY=ollama-local

Restart the gateway.

2) Or set it in config:

openclaw config set models.providers.ollama.apiKey "ollama-local"

Restart the gateway.

#

Docs: https://docs.openclaw.ai/providers/ollama (step 3 explicitly says “any value works”)


Why only 1 of your 2 local models shows/works

If you’re relying on auto-discovery, OpenClaw only picks up Ollama models that report tool support. So one model might be filtered out.

To use the “missing” model anyway, you need explicit config under models.providers.ollama.models (manual list). Example pattern:

{
  models: {
    providers: {
      ollama: {
        baseUrl: "http://127.0.0.1:11434",
        apiKey: "ollama-local",
#
        api: "ollama",
        models: [
          { id: "gpt-oss:20b", name: "gpt-oss:20b", input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 8192, maxTokens: 81920 },
          { id: "your-other-model", name: "your-other-model", input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 8192, maxTokens: 81920 }
        ]
      }
    }
  }
}

(Once you define models.providers.ollama explicitly, auto-discovery is skipped — that’s expected.)


If you paste the output of: