Anthropic logo
Anthropic

Claude Opus 4.7

Anthropic's most capable generally available model for complex reasoning, agentic coding, and long-horizon work

Category Text Model ID claude-opus-4-7
Context Length1M tokens
Model TypeLarge Language Model (LLM)
MultimodalText, Image Input

Pricing & Specs

πŸ’° Pricing

Input$5 / M tokens
Output$25 / M tokens
Cache Write$5m: $6.25 / MTok; 1h: $10 / MTok / M tokens
Cache Hit$$0.50 / MTok / M tokens

βš™οΈ Specs

Context Length1M tokens
Model TypeLarge Language Model (LLM)
MultimodalText, Image Input
Extended ThinkingNo
Adaptive ThinkingYes
Max Output128K tokens
Release DateApril 16, 2026
TokenizerNew tokenizer; the same fixed text may use up to about 35% more tokens
API CompatibilityClaude API, Claude Code, OpenAI API

API Examples

Python

import anthropic

client = anthropic.Anthropic(
    api_key="your-api-key"
)

message = client.messages.create(
    model="claude-opus-4-7",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Claude!"}
    ]
)

print(message.content[0].text)

cURL

curl https://api.xairouter.com/v1/messages
  -H "Content-Type: application/json"
  -H "x-api-key: YOUR_API_KEY"
  -H "anthropic-version: 2023-06-01"
  -d '{
    "model": "claude-opus-4-7",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Hello, Claude!"}
    ]
  }'

Developer Assist

# Set environment variables in terminal
export ANTHROPIC_AUTH_TOKEN=sk-Xvs...  # Your API Key
export ANTHROPIC_BASE_URL=https://api.xairouter.com

# Start Claude Code
claude

# Now you can use claude-opus-4-7 model directly for development