
How to Use Claude Opus 5 API with EvoLink: Production Setup and Migration
claude-opus-5. Create an EvoLink API key, then send a Claude Messages request to the direct EvoLink Messages endpoint. The route uses the existing EvoLink Claude Messages API contract, so teams already using a Claude route can migrate without adding a second provider integration.response.model, usage, billing, streaming, and tool behavior with your own account, then promote traffic by workload. This separates “the route is live” from the stronger claim that every application path has passed its rollout gates.max_tokens interact, what changes when you migrate from Opus 4.8, how to handle refusals and transport failures, and where Opus 5 belongs in a cost-aware production routing policy.Claude Opus 5 API Quick Facts
| Field | Verified value | Why it matters |
|---|---|---|
| Anthropic model ID | claude-opus-5 | Use the exact identifier supported by your API provider |
| Context window | 1M tokens | Large repositories and document sets can fit in one model context, but sending all available context is rarely the cheapest design |
| Maximum output | 128K tokens | max_tokens still limits thinking plus visible output |
| Thinking | On by default | A request that omitted thinking on Opus 4.8 changes behavior after migration |
| Effort levels | low, medium, high, xhigh, max | Effort is the main control for intelligence, latency, and token use |
| Official base price | $5 per million input tokens and $25 per million output tokens | The same base token price as Opus 4.8 |
| EvoLink Messages endpoint | Direct Messages endpoint | Recommended EvoLink endpoint for long-running Claude requests |
| EvoLink route status | Available | Call claude-opus-5 through the EvoLink Messages API and validate production behavior with your own workload |
The practical takeaway is simple: Claude Opus 5 is callable through EvoLink now, while parameter compatibility, billing, and operational behavior should still be validated with a real account-level request before full production rollout.
Why Use Claude Opus 5 Through a Unified API
Calling a new model is easy. Keeping an application flexible after the launch week is harder.
A direct integration can be the right choice when a team needs every Anthropic-native feature immediately and intends to use only Claude. A unified gateway becomes more useful when the application must choose among models, contain cost, preserve a fallback, or switch providers without spreading model-specific code through the product.
EvoLink's useful role is therefore not to make every request an Opus 5 request. It is to keep model selection at the routing layer:
Application task
-> routing policy
-> selected model
-> Messages API request
-> actual-model and usage verification
-> quality and cost record
-> promote, retry, fall back, or roll backThis architecture gives a team four concrete advantages:
- One integration surface. The application sends Claude-style messages through one documented endpoint.
- Configurable model selection. Business logic describes the job, such as
routine_codingorarchitecture_escalation, while configuration chooses the current model. - Measurable fallback. A retry or model change becomes an explicit operational event rather than an invisible benchmark contaminant.
- Migration flexibility. The next model change is primarily a routing and evaluation decision, not a rewrite across prompts, product code, and customer settings.
Make the First Claude Opus 5 Call
1. Confirm account access before changing production code
The EvoLink route is available. Before changing production traffic, confirm that your account can call it and that the complete application path behaves as expected:
claude-opus-5is listed for your EvoLink account.- A minimal request returns HTTP 200.
response.modelidentifies the expected model.- The usage record and charged amount match the current EvoLink pricing surface.
- Required features such as streaming or tools work on the same route.
If your account does not expose the route or a required feature fails, keep the existing model as the fallback and resolve the account or compatibility issue before rollout.
2. Store the API key on the server
Create an EvoLink API key and load it from a server-side environment variable:
export EVOLINK_API_KEY="your_api_key_here"NEXT_PUBLIC_* variable.3. Send a minimal request
The minimal request follows EvoLink's Claude Messages API shape:
curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header "Authorization: Bearer $EVOLINK_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "claude-opus-5",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": "Review this service architecture and identify the three highest-risk failure points."
}
]
}'Start without optional parameters. A small payload isolates authentication, route availability, and the core request contract before effort, tools, streaming, or caching add more failure modes.
4. Verify the response, not only the status code
A successful HTTP response proves that the endpoint returned something. It does not by itself prove that the intended model served the request or that the result belongs in an Opus 5 evaluation.
Record at least:
response.modelresponse.stop_reason- input and output usage
- request latency
- request ID when available
- application task ID
- retry and fallback count
The following server-side TypeScript example distinguishes non-retryable client errors from retryable capacity failures and verifies the returned model without using untyped values:
type Usage = {
input_tokens: number
output_tokens: number
cache_creation_input_tokens?: number
cache_read_input_tokens?: number
}
type TextBlock = {
type: 'text'
text: string
}
type MessageResponse = {
id: string
model: string
stop_reason: string | null
content: TextBlock[]
usage: Usage
}
const RETRYABLE_STATUS = new Set([429, 500, 503, 524])
function isMessageResponse(value: unknown): value is MessageResponse {
if (typeof value !== 'object' || value === null) return false
const record = value as Record<string, unknown>
return (
typeof record.id === 'string' &&
typeof record.model === 'string' &&
Array.isArray(record.content) &&
typeof record.usage === 'object' &&
record.usage !== null
)
}
async function callClaudeOpus5(prompt: string): Promise<MessageResponse> {
const credential = process.env.EVOLINK_API_KEY
if (!credential) throw new Error('EVOLINK_API_KEY is not configured')
for (let attempt = 0; attempt < 3; attempt += 1) {
const response = await fetch('https://direct.evolink.ai/v1/messages', {
method: 'POST',
headers: {
Authorization: `Bearer ${credential}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'claude-opus-5',
max_tokens: 4096,
messages: [{ role: 'user', content: prompt }],
}),
signal: AbortSignal.timeout(120_000),
})
if (response.ok) {
const payload: unknown = await response.json()
if (!isMessageResponse(payload)) {
throw new Error('Unexpected Claude Messages API response')
}
if (payload.model !== 'claude-opus-5') {
throw new Error(`Unexpected response model: ${payload.model}`)
}
return payload
}
if (!RETRYABLE_STATUS.has(response.status) || attempt === 2) {
throw new Error(`Claude request failed with HTTP ${response.status}`)
}
const backoffMs = 1_000 * 2 ** attempt + Math.floor(Math.random() * 250)
await new Promise((resolve) => setTimeout(resolve, backoffMs))
}
throw new Error('Claude request exhausted its retry policy')
}This is a reference pattern, not a substitute for account-level testing. In a high-volume service, add structured logs, request correlation, concurrency controls, and a fallback chosen by your routing policy.
How Thinking, Effort, and max_tokens Interact
Opus 5 changes the behavior of an otherwise familiar request. Thinking is on by default, and effort controls how much compute the model can apply.

| Thinking configuration | Effort | Valid on Anthropic's Opus 5 contract? | Production implication |
|---|---|---|---|
| Default or adaptive | low | Yes | Lowest-cost evaluation lane |
| Default or adaptive | medium | Yes | Useful cost and latency baseline |
| Default or adaptive | high | Yes | API default and general intelligence-sensitive route |
| Default or adaptive | xhigh | Yes | Recommended starting point for difficult coding and agentic work |
| Default or adaptive | max | Yes | Capability-critical tasks where extra token use is acceptable |
| Disabled | low, medium, or high | Yes | Requires extra output and tool-call validation |
| Disabled | xhigh or max | No | Returns a 400 error |
xhigh for coding and agentic work, using high for other intelligence-sensitive workloads, and testing low or medium wherever evaluation quality holds. At xhigh or max, Anthropic suggests starting with at least 64K max_tokens so the model has room for thinking, subagents, and tool calls.Three details prevent common integration mistakes:
max_tokenscovers thinking and visible output. A ceiling inherited from a no-thinking Opus 4.8 route may truncate an Opus 5 task earlier than expected.- Effort does not reliably control visible answer length. Prompt explicitly for a concise response or target deliverable length.
- Provider support can differ. Only send
output_config.effortthrough EvoLink after its current route documentation or a real test confirms the field is accepted.
Keep thinking enabled where practical. Anthropic warns that disabling thinking can occasionally cause a tool call to appear as ordinary text or expose internal XML-like tags in the visible response.
Migrate from Claude Opus 4.8 Without Carrying Old Assumptions
The model ID change is the easy part:
- "model": "claude-opus-4-8"
+ "model": "claude-opus-5"Request migration
- Requests without a
thinkingfield now run with thinking on. - Revisit
max_tokensfor workflows that previously ran without thinking. - Do not combine disabled thinking with
xhighormax. - Confirm no
temperature,top_p, ortop_kvalues linger from pre-4.8 configs — Opus 4.8 already rejects them, and Opus 5 keeps the same behavior. - Test the new 512-token prompt-cache minimum if repeated prompts were previously too short to cache.
- Handle
stop_reason: "refusal"as an application outcome.
Prompt migration
Opus 5 is more likely to verify its own work, narrate progress, and delegate to subagents. Prompts tuned for an earlier model can accidentally multiply those behaviors.
Update prompts in four ways:
- Specify the intended answer or document length.
- Remove unconditional instructions to double-check or add a final verifier.
- Constrain scope for narrow tasks.
- Cap subagent delegation unless independent parallel work justifies it.
Harness migration
Replay representative tasks through the whole application, not only the raw model call. Verify:
- tool selection and arguments
- streaming parser behavior
- timeout and retry limits
- refusal handling
- actual returned model
- token and cache usage
- output length
- task acceptance by the real reviewer or downstream check
Promote Opus 5 by workload. A model can improve difficult architecture tasks while adding unnecessary cost to routine extraction.
Handle Tool Use, Streaming, Refusals, and Transport Failures
The EvoLink Messages API exposes streaming, tools, tool choice, usage, and stop reasons. A production loop should branch on the response rather than assume every 200 response contains a final answer.
Send message
-> end_turn: return the answer
-> tool_use: execute the allowed tool and continue
-> refusal: apply the refusal and fallback policy
-> max_tokens: mark the result incomplete
-> transport error: retry only when the error is retryableSet a maximum tool-loop count, validate every tool argument, and preserve the trace needed to explain a failed task. Never execute a model-produced tool call without application-level authorization and schema validation.
Treat failures by class:
| Outcome | Recommended action |
|---|---|
| 400 invalid request | Fix model, thinking, effort, sampling, or schema fields; do not blindly retry |
| 401 authentication | Correct server-side credentials |
| 402 billing | Restore credits or change the product response |
| 404 model not found | Recheck the EvoLink model enum and account access |
| 429 rate limit | Apply bounded exponential backoff with jitter |
| 503 overloaded | Retry within a strict budget or move to an approved fallback |
| 524 timeout | Use the direct endpoint, set a long-task timeout, and avoid duplicate untracked work |
stop_reason: "refusal" | Record the outcome and apply the workload's fallback or user-message policy |
A refusal is not the same as a failed HTTP request. Anthropic documents it as a normal response outcome for Opus 5. Automatic fallback may be available on Anthropic's native API, but confirm the EvoLink equivalent before putting provider-specific fields into a gateway request.
Measure Cost per Successful Task
Claude Opus 5 keeps the same official base token price as Opus 4.8, but list price does not tell a production team which route is cheaper.
Use this decision metric:
successful-task cost =
input token cost
+ output token cost
+ retry cost
+ fallback cost
+ tool execution cost
+ human review or repair costmedium, high, and xhigh. Record whether the task passed, not merely how fluent the output sounded. A higher-effort request can be economical if it prevents retries and manual repair. It can also be wasteful when the task would pass at medium.The evaluation table should include:
| Metric | Why it belongs |
|---|---|
| Accepted-task rate | Measures whether the result was usable |
| Total input and output tokens | Captures the full model bill |
| Cache reads and writes | Shows whether repeated context is being reused |
| Tool calls and failures | Exposes agent-loop overhead |
| Retries and fallbacks | Prevents hidden multi-request cost |
| End-to-end latency | Separates interactive and background fit |
| Human review time | Captures cleanup that token pricing misses |
Do not publish a universal effort recommendation from a single prompt. Choose the lowest-effort lane that meets the quality threshold for each workload, then reserve escalation for tasks where failure is expensive.
Route Sonnet, Opus, and Fable by Workload

| Workload | Suggested starting route | Escalation signal |
|---|---|---|
| Classification, extraction, and short rewrites | Lower-cost model | Schema or quality failures exceed the accepted threshold |
| Everyday coding and production assistant work | Claude Sonnet 5 | Repeated debugging failure, wide repository scope, or higher decision risk |
| Complex debugging, architecture, and long agent loops | Claude Opus 5 | The task remains unresolved and the expected value justifies the premium |
| Highest-difficulty autonomous or knowledge work | Claude Fable 5 | Use only where the measured task value supports the higher price |
Store the routing decision in configuration:
type Workload =
| 'routine_text'
| 'everyday_coding'
| 'complex_agent'
| 'frontier_escalation'
const modelByWorkload: Record<Workload, string> = {
routine_text: 'configured-low-cost-model',
everyday_coding: 'claude-sonnet-5',
complex_agent: 'claude-opus-5',
frontier_escalation: 'claude-fable-5',
}The application should log both the requested and returned model. If a fallback occurs, exclude that trace from a clean Opus 5 benchmark or label it separately.
Production Readiness Checklist
Before moving real traffic to Opus 5:
-
claude-opus-5is listed for the EvoLink account. - A minimal request returns the expected
response.model. - Usage and billing match the documented route.
- Streaming is verified if the product depends on it.
- Every required tool path has a valid request and result trace.
- The application distinguishes refusal from HTTP failure.
- Retryable and non-retryable errors follow different policies.
- A known fallback route exists and has been exercised.
- Representative tasks have been replayed at multiple effort levels.
- Promotion thresholds use accepted-task rate, latency, and successful-task cost.
- Model IDs live in configuration rather than business logic.
- Rollback conditions are explicit.
FAQ
What is the Claude Opus 5 API model ID?
claude-opus-5. Keep it in configuration and verify the returned model when evaluating production traffic.Is Claude Opus 5 available through EvoLink?
claude-opus-5 with the EvoLink Claude Messages API. See the Claude Opus 5 model page for the current product and pricing surface.Which EvoLink endpoint should I use?
Is thinking enabled by default on Claude Opus 5?
thinking field leaves adaptive thinking on. This differs from Opus 4.8 requests that ran without thinking when the field was absent.Which effort level should I choose?
xhigh for difficult coding and agentic work, high for other intelligence-sensitive tasks, and evaluate medium or low as cost and latency controls. Use max only when the task value justifies unconstrained token spending.How do I migrate from Claude Opus 4.8?
max_tokens, sampling parameters, prompt length, verification instructions, subagent behavior, refusal handling, usage, and cost. Treat the migration as a workflow evaluation rather than a string replacement.

