Skip to Content

Messages

Stable

Anthropic-compatible POST /api/v1/messages for Claude Code and other clients that expect the Anthropic Messages API.

Endpoint

POST/api/v1/messages

Authentication

Use your Cloud API key with either Authorization: Bearer ... or X-API-Key.

Claude Code and Anthropic SDK clients should also send:

Example

curl -X POST "https://cloud.milady.ai/api/v1/messages" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 512, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "summarize my priorities for today" } ] } ] }'

Supported Fields

FieldTypeRequiredNotes
modelstringyesAccepts Anthropic-style model ids such as claude-sonnet-4-6
max_tokensintegeryesOutput token cap
messagesarrayyesAnthropic message array
systemstring or arraynoAnthropic system prompt format
streambooleannoEmits Anthropic SSE events
temperaturenumbernoPassed through when supported
top_pnumbernoPassed through when supported
top_knumbernoPassed through when supported
stop_sequencesarraynoAnthropic stop sequences
toolsarraynoAnthropic tool definitions
tool_choiceobjectnoauto, any, none, or a named tool

Message Content

Supported content blocks:

Streaming

When stream: true, the route emits Anthropic-style SSE events such as:

Tool calls stream as Anthropic tool_use content blocks so Claude Code can continue multi-step workflows.

This route is intended as a compatibility layer. Billing, auth, moderation, and credit enforcement still run through elizaOS Cloud.