Claude Opus 4.7
API guide
Chat completion
Standard chat call. TheRouter exposes Anthropic models behind the OpenAI-compatible /v1/chat/completions surface.
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 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 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 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 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 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
| source | URL | retrieved | |
|---|---|---|---|
| Release date | www.anthropic.com β | 2026-05-22 | verified |
| Anthropic model id | docs.anthropic.com β | 2026-05-22 | verified |
| Training cutoff | β | β | unknown |
| Reasoning effort levels | platform.claude.com β | 2026-05-22 | verified |
| Max vision input resolution | www.anthropic.com β | 2026-05-22 | verified |
| Tokenizer change vs Opus 4.6 | www.anthropic.com β | 2026-05-22 | verified |
| Deployment | aws.amazon.com β | 2026-05-22 | verified |
| License | β | β | verified |
| SWE-bench Verified | www.anthropic.com β | 2026-05-22 | verified |
| SWE-bench Pro | www.anthropic.com β | 2026-05-22 | verified |
| Terminal-Bench 2.0 | www.anthropic.com β | 2026-05-22 | verified |
| GPQA Diamond | www.anthropic.com β | 2026-05-22 | verified |
| MCP-Atlas | www.anthropic.com β | 2026-05-22 | verified |
| Finance Agent | www.anthropic.com β | 2026-05-22 | verified |
| Humanity's Last Exam (with tools) | www.anthropic.com β | 2026-05-22 | verified |
| XBOW visual acuity | www.anthropic.com β | 2026-05-22 | verified |
| Anthropic launches Claude Opus 4.7 with xhigh effort and 3.75 MP vision | anthropic.com/news β | 2026-05-22 | verified |
| Claude Opus 4.7 available in Amazon Bedrock at launch | aws.amazon.com/blogs/aws β | 2026-05-22 | verified |
| Anthropic deprecates manual budget_tokens β adaptive thinking is now mandatory on Opus 4.7 | platform.claude.com β | 2026-05-22 | verified |
| How much better is Opus 4.7 at coding than Opus 4.6? | www.anthropic.com β | 2026-05-22 | to verify |
| Do I need to change my API code to use Opus 4.7? | platform.claude.com β | 2026-05-22 | to verify |
| When should I use xhigh vs max effort? | platform.claude.com β | 2026-05-22 | to verify |
| What image resolutions does Opus 4.7 accept? | www.anthropic.com β | 2026-05-22 | to verify |
| Where can I run Opus 4.7? | aws.amazon.com β | 2026-05-22 | to verify |