[GH-ISSUE #4388] Accept or Ignore additional headers in OpenAI compatible endpoints #64778

Closed
opened 2026-05-03 18:46:29 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @UdaraJay on GitHub (May 13, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4388

Originally assigned to: @jmorganca on GitHub.

The OpenAI javascript SDK adds some x-stainless-* headers to API calls that cause preflight checks to fail against Ollama's API when switching out the baseUrl for Ollama's v1/chat/completions endpoint.

Access to fetch at 'http://localhost:11434/v1/chat/completions' from origin 'http://localhost' has been blocked by CORS policy: Request header field x-stainless-os is not allowed by Access-Control-Allow-Headers in preflight response.

Would be great if you could configure cors in more detail when running the server or if these additional headers are ignored or accepted as they can't be disabled on the SDK unless you modify the library.

Originally created by @UdaraJay on GitHub (May 13, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4388 Originally assigned to: @jmorganca on GitHub. The OpenAI javascript SDK adds some `x-stainless-*` headers to API calls that cause preflight checks to fail against Ollama's API when switching out the baseUrl for Ollama's `v1/chat/completions` endpoint. ``` Access to fetch at 'http://localhost:11434/v1/chat/completions' from origin 'http://localhost' has been blocked by CORS policy: Request header field x-stainless-os is not allowed by Access-Control-Allow-Headers in preflight response. ``` Would be great if you could configure cors in more detail when running the server or if these additional headers are ignored or accepted as they can't be disabled on the SDK unless you modify the library.
GiteaMirror added the bug label 2026-05-03 18:46:29 -05:00
Author
Owner

@jmorganca commented on GitHub (May 13, 2024):

Thanks for the issue!

<!-- gh-comment-id:2106572467 --> @jmorganca commented on GitHub (May 13, 2024): Thanks for the issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#64778