Chat Completions
Generates a model’s response for the given chat conversation.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
The name of the model that will complete your prompt. Refer to Supported Models to find all the models offered.
"sonar"
A list of messages comprising the conversation so far.
[
{
"role": "system",
"content": "Be precise and concise."
},
{
"role": "user",
"content": "How many stars are there in our galaxy?"
}
]
The maximum number of completion tokens returned by the API.
The amount of randomness in the response, valued between 0 and 2.
0 <= x < 2
The nucleus sampling threshold, valued between 0 and 1.
A list of domains to limit search results to.
Determines whether search results should include images.
Determines whether related questions should be returned.
Filters search results based on time (e.g., 'week', 'day').
The number of tokens to keep for top-k filtering.
Determines whether to stream the response incrementally.
Positive values increase the likelihood of discussing new topics.
Decreases likelihood of repetition based on prior frequency.
Enables structured JSON output formatting.
Configuration for using web search in model responses.
{ "search_context_size": "high" }
Response
The response is of type any
.