Back to Models

Claude Opus 4.7

anthropicanthropic/claude-opus-4.7

API guide

Chat completion

Standard chat call. TheRouter exposes Anthropic models behind the OpenAI-compatible /v1/chat/completions surface.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "messages": [{"role": "user", "content": "Refactor this Python function for clarity."}]
  }'

Streaming

Stream tokens as they're produced β€” useful for chat UIs and long-form generation. Opus 4.7 at xhigh effort can take several seconds to reach first token; streaming surfaces output as soon as it's available.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "stream": true,
    "messages": [{"role": "user", "content": "Explain MoE routing in 200 words."}]
  }'

Tool use

Opus 4.7 is the first Claude model to pass Anthropic's 'implicit-need' tool tests β€” it can infer when a tool is required rather than waiting for explicit instructions. Tool-error rate is reported as ~β…“ of Opus 4.6.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "messages": [{"role": "user", "content": "What is the weather in Tokyo right now?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get current weather for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }]
  }'

Structured JSON

Use response_format to constrain output to valid JSON. Useful for extraction pipelines and downstream parsers.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "response_format": {"type": "json_object"},
    "messages": [
      {"role": "system", "content": "Respond with JSON: {\"sentiment\":string,\"score\":number}"},
      {"role": "user", "content": "Service was excellent, food cold."}
    ]
  }'

Vision input

Opus 4.7 accepts images up to 2,576 px on the long edge (~3.75 MP). Use base64 or URL references in the OpenAI-compatible content array. For very large screenshots or scanned PDFs this is the upgrade that actually matters.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "What error is shown in this screenshot?"},
        {"type": "image_url", "image_url": {"url": "https://example.com/screenshot.png"}}
      ]
    }]
  }'

Reasoning effort

Opus 4.7 uses adaptive thinking β€” control depth via the reasoning.effort field (low/medium/high/xhigh/max). Manual budget_tokens is no longer supported. Anthropic recommends xhigh for coding and agent work, high as the floor for intelligence-sensitive tasks, max only when evals show measurable headroom.

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "reasoning": {"effort": "xhigh"},
    "max_tokens": 65536,
    "messages": [{"role": "user", "content": "Diagnose this concurrency bug: ..."}]
  }'
Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release datewww.anthropic.com β†—2026-05-22verified
Anthropic model iddocs.anthropic.com β†—2026-05-22verified
Training cutoffβ€”β€”unknown
Reasoning effort levelsplatform.claude.com β†—2026-05-22verified
Max vision input resolutionwww.anthropic.com β†—2026-05-22verified
Tokenizer change vs Opus 4.6www.anthropic.com β†—2026-05-22verified
Deploymentaws.amazon.com β†—2026-05-22verified
Licenseβ€”β€”verified
SWE-bench Verifiedwww.anthropic.com β†—2026-05-22verified
SWE-bench Prowww.anthropic.com β†—2026-05-22verified
Terminal-Bench 2.0www.anthropic.com β†—2026-05-22verified
GPQA Diamondwww.anthropic.com β†—2026-05-22verified
MCP-Atlaswww.anthropic.com β†—2026-05-22verified
Finance Agentwww.anthropic.com β†—2026-05-22verified
Humanity's Last Exam (with tools)www.anthropic.com β†—2026-05-22verified
XBOW visual acuitywww.anthropic.com β†—2026-05-22verified
Anthropic launches Claude Opus 4.7 with xhigh effort and 3.75 MP visionanthropic.com/news β†—2026-05-22verified
Claude Opus 4.7 available in Amazon Bedrock at launchaws.amazon.com/blogs/aws β†—2026-05-22verified
Anthropic deprecates manual budget_tokens β€” adaptive thinking is now mandatory on Opus 4.7platform.claude.com β†—2026-05-22verified
How much better is Opus 4.7 at coding than Opus 4.6?www.anthropic.com β†—2026-05-22to verify
Do I need to change my API code to use Opus 4.7?platform.claude.com β†—2026-05-22to verify
When should I use xhigh vs max effort?platform.claude.com β†—2026-05-22to verify
What image resolutions does Opus 4.7 accept?www.anthropic.com β†—2026-05-22to verify
Where can I run Opus 4.7?aws.amazon.com β†—2026-05-22to verify
Customer Support