Messages

POST /v1/messages — Anthropic format.

POST /v1/messages — the Anthropic Messages format, used by Claude Code and the Anthropic SDKs. It works with every model in the catalog, not only Claude.

Example

curl https://api.aivokey.dev/v1/messages \
  -H "x-api-key: sk-aivo_..." \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "max_tokens": 1024,
    "stream": true,
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

Base URL for Anthropic clients

Anthropic SDKs and Claude Code add /v1 on their own. Give them the base URL without /v1:

https://api.aivokey.dev

Counting tokens

POST /v1/messages/count_tokens takes the same body as /v1/messages and returns { "input_tokens": N }. It is an estimate, free, and does not run the model.

Web search

The server tools web_search and web_fetch are supported — see Web search & fetch.