Create Chat Completion
Sonar API
Create Chat Completion
Generate a chat completion response for the given conversation.
POST
Create Chat Completion
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Model to use, for example, sonar-pro
Available options:
sonar, sonar-pro, sonar-deep-research, sonar-reasoning-pro Required range:
0 < x <= 128000Controls randomness in the response. Higher values make output more random. Range: 0-2
Required range:
0 <= x <= 2Nucleus sampling parameter. Controls diversity via nucleus sampling
Required range:
0 <= x <= 1Optional. Controls the output format. Omit for default text output. Set type to json_schema for structured output.
- ResponseFormatText
- ResponseFormatJSONSchema
Available options:
web, academic, sec Available options:
hour, day, week, month, year Available options:
full, concise Available options:
minimal, low, medium, high Response
Successful Response
Array of images returned when return_images is true
Array of related questions returned when return_related_questions is true