ollama - 💡(How to fix) Fix Local Embedding Requests returning HTTP 401 Unauthorized despite no API Key configuration

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

12:10:08 [memory] sync failed (session-start): Error: Ollama embed HTTP 401: {"error": "unauthorized"} 12:10:08 [memory] sync failed (search): Error: Ollama embed HTTP 401: {"error": "unauthorized"}

Code Example

12:10:08 [memory] sync failed (session-start): Error: Ollama embed HTTP 401: {"error": "unauthorized"}
12:10:08 [memory] sync failed (search): Error: Ollama embed HTTP 401: {"error": "unauthorized"}
RAW_BUFFERClick to expand / collapse

What is the issue?

I am encountering a persistent HTTP 401: unauthorized error when making requests to the local embedding endpoint (/api/embed).

Expected Behavior: Since this is a local installation on my own machine, the embedding requests should be processed without requiring an API key or Bearer token.

Actual Behavior: The server consistently returns: HTTP 401: {"error": "unauthorized"}.

Crucial Troubleshooting steps already taken:

  • API Key: I have ensured that no API keys are configured in the client.
  • Clean Install: I performed a complete uninstallation and re-installation of Ollama, including clearing all AppData/Local and Roaming folders to remove any legacy credentials.
  • Proxy Test: I implemented a local Node.js proxy to explicitly strip all Authorization headers from the requests before they reached Ollama. Even with the headers removed, the server still returned a 401 error.
  • Model: The issue occurs with gemma4:31b-cloud and other models.

It seems the server is enforcing authentication for local embedding requests even when no credentials are provided, or it is misinterpreting the local request as an unauthorized cloud attempt.

Relevant log output

12:10:08 [memory] sync failed (session-start): Error: Ollama embed HTTP 401: {"error": "unauthorized"}
12:10:08 [memory] sync failed (search): Error: Ollama embed HTTP 401: {"error": "unauthorized"}

OS

Windows

GPU

No response

CPU

No response

Ollama version

0.24.0

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Local Embedding Requests returning HTTP 401 Unauthorized despite no API Key configuration