Chat
Create Chat Completion
Generate a model response for a conversation. Supports 200+ models, streaming, function calling, and vision.
POST
string
required
The model ID to use. See the Models reference for all available IDs.Popular values:
gpt-4o, gpt-4o-mini, claude-3-5-sonnet-20241022, gemini-2.0-flash, deepseek-chatarray
required
Array of conversation messages. Each message has a
role (system, user, assistant) and content.number
default:"1"
Sampling temperature from
0 to 2. Lower = more deterministic, higher = more creative.integer
Maximum tokens to generate. If omitted, uses the model’s default.
number
default:"1"
Nucleus sampling. Only sample from top
p probability mass. Use temperature OR top_p, not both.number
default:"0"
Penalizes tokens based on how often they appear in the text so far. Range:
-2.0 to 2.0.number
default:"0"
Penalizes tokens based on whether they have appeared at all so far. Range:
-2.0 to 2.0.string | array
Up to 4 stop sequences. The API will stop generating further tokens when it encounters any of these.
integer
default:"1"
Number of completions to generate. Each counts toward your usage.
string
A unique identifier for your end-user. Helps with abuse monitoring.