POST /v1/messages
The Anthropic-protocol chat endpoint — field names and response shape match Anthropic's own API.
On this page
POST https://api.apione.ai/v1/messagesIn an SDK, set base_url to https://api.apione.ai (without /v1).
Request parameters
modelstringrequiredModel ID. Non-Anthropic models work too — the gateway translates.
max_tokensintegerrequiredMandatory in this protocol; omitting it returns 400.
messagesobject[]requiredOnly user and assistant roles, alternating.
systemstring | object[]System prompt — a top-level field, not a message.
streambooleanEnables the named-event SSE stream.
temperaturenumber0–1 — a different ceiling from the OpenAI protocol.
stop_sequencesstring[]Stop sequences; note the name differs from OpenAI's stop.
toolsobject[]Anthropic-style tool definitions (input_schema).
Example request
{
"model": "claude-opus-4-7",
"max_tokens": 1024,
"system": "You are a rigorous code reviewer.",
"messages": [
{ "role": "user", "content": "What happens to this function on an empty array?" }
]
}Response
{
"id": "msg_01J8ZQ7K3M",
"type": "message",
"role": "assistant",
"model": "claude-opus-4-7",
"content": [
{ "type": "text", "text": "An empty array falls through to the reduce initial value…" }
],
"stop_reason": "end_turn",
"usage": { "input_tokens": 64, "output_tokens": 188 }
}Note the body lives in the content[] array, and usage fields are input_tokens / output_tokens.
Stream events
event: message_start
event: content_block_start
event: content_block_delta ← text increments arrive here
event: content_block_stop
event: message_delta ← carries stop_reason and usage
event: message_stopContact us
Something unclear, or need a human? Pick the channel that fits your question.
Supportsupport@apione.ai
WeCom
Telegram
Communityhttps://t.me/apione
Support tickets
Billing & accountConsole › Feedback