v54

OpenAPI 3.1.0raw.githubusercontent.com2026-08-038690315.6 KB
chat

Chat Completions

OpenAI-compatible chat completions endpoint.

Supports both streaming and non-streaming responses. Handles reasoning content from otari providers.

Authentication modes:

  • Master key + user field: Use specified user (must exist)
  • API key + user field: Use specified user (must exist)
  • API key without user field: Use the shared "default" user
post/v1/chat/completions

Request body

frequency_penaltynumber nullable
logit_biasobject nullable
logprobsboolean nullable
max_completion_tokensinteger nullable
max_tokensinteger nullable
max_tool_iterationsinteger nullable
mcp_server_idsstring[] nullable
messagesobject[] required
modelstring required
ninteger nullable
parallel_tool_callsboolean nullable
presence_penaltynumber nullable
reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'auto' nullable
response_formatobject nullable
seedinteger nullable
session_labelstring nullable

Optional caller-supplied label for cost attribution (per run, experiment, or conversation). In hybrid mode it is forwarded onto the platform usage report so spend can be sliced by session without standing up OpenTelemetry. Stripped before the request is forwarded upstream to the provider. Has no effect in standalone mode, where there is no platform to report it to.

streamboolean
stream_optionsobject nullable
temperaturenumber nullable
tools_headerstring nullable

Optional override for the lead-in that the gateway prepends before the per-tool hint block in the system message. Useful for expressing global tool-selection policy (e.g. 'prefer MCP tools over code_execution'). Falls back to OTARI_TOOLS_HEADER env, then to the built-in default.

top_logprobsinteger nullable
top_pnumber nullable
userstring nullable

Response

Successful Response

{"stackTrail":"paths:/v1/chat/completions:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}