OpenAI SDK compatibility

Reference of which OpenAI Chat Completions parameters Tresor supports.

Tresor's /v1/chat/completions endpoint follows the OpenAI request and response shape, so any OpenAI SDK works after changing the base URL to https://api.tresor.co/v1 and the API key to a Tresor key (tr-…).

For end-to-end install + first-call instructions, see the Use the OpenAI SDK guide.

Compatibility matrix

FeatureStatus
Non-streaming chat completions✅ Supported
Streaming via SSE✅ Supported
tools / tool_choice (function calling)✅ Supported (streaming + non-streaming)
response_format (JSON mode / schema)✅ Forwarded; provider-dependent
reasoning for reasoning models✅ Supported (reasoning_content remains as a compatibility alias until 2026-09-01)
Vision / multimodal content arrays✅ Forwarded; provider-dependent
seed, stop, top_p, penalties✅ Forwarded
logprobs, n > 1⚠️ Forwarded; only choices[0] is surfaced in streaming
/v1/embeddings❌ Not supported
/v1/completions (legacy)❌ Not supported
/v1/audio/*, /v1/images/*, batches❌ Not supported

For per-parameter detail (which are validated, which are forwarded verbatim) see the chat completions reference.

For reasoning-capable models, read returned reasoning from message.reasoning in non-streaming responses or delta.reasoning in streaming chunks. reasoning_content mirrors the same text only during the compatibility window and is deprecated after 2026-09-01.

Tresor-specific extensions

Use extra_body.reasoning when you want one public reasoning-effort control across supported providers. Tresor translates that request to the route-native parameters behind the scenes.

The tresor extension on responses (receipt_id, requested_route, routed_model, failover) is an unknown key as far as the OpenAI SDK is concerned, so existing SDK code reads it via the raw response or simply ignores it. requested_route is the canonical primary route you asked for; routed_model is the concrete route that actually served the request. The failover boolean reports routing failover, not client retry behaviour. For chat completions, it becomes true only when the router leaves the primary top-level route and uses one of your explicit failover entries. Automatic same-model resolution can still change routed_model while failover stays false.

The explicit failover request field is itself a Tresor-only extension. If a client cannot send custom body fields such as extra_body, you can still use pinned routes or bare model keys, but not explicit chat failover.

include_reasoning is another Tresor-only request extension. Set it in extra_body when you want the model to reason internally but do not want the reasoning text returned in the response.

See also