Claude 4.7 Opus

This documentation is valid for the following list of our models:

  • anthropic/claude-opus-4-7

  • claude-opus-4-7

Model Overview

As of mid-April 2026, the most capable generally available model, optimized for autonomous long-horizon agentic workflows, knowledge-intensive tasks, vision, and memory, with strong overall performance across domains. It supports up to a 1M-token context window, 128k output tokens, adaptive reasoning, and full compatibility with the Claude Opus 4.6 toolset and platform features.

How to make the first API call

1️⃣ Required setup (don’t skip this)Create an account: Sign up on the AI/ML API website (if you don’t have one yet). ▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.

2️ Copy the code example At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.

3️ Update the snippet for your use caseInsert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key. ▪ Select a model: set the model field to the model you want to call. ▪ Provide input: fill in the request input field(s) shown in the example (for example, messages for chat/LLM models, or other inputs for image/video/audio models).

4️ (Optional) Tune the request Depending on the model type, you can add optional parameters to control the output (e.g., generation settings, quality, length, etc.). See the API schema below for the full list.

5️ Run your code Run the updated code in your development environment. Response time depends on the model and request size, but simple requests typically return quickly.

API Schema

post
Body
modelstring · enumRequiredPossible values:
stop_sequencesstring[]Optional

Custom text sequences that will cause the model to stop generating.

streambooleanOptional

If set to True, the model response data will be streamed to the client as it is generated using server-sent events.

Default: false
systemstringOptional

A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role.

max_tokensnumberOptional

The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.

Default: 32000
Responses
200Success
idstringRequired

A unique identifier for the chat completion.

Example: chatcmpl-CQ9FPg3osank0dx0k46Z53LTqtXMl
objectstring · enumRequired

The object type.

Example: chat.completionPossible values:
creatednumberRequired

The Unix timestamp (in seconds) of when the chat completion was created.

Example: 1762343744
modelstringRequired

The model used for the chat completion.

Example: anthropic/claude-opus-4-7
post
/v1/chat/completions
200Success

Code Example

Response

Last updated

Was this helpful?