API Reference/Endpoints

POST /v1/messages

The Anthropic-protocol chat endpoint — field names and response shape match Anthropic's own API.

On this page
text
POST https://api.apione.ai/v1/messages

In an SDK, set base_url to https://api.apione.ai (without /v1).

Request parameters

modelstringrequired

Model ID. Non-Anthropic models work too — the gateway translates.

max_tokensintegerrequired

Mandatory in this protocol; omitting it returns 400.

messagesobject[]required

Only user and assistant roles, alternating.

systemstring | object[]

System prompt — a top-level field, not a message.

streamboolean

Enables the named-event SSE stream.

temperaturenumber

0–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

json
{
  "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

json
{
  "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

text
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_stop

Contact us

Something unclear, or need a human? Pick the channel that fits your question.