Skip to main content
POST
Completions

Body

array
required
Array of message objects representing the conversation history.
array of strings
required
One or more models to use for the completion, in provider/model format. At least one must be provided.
array of strings
Optional list of fallback models to try if the primary models fail, in provider/model format.
boolean
default:"false"
When true, the response is streamed as server-sent events (SSE).
number
Sampling temperature between 0 and 1. Higher values produce more random output. Defaults to the model’s preset.
integer
Maximum number of tokens to generate in the response.
integer
Number of times to retry a failed model request before falling back or erroring.
Enable real-time web search to ground the response in current information.
string (UUID)
Associates this request with an existing conversation for context tracking.

Examples


Response

string
The provider that handled the request. E.g. "openai", "anthropic".
string
The model that generated the response. E.g. "gpt-4o".
string (UUID)
Unique identifier for the generated assistant message.
string
Type of the response chunk. Currently "text". Present on streaming chunks.
string
The generated text fragment. Present on streaming chunks.
object
The full assistant message object.
string
ID of the conversation this completion belongs to.
string
Auto-generated title for the conversation derived from the first message.
object
Token usage and cost breakdown for the request.
integer
Total request latency in milliseconds from request received to response complete.
integer
Time to first token in milliseconds.