Messages
Create a message in the Anthropic Messages format, on the Claude pool.
POST https://code.test.indicia-ai.com/v1/messagesCreates a message in the Anthropic Messages format, on the Claude pool. There is no failover to another provider.
Request body
The body is the Anthropic Messages request.
The gateway resolves model (see
Models on other endpoints) and forwards
every other field unchanged.
| Parameter | Type | Description |
|---|---|---|
model | string, required | A Claude model id or a model class id. |
max_tokens | integer, required | Maximum output tokens. |
messages | array, required | The conversation, with text, image and tool blocks as in the Anthropic API. |
stream | boolean | Stream Anthropic server-sent events. |
| Other fields | system, tools, tool_choice, stop_sequences, thinking and the rest are passed to the Claude pool as sent. |
The gateway forwards the anthropic-version header (default 2023-06-01)
and anthropic-beta. Other request headers are not forwarded. The body may
be up to 16 MiB and must not be compressed.
Input tokens include a system prompt
Requests run on Claude subscription accounts, which add a short system
prompt of their own. usage.input_tokens includes it, so it is higher than
count_tokens reports for the same body.
Example request
curl https://code.test.indicia-ai.com/v1/messages \
-H "x-api-key: $INDICIA_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Say hello"}]
}'Response
The Anthropic message object, as the Claude pool returns it. Abridged:
{
"id": "msg_011CfzJyqhpT25oTxXXtqLvs",
"type": "message",
"role": "assistant",
"model": "claude-sonnet-5-5",
"content": [{"type": "text", "text": "Hello! I'm Claude Code, ready to help with your software engineering tasks. What are you working on today?"}],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {"input_tokens": 137, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "output_tokens": 36}
}content may start with a thinking block. Read the text from the text
blocks.
Streaming
With "stream": true the gateway relays the Anthropic event stream
(message_start, content_block_delta, message_stop and the rest) as the
Claude pool sends it. If the provider reports an error mid-stream, you get an
error event with a generic message instead of the provider's.