Skip to main content
POST
Direct Chat Completions

Error Reference: Direct Completions

Common errors: unsupported model, unsupported sampling parameter, missing messages, context window exceeded, provider timeout, provider unavailable.

Authorizations

Authorization
string
header
default:<api-key>
required

Bearer authentication header of the form Bearer <api-key>, where <api-key> is your API key.

Headers

X-Cache-TTL
string | null

Body

application/json

OpenAI-compatible chat completion request. Both messages and model are required; all other fields are optional and forwarded to the selected provider as-is.

messages
Messages · object[]
required

Chat messages array

model
string
required

Gloo model ID (e.g. 'gloo-anthropic-claude-sonnet-4.5')

stream
boolean | null
default:false

Enable streaming

max_tokens
integer | null

Maximum tokens to generate

temperature
number | null

Sampling temperature

top_p
number | null

Nucleus sampling parameter

frequency_penalty
number | null

Frequency penalty

presence_penalty
number | null

Presence penalty

stop
any | null

Stop sequences

tools
Tools · object[] | null

Tool definitions

tool_choice
any | null

Tool choice strategy

response_format
Response Format · object | null

Response format

stream_options
Stream Options · object | null

Streaming options, e.g. {include_usage: true} to receive a usage SSE chunk at the end of the stream.

parallel_tool_calls
boolean | null

Whether to enable parallel function calling. Stripped automatically when tools is not provided.

reasoning_effort
string | null

Controls reasoning effort for supported models (e.g. 'none', 'low', 'medium', 'high'). Ignored for models that do not reason. A graded effort ('low'/'medium'/'high') also requests a reasoning summary, which streams as reasoning_content; 'none' requests no reasoning and therefore no summary.

prompt_cache_key
string | null

OpenAI Responses API cache key. Enables persistent prompt caching.

Response

Successful direct Chat Completion. If stream is false or omitted, the response is JSON. If stream=true, the response is a Server-Sent Events stream.

A non-streaming OpenAI-compatible Chat Completion returned by the selected model.

id
string
required

Unique completion identifier.

object
string
default:chat.completion
required

Object type, always chat.completion.

Allowed value: "chat.completion"
created
integer
required

Unix timestamp when the completion was created.

model
string
required

Model that generated the completion.

choices
Completion Choice · object[]
required

Completions generated by the model.

usage
Usage · object | null

Token usage when supplied by the provider.

service_tier
string | null
system_fingerprint
string | null
ignored_params
Ignored Parameters · object

Sampling parameters ignored because the selected model does not support them.