Claude Opus 4.8 API
anthropic/claude-opus-4.8Claude Opus 4.8 turns text and image context into code, analysis, and detailed answers for complex agent work, with a 1M-token context window and 128K-token maximum output. Give it the relevant files, constraints, and evidence so it can trace decisions across a long task and return reviewable results.
Claude Opus 4.8
Anthropic · messages
Quick start
Send a POST request to /v1/messages with anthropic/claude-opus-4.8. Choose JSON or SSE with stream, and receive generated content and usage.
- Endpoint
- POST /v1/messages
- Model ID
- anthropic/claude-opus-4.8
- Protocol
- Claude Messages
Request fields
| Field | Requirement | Description |
|---|---|---|
| model | Required | anthropic/claude-opus-4.8 |
| messages | Required | A non-empty ordered conversation array; each message has role and content. |
| max_tokens | Required | A positive integer setting the maximum output tokens for this response. |
| system | Optional | System instructions as a string or text blocks. |
| temperature | Optional | Sampling temperature; the playground allows 0–2. |
| top_p | Optional | Nucleus sampling probability; the playground allows 0–1 and defaults to 1. |
| cache_control | Optional | Places a prompt-cache marker on cacheable content. |
| stream | Optional | Returns an SSE event stream when true. |
Response and usage
Successful responses include generated content and usage. Billing settles from actual input, output, and cache tokens.
Streaming
Set stream: true to read SSE. Finalize usage accounting from the terminal usage event.
curl --request POST \
--url https://api.vidgo.ai/v1/messages \
--header "x-api-key: $VIDGO_API_KEY" \
--header 'anthropic-version: 2023-06-01' \
--header 'Content-Type: application/json' \
--data '{
"model": "anthropic/claude-opus-4.8",
"messages": [
{
"role": "user",
"content": "Explain why deterministic retries matter in distributed systems."
}
],
"max_tokens": 1024,
"temperature": 1,
"top_p": 1,
"stream": false
}'Keep API keys on the server. Never expose them in browser code or public repositories.
Continue with
Related Models
Claude Opus 4.8 API frequently asked questions
What is the Claude Opus 4.8 API?
Claude Opus 4.8 is an Anthropic model for complex coding, long-context analysis, and agent workflows. It turns conversation text and image context into code, explanations, and structured findings. Its 1M-token context window helps carry relevant files and evidence across connected steps, while instructions and tools guide the work. You can call it programmatically or try it from the playground above.
How can Claude Opus 4.8 handle long-running coding tasks?
Give Claude Opus 4.8 the target behavior, relevant source files, constraints, and test results. It can use that context to connect implementation steps and review its output against the stated criteria.
How much context can Claude Opus 4.8 analyze?
Claude Opus 4.8 has a 1,000,000-token context window. Include the files, reports, and conversation turns needed to compare related evidence across the task.
How do I use images with Claude Opus 4.8 Messages?
Place supported image blocks alongside text in messages.content, then ask a focused question about the chart, diagram, or scene. Claude Opus 4.8 can use that visual evidence in its text response.
How do tools help Claude Opus 4.8 agent workflows?
Define available tools in the API request and state when their results should be checked. The model can return tool calls for your application to execute and continue the conversation with the results.
What output limit applies to Claude Opus 4.8?
The model supports up to 128,000 output tokens through the API. For Claude Messages, set max_tokens to a positive integer; the on-page Playground offers a separate 256–8,192-token control for interactive trials.
What does Claude Opus 4.8 cost on Vidgo AI?
Vidgo AI charges 800 credits ($4.00) per 1M input tokens and 4000 credits ($20.00) per 1M output tokens for Claude Opus 4.8. Review the token usage in the API response and the rates in this page's Pricing section.