Skip to main content

POST /v1/messages

Anthropic-compatible message creation. Use the official anthropic SDK with the gateway base URL — and call any catalog model through it, not just Claude.

Request body

FieldTypeRequiredDescription
modelstringrequiredCatalog model id.
messagesarrayrequireduser / assistant turns; content is a string or content-block array.
max_tokensintegerrequiredAnthropic surface requires an explicit cap.
systemstringSystem prompt.
streambooleanStream Anthropic-style events over SSE.
toolsarrayAnthropic tool definitions.

Example

curl https://gateway.oya.moe/v1/messages \
-H "Authorization: Bearer $ARKAFLOW_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-7",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'

Cross-surface behaviour

The two surfaces are interchangeable views over the same catalog: a model called via /v1/messages bills and routes identically to the same model via /v1/chat/completions. Pick the surface your codebase already speaks.

Errors use the shared vocabulary — see Errors.