Endpoints
Chat Completions
Generate a chat response from a model.
POST
Request body
string
required
Model ID to use. See available models.
array
required
Array of message objects with
role and content.role:"system","user", or"assistant"content: The message text
number
default:"1"
Sampling temperature (0-2). Lower = more focused, higher = more creative.
number
Maximum tokens to generate in the response.
boolean
default:"false"
Stream response tokens as server-sent events.
number
default:"1"
Nucleus sampling parameter (0-1).
Response
Status codes
402 means one thing only: your account is out of credit. It is never used to report a
problem on our side.
When all routes for a model are exhausted, you get 503 with Retry-After and:
GET /v1/models.