---
title: Anthropic: Claude Opus 4 API | Text Generation | ModelsLab
description: Top LLM for coding & agents: 72.5% SWE-bench, 43.2% Terminal-bench, 200K context, 32K output, $15/$75 per M tokens input/output.
url: https://modelslab.com/models/anthropic/anthropic-claude-opus-4/api.md
canonical: https://modelslab.com/models/anthropic/anthropic-claude-opus-4/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-15T03:42:48.086974Z
---

Anthropic: Claude Opus 4
---

 [LLMs.txt](https://modelslab.com/models/open_router/anthropic-claude-opus-4/llms.txt) [.md](https://modelslab.com/models/anthropic/anthropic-claude-opus-4.md)

anthropic-claude-opus-4 anthropic Closed Source Model $45.000000 / call

Anthropic: Claude Opus 4
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### Anthropic: Claude Opus 4

anthropic anthropic-claude-opus-4

Copy model ID

PricingInput $15.00 / 1M tokens

Output $75.00 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[Q3](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 30B A3b

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B)

[MM](https://modelslab.com/models/open_router/minimax-minimax-m2.5-free)[Open Router](https://modelslab.com/models/open_router)

 [MiniMax: MiniMax M2.5 (free)

Closed Source Model](https://modelslab.com/models/open_router/minimax-minimax-m2.5-free)

[CV](https://modelslab.com/models/together_ai/deepcogito-cogito-v1-preview-llama-70B-Turbo)[Together AI](https://modelslab.com/models/together_ai)

 [Cogito V1 Preview Llama 70B Turbo

Closed Source Model](https://modelslab.com/models/together_ai/deepcogito-cogito-v1-preview-llama-70B-Turbo)

[Q1](https://modelslab.com/models/together_ai/Qwen-Qwen2.5-14B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen2.5 14B

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen2.5-14B)

[DD](https://modelslab.com/models/open_router/deepseek-deepseek-v3.2-speciale)[Open Router](https://modelslab.com/models/open_router)

 [DeepSeek: DeepSeek V3.2 Speciale

Closed Source Model](https://modelslab.com/models/open_router/deepseek-deepseek-v3.2-speciale)

[II](https://modelslab.com/models/open_router/inflection-inflection-3-pi)[Open Router](https://modelslab.com/models/open_router)

 [Inflection: Inflection 3 Pi

Closed Source Model](https://modelslab.com/models/open_router/inflection-inflection-3-pi)

[Q9](https://modelslab.com/models/together_ai/Qwen-Qwen3.5-9B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3.5 9B FP8

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3.5-9B)

[OO](https://modelslab.com/models/open_router/openai-o4-mini)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: o4 Mini

Closed Source Model](https://modelslab.com/models/open_router/openai-o4-mini)

[ML](https://modelslab.com/models/open_router/mistralai-mistral-large-2411)[Open Router](https://modelslab.com/models/open_router)

 [Mistral Large 2411

Closed Source Model](https://modelslab.com/models/open_router/mistralai-mistral-large-2411)

[GG](https://modelslab.com/models/open_router/google-gemini-3.1-pro-preview-customtools)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemini 3.1 Pro Preview Custom Tools

Closed Source Model](https://modelslab.com/models/open_router/google-gemini-3.1-pro-preview-customtools)

[G5](https://modelslab.com/models/together_ai/zai-org-GLM-5)[Together AI](https://modelslab.com/models/together_ai)

 [GLM 5 Fp4

Closed Source Model](https://modelslab.com/models/together_ai/zai-org-GLM-5)

[Q3](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B-Base)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 30B A3b Base

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-30B-A3B-Base)

[NA](https://modelslab.com/models/open_router/nex-agi-deepseek-v3.1-nex-n1)[Open Router](https://modelslab.com/models/open_router)

 [Nex AGI: DeepSeek V3.1 Nex N1

Closed Source Model](https://modelslab.com/models/open_router/nex-agi-deepseek-v3.1-nex-n1)

[KK](https://modelslab.com/models/open_router/kwaipilot-kat-coder-pro-v2)[Open Router](https://modelslab.com/models/open_router)

 [Kwaipilot: KAT-Coder-Pro V2

Closed Source Model](https://modelslab.com/models/open_router/kwaipilot-kat-coder-pro-v2)

[OG](https://modelslab.com/models/open_router/openai-gpt-oss-20b)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: gpt-oss-20b

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-oss-20b)

[Q8](https://modelslab.com/models/together_ai/Qwen-Qwen3-8B)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen3 8B

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen3-8B)

[GG](https://modelslab.com/models/open_router/google-gemma-3-27b-it-free)[Open Router](https://modelslab.com/models/open_router)

 [Google: Gemma 3 27B (free)

Closed Source Model](https://modelslab.com/models/open_router/google-gemma-3-27b-it-free)

[SL](https://modelslab.com/models/open_router/sao10k-l3.3-euryale-70b)[Open Router](https://modelslab.com/models/open_router)

 [Sao10K: Llama 3.3 Euryale 70B

Closed Source Model](https://modelslab.com/models/open_router/sao10k-l3.3-euryale-70b)

About Anthropic: Claude Opus 4
---

Claude Opus 4 is benchmarked as the world’s best coding model, at time of release, bringing sustained performance on complex, long-running tasks and agent workflows. It sets new benchmarks in...

### Technical Specifications

Model IDanthropic-claude-opus-4CategoryLLM ModelsTaskText GenerationPrice$45.000000 per million tokensAddedAugust 5, 2025

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate Anthropic: Claude Opus 4 into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "anthropic-claude-opus-4",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

View the [full API documentation](https://modelslab.com/models/anthropic/anthropic-claude-opus-4/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

Anthropic: Claude Opus 4 API costs $45.000000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Learn more about Anthropic: Claude Opus 4](https://modelslab.com/anthropic-claude-opus-4) [Browse LLM Models](https://modelslab.com/models?feature=llmaster) [More from Anthropic](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/pricing)

Anthropic: Claude Opus 4 FAQ
---

### What is Anthropic: Claude Opus 4?

Claude Opus 4 is benchmarked as the world’s best coding model, at time of release, bringing sustained performance on complex, long-running tasks and agent workflows. It sets new benchmarks in...

### How do I use the Anthropic: Claude Opus 4 API?

You can integrate Anthropic: Claude Opus 4 into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "anthropic-claude-opus-4" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Anthropic: Claude Opus 4 cost?

Anthropic: Claude Opus 4 costs $45.000000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the Anthropic: Claude Opus 4 model ID?

The model ID for Anthropic: Claude Opus 4 is "anthropic-claude-opus-4". Use this ID in your API requests to specify this model.

### Does Anthropic: Claude Opus 4 have a free tier?

Yes, ModelsLab offers a free tier that lets you try Anthropic: Claude Opus 4 and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-04-15*