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

FieldTypeNotes
modelstringA model id from Models.
messagesarrayRoles system, user, assistant, tool.
streambooleantrue sends the answer piece by piece (server-sent events).
max_tokensnumberMaximum output length; capped at the model's limit.
temperature, top_p, stopUsual sampling options.
tools, tool_choiceFunction calling, for models with the tools badge.
response_formatobjectJSON mode / structured output.
reasoningobjectReasoning 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.