Skip to main content
POST
Create a model response from a list of chat messages. GPT-5, Grok, Gemini, and DeepSeek models accept this protocol; choose an exact model page under Text Series for pricing and the recommended model ID.
string
required
A text model ID available to your API key. Use GET /v1/models to discover IDs, then open its individual model page for current pricing.
array
required
Ordered chat messages. Each message includes a role and content.
boolean
default:"false"
Set to true to receive server-sent events.
number
Controls sampling variation. Lower values are more deterministic.
integer
Caps generated tokens. GPT-5 models name this field max_completion_tokens; the gateway forwards max_tokens to them under that name, so either works.

Stream a response

Set stream to true. The response uses server-sent events (SSE).
Each event begins with data:. Read events until the data: [DONE] marker.
Concatenate choices[0].delta.content values as they arrive. A delta can omit content, especially in the first or final event.