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

FieldTypeNotes
modelstringBare canonical model name.
messagesarraysystem, user, assistant, tool roles.
streambooleanServer-sent events when true.
max_tokensnumberOutput cap; clamped to the model's limit.
toolsarrayFunction/tool definitions.
response_formatobjectJSON mode / structured output.
reasoning / thinkingobjectReasoning 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).