Endpoint
Request
Headers
string
required
Must be
application/jsonstring
required
The AI provider to use (e.g.,
openai, anthropic, google)string
required
Your API key for the specified provider
string
Optional JSON config for routing, fallbacks, and guardrails
Body Parameters
string
required
The model to use for completion (e.g.,
gpt-4o-mini, claude-3-5-sonnet-20241022)array
required
Array of message objects with
role and contentnumber
default:1
Sampling temperature between 0 and 2. Higher values make output more random.
integer
Maximum number of tokens to generate
number
default:1
Nucleus sampling parameter. Alternative to temperature.
boolean
default:false
Whether to stream the response
string | array
Up to 4 sequences where the API will stop generating
number
default:0
Penalty for token presence (-2.0 to 2.0)
number
default:0
Penalty for token frequency (-2.0 to 2.0)
integer
default:1
Number of completions to generate
string
Unique identifier for the end-user
array
List of tools the model can call
string | object
Controls which tool the model should use
object
Format of the response (e.g.,
{"type": "json_object"})integer
Seed for deterministic sampling
Response
string
Unique identifier for the completion
string
Object type, always
chat.completioninteger
Unix timestamp of creation
string
The model used for completion
array
object