Chat Completions
[OI]-compatible chat wire.
POST /v1/chat/completions is the [OI]-compatible chat wire. Use it with any [OI]-compatible SDK, CLI, or agent.
Request
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." }
]
}'
Common fields
| Field | Type | Notes |
|---|---|---|
model | string | Bare canonical model name. |
messages | array | system, user, assistant, tool roles. |
stream | boolean | Server-sent events when true. |
max_tokens | number | Output cap; clamped to the model's limit. |
tools | array | Function/tool definitions. |
response_format | object | JSON mode / structured output. |
reasoning / thinking | object | Reasoning effort or budget, when supported. |
Streaming responses end with data: [DONE]. Usage arrives in the final chunk (with stream_options.include_usage handled for you).