Chat Completions
POST /v1/chat/completions — OpenAI format.
POST /v1/chat/completions — the OpenAI Chat Completions format. Works with any OpenAI-compatible SDK or tool.
Example
curl https://api.aivokey.dev/v1/chat/completions \
-H "Authorization: Bearer sk-aivo_..." \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"stream": true,
"messages": [
{ "role": "system", "content": "You are concise." },
{ "role": "user", "content": "Summarize the CAP theorem." }
]
}'
Main fields
| Field | Type | Notes |
|---|---|---|
model | string | A model id from Models. |
messages | array | Roles system, user, assistant, tool. |
stream | boolean | true sends the answer piece by piece (server-sent events). |
max_tokens | number | Maximum output length; capped at the model's limit. |
temperature, top_p, stop | Usual sampling options. | |
tools, tool_choice | Function calling, for models with the tools badge. | |
response_format | object | JSON mode / structured output. |
reasoning | object | Reasoning effort (low, medium, high) for models that support it. |
Streaming
A streamed answer ends with data: [DONE]. Token usage arrives in the last chunk — you do not need to set stream_options yourself.