Skip to main content

Chat

Given a list of messages comprising a conversation, the model will return a response.

Create Chat Completion

POST https://api.sybil.com/v1/chat/completions

Creates a model response for the given chat conversation.

Request Body

NameTypeDescription
messagesarrayRequired. A list of messages comprising the conversation so far.
modelstringRequired. The name of the model to use.
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
max_tokensintegerThe maximum number of tokens that can be generated in the chat completion.
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
response_formatobjectAn object specifying the format that the model must output. Setting to { "type": "json_object" } enables JSON mode.
seedintegerIf specified, our system will make a best effort to sample deterministically.
stopstring/arrayUp to 4 sequences where the API will stop generating further tokens.
streambooleanIf set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available.
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

Example Request

curl https://api.sybil.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SYBIL_API_KEY" \
-d '{
"model": "DeepSeek-R3",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
]
}'

Response Format

{
"model": "DeepSeek-R3",
"system_fingerprint": "fp_44709d6fcb",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}