Claude native format

Anthropic's Messages API, served as-is for the Anthropic SDK.

POSThttps://your-instance.com/v1/messages

This is the Anthropic Messages API, unmodified. Reach for it when you want Claude-specific features the OpenAI shape cannot express — fine-grained cache control, thinking blocks, or the tool format the Anthropic SDK expects.

Authentication

Both header styles work, so the Anthropic SDK drops in without a shim: send your key as x-api-key, or as a normal bearer token.

curl https://your-instance.com/v1/messages \
  -H "x-api-key: $CLAWROUTER_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Prompt caching

Mark a stable prefix with cache_control and subsequent requests reuse it. Cache reads are billed at a fraction of the normal input rate, and the cached, written and uncached portions are itemised separately in your usage log.

JSON
{
  "model": "claude-sonnet-5",
  "max_tokens": 1024,
  "system": [
    {
      "type": "text",
      "text": "<a long, stable instruction block>",
      "cache_control": { "type": "ephemeral" }
    }
  ],
  "messages": [{ "role": "user", "content": "Hello" }]
}