Anthropic Messages compatible — anthropic-native clients such as Claude Code connect as-is.
Internally it runs through the same chat pipeline and supports stream.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
messages | array | Yes | role is user / assistant. content is a string or an array of blocks (text, image, tool_use, tool_result, thinking, document) |
max_tokens | integer | Yes | 1–200000 (required by the Anthropic spec) |
system | string | array | No | A string or an array of text blocks |
temperature | number | No | 0–1 |
top_p | number | No | 0–1 |
top_k | integer | No | Positive integer |
stop_sequences | string[] | No | Up to 8 |
stream | boolean | No | Defaults to false |
tools | array | No | {name, description, input_schema} |
tool_choice | object | No | {"type":"auto"|"any"|"none"} or {"type":"tool","name":"..."} |
metadata | object | No | {"user_id": "..."} |
thinking | object | No | {"type":"enabled","budget_tokens":N} (N < max_tokens) · {"type":"adaptive"} · {"type":"disabled"} |
everyais | object | No | Gateway caching options |
If you attach cache_control directly to a block, it is passed through as-is (see prompt caching).
Request
{
"model": "everyais/claude-opus-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}POST /v1/messages/count_tokens
Estimates the input token count before you send a request. Claude Code calls this endpoint automatically.
- Free — no credit is deducted.
- Returns a heuristic estimate without calling the upstream provider (it may differ from the exact tokenizer result).
- The request body takes the same shape as
/v1/messages.
{
"input_tokens": 1234
}