OpenAI
The gateway speaks the OpenAI API upstream and holds the OpenAI key.
What's specific to OpenAI
| Property | Value |
|---|---|
| Provider id | openai |
| Gateway speaks | OpenAI REST → api.openai.com/v1 |
| Credential | API key (Bearer), server-held |
| Signing | None |
| Client base URL | OPENAI_BASE_URL → http://<gateway>:8787/v1 |
Everything shared — self-hosting, the config-based redirect, how credentials are stored — is documented once in the gateway.
Configure the provider
Console → Providers → add openai and paste the API key. Or seed it from the
environment with ANYRAY_PROVIDER_KEY_OPENAI.
Optional per-request fields (org, project, beta) ride the x-anyray-openai-organization,
x-anyray-openai-project, and x-anyray-openai-beta headers.
Route requests to it
Point the SDK at the gateway and send the provider header (omit it when OpenAI is your only configured provider):
export OPENAI_BASE_URL=http://<gateway>:8787/v1
# requests carry: x-anyray-provider: openai
Models use OpenAI ids, e.g. gpt-4o, gpt-4o-mini, o1-mini.