Skip to main content
POST
Direct Chat Completions

Guide: Direct Completions

What runs and what doesn’t, output limits, sampling parameters, and reasoning summaries.

Error Reference: Direct Completions

Common errors: unknown model, missing messages, context window exceeded, provider rate limit, provider timeout, provider unavailable.

Authorizations

Authorization
string
header
default:Bearer <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-opus-5.5')

stream
boolean | null
default:false

Enable streaming

max_tokens
integer | null

Maximum output, in tokens. It holds the reasoning as well as the answer. When the model is reasoning, a value below 8,192 is raised to 8,192; a larger one is sent as you set it, up to the model's maximum output. With reasoning_effort 'none' on a model that can turn reasoning off (can_disable: true in the model catalog), from any provider, the value is sent as you set it, up to the model's maximum output. With no value, a reasoning model gets its full output allowance (up to 65,536) and other models get the model's default. A value of 0 or less counts as no value. See Set your output limit for reasoning models.

max_completion_tokens
integer | null

OpenAI's name for max_tokens. If you send both, max_completion_tokens is used.

temperature
number | null

Sampling temperature. A model that does not take one (Claude 5 models, and OpenAI GPT-5 and later models while they reason) does not get it, and it is listed in ignored_params (X-Ignored-Params on a stream). See Sampling parameters.

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. Supported tool types: 'function' (custom function tools), native web search (any 'web_search'-prefixed type), and 'image_generation'; other tool types are rejected with a validation error.

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 missing, null, or empty.

reasoning_effort
enum<string> | null

How much a reasoning model thinks before it answers, from least to most. The levels a given model takes are in its reasoning.effort_levels on GET /platform/v2/models. A level the model does not take is not refused: it runs at the nearest level the model has, or without an effort, and is listed in ignored_params (X-Ignored-Params on a stream). See the Reasoning guide (/api-guides/reasoning).

Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
reasoning
Reasoning · object | null

The nested OpenAI form of reasoning_effort: {"effort": "high"}. reasoning_effort wins if both are sent; a different nested effort it overrode is listed in ignored_params. Fields that cannot be read are listed in ignored_params and never cause an error.

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.

system_fingerprint
string | null
ignored_params
Ignored Parameters · object

Parameters that were ignored or not applied as sent. The request still succeeds. Entries include sampling parameters the selected model does not take; reasoning efforts the model ran at another level or without (for example reasoning_effort=minimal); nested reasoning fields that were not read (for example reasoning.summary=auto sent with no effort); and messages.thinking=<n>: the number of thinking or redacted_thinking parts removed from assistant messages you sent back. Reasoning is not carried between requests; the model reasons afresh. On a stream, the parameter names are in the X-Ignored-Params header instead.