IranRouter
Docs contents

Docs

Messages (Anthropic)

POST /v1/messages — for tools that speak Anthropic's format.

POSThttps://iranrouter.com/v1/messages

Some 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_result blocks
  • Tools both ways: toolstool_use in the response, and finish_reasonstop_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.