Create Chat Completion
Creates a chat completion in Perplexity.
POST
Query
Field selectionChoose which fields should be included in the response. Learn more
string
Comma-separated response fields to include.
Body
Arguments
stringrequired
Sonar model to use, for example sonar-pro.
array of objectrequired
Conversation history array in OpenAI chat format.
Uncommon arguments
number
Maximum number of completion tokens to generate.
boolean
When true, returns a streaming SSE response.
number
Controls randomness in the response.
boolean
When true, disables web search for this request.
array of string
Limit search results to specific domains.
array of string
Filter search results by ISO 639-1 language code.
string
Filter by publication recency.
string
Controls how much effort the model spends on reasoning.
string
ISO 639-1 language code for the preferred response language.