Docs
Messages (Anthropic)
POST /v1/messages — for tools that speak Anthropic's format.
POST
https://iranrouter.com/v1/messagesSome tools speak Anthropic's Messages format instead of OpenAI's. You do not need an adapter — the same origin answers this path too, with the same ir- key.
bash
curl https://iranrouter.com/v1/messages \
-H "Authorization: Bearer ir-..." \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-4.5",
"max_tokens": 512,
"messages": [{"role": "user", "content": "سلام"}]
}'What is translated
- system as a string or blocks, and
text/image/tool_use/tool_resultblocks - Tools both ways:
tools→tool_usein the response, andfinish_reason→stop_reason - Stream events in Anthropic's event shape.
/v1/messages/count_tokens is not implemented yet. If your tool calls it before every request, that call will fail.If the choice is yours, chat/completions is the primary and more complete surface.