跳转到主要内容

Claude PDF Support

POST /v1/messages
As of March 23, 2026, Crazyrouter production has verified that claude-sonnet-4-6 can read a Base64 PDF through the native Messages API and return a text summary.

Verified Minimal Request

curl https://crazyrouter.com/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 512,
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "document",
            "source": {
              "type": "base64",
              "media_type": "application/pdf",
              "data": "JVBERi0xLjQK..."
            }
          },
          {
            "type": "text",
            "text": "Summarize the document in one sentence."
          }
        ]
      }
    ]
  }'
Observed production response shape:
{
  "model": "claude-sonnet-4-6",
  "content": [
    {
      "type": "text",
      "text": "The document is a simple Crazyrouter PDF test document..."
    }
  ]
}
This page keeps only the Base64 PDF path that was revalidated successfully. Remote URLs, multi-PDF comparison, and streamed PDF output were not rechecked item by item in this pass.