ollama - 💡(How to fix) Fix 403 Forbidden for certain User-agents?

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…

Root Cause

I have been using Ollama Cloud API through HTTP requests in the Llamalab Automate App for a few months, everything was fine, until a week ago or so. I kept getting 403 Forbidden answers. If I ran it through the ollama in the Termux terminal or through curl, it worked fine. Others mentioned problems due to the Origin header, but this didn't change anything. So I checked what headers Automate uses, and the culprit was the User-Agent: Dalvik/2.1.0 (Linux; U; Android 16; motorola edge 50 pro Build/W1UMS36H.52-73-8-3). But I also tried with just Dalvik/2.1.0, and still got 403 forbidden. If I use "*" then it works. Perhaps this is not really a bug, but I couldn't find anywhere a list of black/white-listed User agent headers for the Cloud API, if there is, and if that has been updated, or if the API system simply blocked this User because of too many requests or so...?! So I do have a work around, but in case this is a bug, I think it should still be fixed. If it's a question of there is a filter/list, it would be good and interesting to know where this is explained in the documentation, or else here (and in that case perhaps it should be added?).

Code Example

Return code: 403
Answer: <!doctype html><meta charset="utf-8"><meta name=viewport content="width=device-width, initial-scale=1"><title>403</title>403 Forbidden
Headers: null: HTTP/1.1 403 Forbidden, Alt-Svc: h3=":443"; ma=2592000, Connection: close, Content-Length: 134, content-type: text/html; charset=UTF-8, date: Tue, 02 Jun 2026 18:03:59 GMT, via: 1.1 google, X-Android-Received-Millis: 1780423439776, X-Android-Response-Source: NETWORK 403, X-Android-Selected-Protocol: http/1.1, X-Android-Sent-Millis: 1780423439563
RAW_BUFFERClick to expand / collapse

What is the issue?

Hi there,

I have been using Ollama Cloud API through HTTP requests in the Llamalab Automate App for a few months, everything was fine, until a week ago or so. I kept getting 403 Forbidden answers. If I ran it through the ollama in the Termux terminal or through curl, it worked fine. Others mentioned problems due to the Origin header, but this didn't change anything. So I checked what headers Automate uses, and the culprit was the User-Agent: Dalvik/2.1.0 (Linux; U; Android 16; motorola edge 50 pro Build/W1UMS36H.52-73-8-3). But I also tried with just Dalvik/2.1.0, and still got 403 forbidden. If I use "*" then it works. Perhaps this is not really a bug, but I couldn't find anywhere a list of black/white-listed User agent headers for the Cloud API, if there is, and if that has been updated, or if the API system simply blocked this User because of too many requests or so...?! So I do have a work around, but in case this is a bug, I think it should still be fixed. If it's a question of there is a filter/list, it would be good and interesting to know where this is explained in the documentation, or else here (and in that case perhaps it should be added?).

Many thanks in advance!

Relevant log output

Return code: 403
Answer: <!doctype html><meta charset="utf-8"><meta name=viewport content="width=device-width, initial-scale=1"><title>403</title>403 Forbidden
Headers: null: HTTP/1.1 403 Forbidden, Alt-Svc: h3=":443"; ma=2592000, Connection: close, Content-Length: 134, content-type: text/html; charset=UTF-8, date: Tue, 02 Jun 2026 18:03:59 GMT, via: 1.1 google, X-Android-Received-Millis: 1780423439776, X-Android-Response-Source: NETWORK 403, X-Android-Selected-Protocol: http/1.1, X-Android-Sent-Millis: 1780423439563

OS

Android

GPU

irrelevant (Cloud API)

CPU

irrelevant (Cloud API)

Ollama version

irrelevant (Cloud API, accessing directly through HTTP with API Key)

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