Chat Completions
The main way to generate text: chat, Q&A, summarization, tool calling and vision all go through this endpoint.
POST/v1/chat/completions
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | ✓ | Model name (e.g. verinova) |
messages | array | ✓ | Chat messages (see below) |
stream | boolean | If true, returns an SSE stream | |
stream_options | object | { "include_usage": true } for token info in a stream | |
max_tokens | integer | Max tokens to generate | |
max_completion_tokens | integer | New name for max_tokens | |
temperature | number | Creativity (0–2). Lower = more consistent | |
top_p | number | Nucleus sampling | |
tools | array | Functions the model may call | |
tool_choice | string/object | Tool selection behavior | |
response_format | object | { "type": "json_object" } or json_schema | |
stop | string/array | Stop sequences | |
frequency_penalty / presence_penalty | number | Repetition penalties | |
seed | number | For reproducibility | |
user | string | End-user identifier |
messages item
| Field | Type | Description |
|---|---|---|
role | string | system, user or assistant |
content | string | array | Plain text or multi-part content (text + image) |
tool_calls | array | (assistant) Tool calls requested by the model |
tool_call_id | string | (tool) Which tool call this responds to |
Basic example
bash
curl https://app.qevron.ai/v1/chat/completions \
-H "Authorization: Bearer $QEVRON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "verinova",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "How do I reverse a list in Python?" }
]
}'python
resp = client.chat.completions.create(
model="verinova",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "How do I reverse a list in Python?"},
],
)
print(resp.choices[0].message.content)javascript
const resp = await client.chat.completions.create({
model: "verinova",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "How do I reverse a list in Python?" },
],
});
console.log(resp.choices[0].message.content);Response
json
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1716200000,
"model": "verinova",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Use list.reverse() in place, or list[::-1] for a new list..."
},
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 31, "completion_tokens": 42, "total_tokens": 73 }
}| Field | Description |
|---|---|
choices[].message.content | Generated reply text |
choices[].finish_reason | stop, length, tool_calls, content_filter |
usage | Token usage |
Streaming
Add "stream": true; the response arrives as SSE chunks. Details: Streaming.
Vision
On vision-capable models (e.g. spook-vision) send content as multi-part:
json
{
"model": "spook-vision",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "What's in this image?" },
{ "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,..." } }
]
}
]
}image_url.url can be a public URL or a data: base64. Full guide: Vision.
Tool calling
json
{
"model": "verinova",
"messages": [{ "role": "user", "content": "What's the weather in Istanbul?" }],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the weather for a city",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
}
}
}
]
}If the model wants to call a tool, the response's choices[0].message.tool_calls is populated; you run the function and send the result back as a role: "tool" message.
JSON output
json
"response_format": { "type": "json_object" }or to enforce a schema:
json
"response_format": {
"type": "json_schema",
"json_schema": { "name": "person", "schema": { "type": "object", "properties": { "name": {"type":"string"} } } }
}