All insights

Model APIs

Claude Opus 4.6 API: Direct Anthropic Setup, Example Request, and Pricing

Call Claude Opus 4.6 through Anthropic’s Messages API using a Console API key, the model ID, and a curl example. Check current token pricing, model lifecycle, and the difference between Anthropic’s API and third-party routes.

Illustration for Claude opus 4.6 api

Claude Opus 4.6 is available through Anthropic’s native API. This guide uses Anthropic’s Messages API at https://api.anthropic.com, with the model ID claude-opus-4-6. You need a Claude Console account and an API key. These are Anthropic-direct instructions, not a TokenForge Cloud integration. TokenForge Cloud’s public product description names Qwen, DeepSeek, GLM, and Seedance; the available information does not establish that it offers Claude Opus 4.6. (Anthropic API overview, TokenForge Cloud)

Lifecycle note: Anthropic labels Opus 4.6 a legacy model and identifies Opus 5.5 as the current Opus model. Anthropic’s model reference lists Opus 4.6 as active, with retirement no sooner than February 5, 2027. If you specifically need 4.6 for compatibility or evaluation, the instructions below are for that model; for a new production integration, assess the current model and migration implications first. (Claude Opus 4.6 model reference)

Make your first Anthropic API request

Prerequisites

  1. Create or sign in to a Claude Console account and create an API key.
  2. Set the key as an environment variable in your shell. Avoid hard-coding it in source code or exposing it in client-side code.
  3. Install curl and jq if they are not already available.

Anthropic documents POST /v1/messages as the Messages endpoint. Its API overview lists a Claude Console account and API key as prerequisites for direct API use. The current Messages API reference identifies version 2026-10-21; the request below includes that version header. (API overview, Messages API reference)

export ANTHROPIC_API_KEY="your-console-api-key"

curl https://api.anthropic.com/v1/messages \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2026-10-21" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-6",
    "max_tokens": 128,
    "messages": [
      {"role": "user", "content": "Reply with a short greeting."}
    ]
  }' | jq -r '.content[] | select(.type == "text") | .text'

Anthropic’s API overview documents Authorization: Bearer <token> for an API key, unless the x-api-key header is set. The official Messages guide shows a non-streaming response with a content array containing a block whose type is text and whose reply is in text. That is the response structure the jq filter above reads; no request has been run for this article. (API overview, Using the Messages API)

If the request fails, check that the environment variable is set in the same shell and contains a valid Anthropic Console API key. Also verify the model ID and request body against Anthropic’s current documentation. This command is for Anthropic’s endpoint; don’t substitute a Heroku, Vertex AI, or aggregator key or URL, since those belong to separate provider routes. The cited API overview lists the account and key prerequisites; it does not specify an additional billing-activation step in the retrieved prerequisite passage.

Anthropic direct API vs. TokenForge Cloud

The example calls Anthropic directly. It does not use TokenForge Cloud credentials or an endpoint. TokenForge Cloud’s public product description does not confirm Opus 4.6 availability or provide a Claude-specific endpoint, model identifier, or setup flow. If you need to use TokenForge Cloud, confirm those details in its current documentation rather than assuming the Anthropic request will work there. (TokenForge Cloud)

Other services, including Vertex AI and Heroku, document separate access routes. Their credentials, endpoints, model identifiers, limits, and billing are provider-specific and should not be mixed with the Anthropic-native example. (Google Cloud Vertex AI announcement, Heroku model documentation)

Claude Opus 4.6 API pricing

As of November 8, 2026, Anthropic’s pricing documentation lists direct API rates of $5 per million input tokens and $25 per million output tokens for Opus 4.6. The page says prices are in USD. Prompt-cache charges vary by cache operation and write duration, so check Anthropic’s current pricing page for the applicable cache-write duration and cache-read rates before budgeting. Anthropic’s model-specific Opus 4.6 documentation says Batch API requests are 50% off; check the current Batch API documentation for applicable request and processing conditions. These are Anthropic API terms, not prices for a cloud or third-party provider. (Anthropic pricing, Claude Opus 4.6 model reference)

For a simple estimate without caching or batch pricing, 10,000 input tokens and 1,000 output tokens would cost about $0.075: $0.05 for input plus $0.025 for output. Estimate with your application’s expected token counts; request count alone does not determine token charges. Recheck Anthropic’s pricing page before deployment for current rates and details.

Production notes

  • Model lifecycle: Opus 4.6 is listed as a legacy model, though active; Anthropic says retirement will be no sooner than February 5, 2027. Plan how you would test a migration if you are starting a new production project. (Model reference)
  • Context and output: Anthropic’s model reference lists a 1-million-token context window and up to 128,000 output tokens. The example’s max_tokens: 128 is only a small cap for a short test reply, not the model’s maximum. (Model reference)
  • API version: The example sets anthropic-version: 2026-10-21, the version shown by the current Messages API reference. Anthropic says its client SDKs handle the authentication, version, and content-type headers automatically; use an SDK if you prefer not to construct raw HTTP requests. (Messages API reference, API versioning)
  • Provider-specific limits: Confirm limits, regional availability, and feature support for the exact route you deploy. Anthropic’s rates and model specifications should not be assumed to apply unchanged on another platform.

For an Anthropic-native Claude Opus 4.6 request, the essential values are the Anthropic Messages endpoint, a Console API key, model claude-opus-4-6, and a Messages-format JSON body. TokenForge Cloud availability and integration details are not established by the public product information cited here.

Sources

API overview — Claude Platform Docs

Messages — Claude API Reference

Using the Messages API — Claude Platform Docs

Pricing — Claude Platform Docs

Claude Opus 4.6 — Claude Platform Docs

Claude Opus 4.6 model reference

Versions — Claude Platform Docs

Token Forge Cloud

Announcing Claude Opus 4.6 and Claude Sonnet 4.6 on Vertex AI

Managed Inference and Agents API with Claude Opus 4.6

Contact us