APIMart
Back to all models

Claude Opus 4.8 API

AnthropicModel ID claude-opus-4-8Text modelReleased May 28, 2026

Use Claude Opus 4.8 to find which call sites break in a library upgrade, check whether a contract cap covers a confidentiality breach, or plan the clicks to export a report from a web app.

Max input
1,000,000 tokens
Max output
128,000 tokens
Input → output
Text, Image → Text
Knowledge cutoff
January 2026
  • Image input
  • Streaming
  • Cached input pricing
  • OpenAI SDK compatible

Claude Opus 4.8 API use cases

Each use case comes with an illustrative example: source material, a prompt and a hand-written sample answer, not actual model output. Copy the prompt, swap in your own material and try it on Claude Opus 4.8.

Try Claude Opus 4.8 with your own material

Large code migrations

Give Claude Opus 4.8 the library’s changelog and the code that calls it, and have it list every call site that breaks and the change each one needs. Run the test suite after each batch of edits.

Example: Which calls break in the v4 upgrade?

Material

Changelog v4.0
fetchUser(id, callback) is removed; use await fetchUser(id). The option retries now defaults to 0 (was 3).
Call sites
a.ts: fetchUser(id, (err, user) => render(user)) · b.ts: const u = await fetchUser(id, { retries: 3 }) · c.ts: const u = await fetchUser(id)

PromptUsing the changelog and the call sites, list each call that breaks in v4 and the smallest change it needs.

Sample answer · written by hand to show the reasoning

a.ts breaks: the callback form is removed, so change it to const user = await fetchUser(id); render(user); inside an async function. b.ts keeps working because it already awaits and sets retries explicitly. c.ts still compiles but silently loses its 3 retries; add { retries: 3 } if the old behaviour is still needed.

About the Claude Opus 4.8 API

  • The strongest Opus 4 model

    Anthropic released Claude Opus 4.8 on May 28, 2026, building on Opus 4.7 at the same price, with gains in agentic coding, legal work, computer use and honesty about its own code.

  • Opus 5.5 costs 20% less

    Anthropic released Claude Opus 5.5 on September 22, 2026 and now lists Opus 4.8 as legacy. Start new projects on Opus 5.5; workloads validated on Opus 4.8 can stay, with retirement not before May 28, 2027.

  • 1M context, thinking on request

    The full 1M-token context window is billed at standard prices, with up to 128K output tokens. Adaptive thinking runs when you turn it on, with effort from low to max.

  • Claude Opus 4.8 API key and access

    You don’t need a separate Claude Opus 4.8 API key: one APIMart key works for every model. Check the Claude Opus 4.8 pricing table on this page, then call an OpenAI Chat Completions-compatible endpoint with the model ID claude-opus-4-8.

Claude Opus 4.8 official benchmark results

Selected results Anthropic published at launch.

  • SWE-bench Pro

    69.2%

    Real software engineering tasks. Up from 64.3% for Opus 4.7 and ahead of GPT-5.5 (58.6%) and Gemini 3.1 Pro (54.2%).

  • OSWorld-Verified

    83.4%

    Completing tasks by operating a computer. Ahead of Opus 4.7 (82.8%), GPT-5.5 (78.7%) and Gemini 3.1 Pro (76.2%).

  • GDPval-AA

    1,890 Elo

    Knowledge work across occupations, rated in Elo. Ahead of GPT-5.5 (1,769), Opus 4.7 (1,753) and Gemini 3.1 Pro (1,314).

  • MCP-Atlas

    82.2%

    Tool use through MCP servers. Ahead of Opus 4.7 (79.1%), Gemini 3.1 Pro (78.2%) and GPT-5.5 (75.3%).

  • Humanity’s Last Exam (with tools)

    57.9%

    Hard questions across many disciplines. Ahead of Opus 4.7 (54.7%), GPT-5.5 (52.2%) and Gemini 3.1 Pro (51.4%).

  • BrowseComp

    84.3%

    Finding hard-to-locate facts by browsing, single agent. Up from 79.8% for Opus 4.7; GPT-5.5 scores 84.4% and Gemini 3.1 Pro 85.9%.

How to call the Claude Opus 4.8 API

To call Claude Opus 4.8, you only need an APIMart API key and your existing OpenAI SDK, or send plain HTTP requests.

POST /v1/chat/completions
curl https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "claude-opus-4-8",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

Claude Opus 4.8 access details

Model IDclaude-opus-4-8
Base URLhttps://api.apimart.ai/v1
Endpoint/chat/completions

Common parameters

model
Required
messages
Required
stream
Optional
max_tokens
Optional
temperature
Optional
All request parameters, response fields and error codes

Claude Opus 4.8 API request parameters

Claude Opus 4.8 uses the general chat endpoint, POST /v1/chat/completions, with a JSON body. model and messages are required; every other parameter is optional.

ParameterTypeRequiredDescription
modelstringYesModel ID. Use claude-opus-4-8 for this model.
messagesarrayYesConversation messages. Each message has a role (system, user, or assistant) and content. Include earlier messages for multi-turn conversations.
streambooleanNoWhether to stream the output. true returns chunks over SSE, false returns the full response at once. Default: true.
temperaturenumberNoOutput randomness, 0–2. Default: 1.0. Lower values give more deterministic output.
top_pnumberNoNucleus sampling, 0–1. Default: 1.0. Adjust this or temperature, not both.
max_tokensintegerNoMaximum number of tokens to generate for the reply.
frequency_penaltynumberNoFrequency penalty, -2.0 to 2.0. Default: 0. Positive values reduce repeated wording.
presence_penaltynumberNoPresence penalty, -2.0 to 2.0. Default: 0. Positive values encourage new topics.
stopstring | arrayNoUp to 4 stop sequences. Generation stops when any of them appears.
nintegerNoNumber of replies to generate. Default: 1.

Response fields

The response contains the fields below. Token usage is returned in usage, which you can use to check costs.

FieldTypeDescription
idstringUnique identifier for the request.
modelstringThe model that handled the request.
choicesarrayList of replies. Each item contains message (role and content) and finish_reason.
usageobjectToken usage: prompt_tokens, completion_tokens, and total_tokens.

Error codes

Failed requests return an error object with code, message, and type.

StatusTypeMeaning
400invalid_request_errorInvalid request parameters.
401authentication_errorThe API key is invalid or missing.
402payment_requiredInsufficient account balance.
403permission_errorNo permission to access this resource.
429rate_limit_errorToo many requests. Retry later.
500server_errorInternal server error.
502bad_gatewayGateway error. The service is temporarily unavailable.

Claude Opus 4.8 API pricing

The Claude Opus 4.8 API is billed by token usage, and prices depend on your membership tier. Prices below are per million tokens; 1 US dollar = 10 credits.

ItemGoldCurrent pricePlatinumDiamondOfficial priceYou save
Input40Credits~$438Credits~$3.836Credits~$3.650Credits~$520%
Cached input4Credits~$0.43.8Credits~$0.383.6Credits~$0.365Credits~$0.520%
Output200Credits~$20190Credits~$19180Credits~$18250Credits~$2520%

Prices are for reference only. View full pricing

Why call Claude Opus 4.8 API through APIMart

  • 20% below official pricing

    Claude Opus 4.8 API pricing is billed by token usage. Gold to Diamond member prices are 20%–28% below Anthropic's official prices, and cached input costs just $0.4 per 1M tokens.

    See membership prices
  • One API key for 500+ models

    Claude Opus 4.8, the rest of its family and 500+ models from GPT, Claude, Gemini and more share one API key and one account balance. Switching models is just a change to the model parameter.

  • Change two lines of existing code

    If you already use the OpenAI SDK, point base_url at https://api.apimart.ai/v1 and swap in your APIMart API key. Requests and responses keep the same format.

  • Try it online before you code

    Try Claude Opus 4.8 with your own material in the Playground, no code or setup needed, and integrate once you like the results.

    Open Playground

Which Anthropic model should you choose?

Base prices per 1M tokens (USD). Your Claude Opus 4.8 API key works for every model in the table; just change the model parameter.

Differences between Anthropic models
ComparisonClaude Opus 4.8 CurrentClaude Sonnet 4.5Claude Haiku 4.5Claude Opus 4.5Claude Opus 4.6Claude Sonnet 4.6Claude Opus 4.7Claude Fable 5Claude Sonnet 5Claude Opus 5Claude Haiku 5.5Claude Sonnet 5.5Claude Opus 5.5Claude Fable 5.1Claude Fable 5.2
Best forLarge code migrations, Legal and knowledge work, Computer useCoding and agents, Computer use, 200K contextSmall model, Sub-agents and bulk tasks, 200K contextCoding and agents, Adjustable effort, 200K contextCoding and code review, Knowledge work, 1M contextCoding, Computer use, 1M contextHard coding tasks, High-resolution images, Long agentic runsLong-running agents, Software engineering, Knowledge work and scienceCoding, Research agents, Computer useCoding, Agents, Knowledge workClassification & routing, Data extraction, Sub-agent tasksEveryday coding, Agentic tasks, Data analysisAgentic coding, Large-scale refactoring, Knowledge workCode review, Long-running coding, Documents and spreadsheetsHard coding problems, Scientific research, Financial modeling
Max input1,000,000 tokens200,000 tokens200,000 tokens200,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens
Max output128,000 tokens64,000 tokens64,000 tokens64,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens
Knowledge cutoffJanuary 2026January 2025February 2025May 2025May 2025August 2025January 2026January 2026January 2026May 2026June 2026June 2026June 2026June 2026June 2026
Input price$4$2.4$0.8$4$4$2.4$4$8$1.6$4$0.08$1.6$3.2$8$6.4
Output price$20$12$4$20$20$12$20$40$8$20$0.4$8$16$40$32

Claude Opus 4.8 FAQ

Should I use Claude Opus 4.8 or Claude Opus 5.5?

Start new projects on Claude Opus 5.5. Anthropic released it on September 22, 2026 at official prices 20% lower than Opus 4.8, and its model docs now point Opus 4.8 users to Opus 5.5. In between, Anthropic released Claude Opus 5 on July 24, 2026 at the same price as Opus 4.8 and called it a step-change improvement. Workloads already tuned and validated on Opus 4.8 can stay on it. On APIMart all three share one endpoint and API key, so you only change the model parameter.

How is Claude Opus 4.8 different from Opus 4.7?

Anthropic says Opus 4.8 builds on Opus 4.7 with improvements across benchmarks at the same official price. In Anthropic’s system card it scores 69.2% vs. 64.3% on SWE-bench Pro and 1,890 vs. 1,753 on GDPval-AA, and Anthropic says it is about four times less likely than Opus 4.7 to let flaws in its own code pass without mention. The request format is the same, so switching is a change of model ID followed by re-testing your prompts.

Does Claude Opus 4.8 think before answering?

Only when you turn it on. According to Anthropic’s docs, Opus 4.8 supports adaptive thinking only, and in Anthropic’s official API a request that leaves out the thinking setting runs without thinking; set thinking to adaptive to let the model decide how much to think. Effort ranges from low to max, with high as the default. Claude Opus 5 and later turn thinking on by default.

Does input over 200K tokens cost more?

No. According to Anthropic’s pricing docs, Claude Opus 4.8 includes its full 1M-token context window at standard prices, with no long-context surcharge. The pricing table on this page applies to the whole window.

Is Claude Opus 4.8 being retired?

Not yet. Anthropic lists claude-opus-4-8 as an active legacy model, with retirement not sooner than May 28, 2027. Legacy means it no longer receives updates and may be deprecated later; this page will show a notice and a replacement link if that happens.

How can I try this model online?

Click Start chatting or Open Playground to visit the existing APIMart Playground. Select Claude Opus 4.8 in the text category to start exploring.

Which model ID does the Claude Opus 4.8 API use?

Set model to claude-opus-4-8. Copy the exact ID from the page heading or the integration details panel.

Is it compatible with the OpenAI SDK?

You can keep the OpenAI SDK. Set base_url to https://api.apimart.ai/v1, provide your APIMart API key, and use the model ID on this page.

What is the context window of Claude Opus 4.8?

On APIMart, Claude Opus 4.8 accepts up to 1,000,000 input tokens per request. Your prompt, earlier messages, and file content all count toward it.

How many tokens can it output at once?

Claude Opus 4.8 can output up to 128,000 tokens in a single reply. Use the max_tokens parameter to set a lower limit.

How much does the Claude Opus 4.8 API cost?

The Claude Opus 4.8 API on APIMart is billed by token, and prices depend on your membership tier. Gold: $4 per million input tokens and $20 per million output tokens. Diamond: $3.6 per million input tokens and $18 per million output tokens. Prices may change; the pricing page has the current rates.

Does it support streaming?

Yes. The general chat endpoint streams over SSE by default. Set stream to false to receive the complete response at once.

How do I get an API key?

Sign in to APIMart and create a key on the API Keys page, then send it in the Authorization: Bearer header. The same key also works for other models on the platform.