inference-providers

Claude Opus 4.8

by anthropic · family claude

Facts

Release date2026-05-27
Retired date
Knowledge cutoff
Context (max)1,000,000
Max output
Modalitiestext, image → text
Aliasesclaude-opus-4.8claude-opus-4-8-fast
Open weightsno
DescriptionMay 2026 Opus release and latest of the 4.x line; $5/$25 per Mtok standard with 1M context and 128K output, fast mode $10/$50, ~$10/$37.50 premium above 200K prompt tokens.

Unknown values are shown as —.

Offerings

ProviderWire IDVariantEndpointProtocolStatusPrice (USD / Mtok)Reasoning
NEAR AI Cloudanthropic/claude-opus-4-8chatopenai-chatga5.00 / 25.00adaptive · default on · returns reasoning_content
OpenCode Zenclaude-opus-4-8messagesanthropic-messagesga5.00 / 25.00adaptive · default adaptive · returns thinking_blocks · round-trips signature
OpenRouteranthropic/claude-opus-4.8-fastfastchat-completionsopenai-chatretired10.00 / 50.00effort · default on · returns reasoning_content · round-trips reasoning_content
OpenRouteranthropic/claude-opus-4.8chat-completionsopenai-chatga5.00 / 25.00effort · default on · returns reasoning_content · round-trips reasoning_content

Reasoning controls

NEAR AI Cloud· anthropic/claude-opus-4-8· chat adaptive

adaptive · default on · returns reasoning_content

OpenCode Zen· claude-opus-4-8· messages adaptive

output_config.effort lowmediumhigh●xhighmax

adaptive · default adaptive · returns thinking_blocks · round-trips signature

Incompatible with: temperature, top_p, top_k, prefill

OpenRouter· anthropic/claude-opus-4.8-fast· chat-completions effort

reasoning.effort lowmediumhigh●xhighmax

effort · default on · returns reasoning_content · round-trips reasoning_content

OpenRouter· anthropic/claude-opus-4.8· chat-completions effort

reasoning.effort lowmediumhigh●xhighmax

effort · default on · returns reasoning_content · round-trips reasoning_content

Example requests

NEAR AI Cloud · openai-chat · anthropic/claude-opus-4-8

curl 'https://cloud-api.near.ai/v1/chat/completions' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "anthropic/claude-opus-4-8",
  "messages": [
    {
      "role": "user",
      "content": "Tell me about the weather."
    }
  ]
}'
Python (requests)
import requests

resp = requests.post(
    "https://cloud-api.near.ai/v1/chat/completions",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "anthropic/claude-opus-4-8",
      "messages": [
        {
          "role": "user",
          "content": "Tell me about the weather."
        }
      ]
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://cloud-api.near.ai/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "anthropic/claude-opus-4-8",
    "messages": [
      {
        "role": "user",
        "content": "Tell me about the weather."
      }
    ]
  }),
})
console.log(await resp.json())

OpenCode Zen · anthropic-messages · claude-opus-4-8

curl 'https://opencode.ai/zen/v1/messages' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "claude-opus-4-8",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Tell me about the weather."
    }
  ],
  "output_config": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://opencode.ai/zen/v1/messages",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "claude-opus-4-8",
      "max_tokens": 1024,
      "messages": [
        {
          "role": "user",
          "content": "Tell me about the weather."
        }
      ],
      "output_config": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://opencode.ai/zen/v1/messages", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "Tell me about the weather."
      }
    ],
    "output_config": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include signature artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).
  • Reported incompatible with thinking controls: temperature, top_p, top_k, prefill.

OpenRouter · openai-chat · anthropic/claude-opus-4.8-fast

curl 'https://openrouter.ai/api/v1/chat/completions' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "anthropic/claude-opus-4.8-fast",
  "messages": [
    {
      "role": "user",
      "content": "Tell me about the weather."
    }
  ],
  "reasoning": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://openrouter.ai/api/v1/chat/completions",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "anthropic/claude-opus-4.8-fast",
      "messages": [
        {
          "role": "user",
          "content": "Tell me about the weather."
        }
      ],
      "reasoning": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://openrouter.ai/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "anthropic/claude-opus-4.8-fast",
    "messages": [
      {
        "role": "user",
        "content": "Tell me about the weather."
      }
    ],
    "reasoning": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include reasoning_content artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).

OpenRouter · openai-chat · anthropic/claude-opus-4.8

curl 'https://openrouter.ai/api/v1/chat/completions' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "anthropic/claude-opus-4.8",
  "messages": [
    {
      "role": "user",
      "content": "Tell me about the weather."
    }
  ],
  "reasoning": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://openrouter.ai/api/v1/chat/completions",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "anthropic/claude-opus-4.8",
      "messages": [
        {
          "role": "user",
          "content": "Tell me about the weather."
        }
      ],
      "reasoning": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://openrouter.ai/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "anthropic/claude-opus-4.8",
    "messages": [
      {
        "role": "user",
        "content": "Tell me about the weather."
      }
    ],
    "reasoning": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include reasoning_content artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).