OpenAI
The gateway speaks the OpenAI API upstream and holds the OpenAI key.
| Property | Value |
|---|---|
| Provider id | openai |
| Gateway speaks | OpenAI REST → api.openai.com/v1; Anthropic /v1/messages is translated to chat completions |
| Credential | API key (Bearer), server-held |
| Client base URL | OPENAI_BASE_URL → http://<gateway>:8787/v1 |
Add the key under Console → Providers → openai, or seed it from the environment with
ANYRAY_PROVIDER_KEY_OPENAI. The x-anyray-openai-organization and
x-anyray-openai-project request headers apply only on the caller's own key: pass-through,
or when no key is stored. With the org's key, the routing target's openai_organization and
openai_project, or the provider key, choose the account. Otherwise the key's default applies.
Use x-anyray-openai-beta for per-request beta features.
The org's key never reaches OpenAI's admin API: /v1/organization/* gets a 400. Call it with
your own admin key.
Then point the SDK at the gateway (base URLs and keys):
export OPENAI_BASE_URL=http://<gateway>:8787/v1
# requests carry: x-anyray-provider: openai
Omit the provider header when OpenAI is your only configured provider. Models use OpenAI ids,
e.g. gpt-6.1-sol, gpt-6-sol, gpt-6-luna.