Client APIs
openai_chat_completions_to_anthropic
Read the release-matched openai chat completions to anthropic documentation and its scope.
Switching projects opens that project’s default documentation release.
Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.
On this page
Translates OpenAI Chat Completions requests only when the selected ExternalModel candidate uses Anthropic Messages; OpenAI candidates pass through with their configured path and model.
Configuration Notes
The trusted profile is emitted by intelligent_route, never inferred from a request header or model name. The selected Secret is injected later by credential_inject.
For Anthropic candidates, non-streaming JSON response chunks are retained in bounded request-local state until they can be translated. The separate SSE filter converts event chunks incrementally, and OpenAI-compatible response chunks remain unchanged.
Anthropic translation runs only when the filter’s api_translation_enabled setting is true, as derived from the tenant’s API translation permission.
api_version selects the backend contract independently of caller headers. It defaults to 2023-06-01. Supported sampling fields are preserved under either version; the backend owns version-specific parameter validation. Unknown versions fail configuration parsing. OpenAI-compatible candidates and native Messages passthrough are unaffected. Translated requests carry only text, image, and tool blocks, so they never contain the assistant document blocks or user text citations that 2026-10-21 rejects.
Anthropic candidates have the caller’s authorization and x-api-key removed; credential_inject installs the selected provider credential.
The compatibility contract defaults an omitted token limit to 4096 and ignores user, n, seed, and parallel_tool_calls after validating their types. Ignoring n does not produce multiple completions; ignoring seed does not make generation deterministic; and ignoring parallel_tool_calls does not constrain the provider’s tool scheduling. Other unsupported fields fail with HTTP 400.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
api_translation_enabled | bool | no | Permission from trusted application configuration. Anthropic requests fail closed when this is false (the default). |
api_version | string | no | Operator-selected Anthropic contract: 2023-06-01 (default) or 2026-10-21. Independent of caller headers; sampling validation remains the responsibility of the backend. |
max_body_bytes | integer | no | Compatibility setting for the former shared request/response limit. A direction-specific limit takes precedence when set. |
max_request_body_bytes | integer | no | Maximum complete translated Chat Completions request body. |
max_response_body_bytes | integer | no | Maximum complete Anthropic JSON response body retained for conversion. |