Skip to content

fix: add browser User-Agent to fix CF 403s on openai_compat backends#13

Open
briepala wants to merge 1 commit into
OnlyTerp:mainfrom
briepala:solve-headers
Open

fix: add browser User-Agent to fix CF 403s on openai_compat backends#13
briepala wants to merge 1 commit into
OnlyTerp:mainfrom
briepala:solve-headers

Conversation

@briepala
Copy link
Copy Markdown

@briepala briepala commented Jun 4, 2026

  • Add UC_BROWSER_UA env var (default: modern Chrome UA)
  • Inject User-Agent + Accept-Language in openai_compat paths, the Auto Router classifier, model discovery, and passthroughs
  • Route-level "headers" overrides still take precedence
  • Shortened the related comments

Cloudflare-protected providers (e.g. crof.ai) were rejecting requests with
"Error 1010: browser_signature_banned" because the proxy used Python's
default urllib User-Agent.

The same API keys + endpoints worked fine from droid/Factory because those
clients send a real browser UA.
crof.ai models (kimi-, deepseek--crof, mimo-*, etc.) now work the same as
they do in droid/Factory.

Tested: scripts/doctor.py passes, direct proxy requests to crof models
succeed and return real responses.

- Add UC_BROWSER_UA env var (default: modern Chrome UA)
- Inject User-Agent + Accept-Language in openai_compat paths, the Auto
  Router classifier, model discovery, and passthroughs
- Route-level "headers" overrides still take precedence
- Shortened the related comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant