Client APIs

openai_chat_completions_to_anthropic

Read the release-matched openai chat completions to anthropic documentation and its scope.

Praxis AI v0.12.1 (alpha) 2 min read
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.

Installing this filter enables translation for selected Anthropic providers.

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

FieldTypeRequiredDescription
api_versionstringnoOperator-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_bytesintegernoCompatibility setting for the former shared request/response limit. A direction-specific limit takes precedence when set.
max_request_body_bytesintegernoMaximum complete translated Chat Completions request body.
max_response_body_bytesintegernoMaximum complete Anthropic JSON response body retained for conversion.