Skip to main content
AnyAIGC

Claude Sonnet 5 API

At launch, Anthropic called it its most agentic Sonnet yet, with performance close to Opus 4.8 at a lower price. A practical pick for everyday agentic work. Call claude-sonnet-5 through the native Anthropic API on AnyAIGC from $0.2471 per million input tokens, 88% off Anthropic's list price.

A newer version is available: Anthropic lists Claude Sonnet 5 as a legacy model (Active · Legacy) and commits to retiring it no earlier than June 30, 2027. It still works normally today. For new projects, consider Claude Sonnet 5.5.

  • Model ID claude-sonnet-5
  • Endpoint /v1/messages
  • Price 88% off list
  • Concurrency Unlimited
  • Tools Works with Claude Code
  • Business Self-service invoices

What is Claude Sonnet 5

  • RELEASE

    A Sonnet that closes in on Opus 4.8

    Anthropic released Claude Sonnet 5 on June 30, 2026. Anthropic says it can make plans, use tools like browsers and terminals, and run autonomously at a level that recently required larger, more expensive models. Its performance is close to Opus 4.8 at lower prices, and at higher effort it can match Opus 4.8 on some tasks. On August 10, 2026, Anthropic made the $2 / $10 introductory pricing permanent.

    View benchmarks
  • On AnyAIGC

    Native API, one key for everything

    AnyAIGC exposes a /v1/messages endpoint that speaks the Anthropic Messages format. To switch an existing project, change the base URL to https://anyaigc.ai and set model to claude-sonnet-5. The same key also works with 300+ other models on the platform.

    Get started in three steps

Claude Sonnet 5 API pricing

Pay per token at fixed rates, with no subscription or monthly fee. Every line item is about 12.4% of Anthropic's list price.

  • Pay per tokenInput, output, and cache priced separately
  • 88% offCompared with Anthropic's list price
  • Unlimited concurrencyIncluded on every account
  • USDOne balance for 300+ models
claude-sonnet-5 price per million tokens (USD), AnyAIGC vs. Anthropic list price
ItemAnyAIGCAnthropic listYou save
Inputper 1M tokens$0.2471$2.0088%
Outputper 1M tokens$1.2350$10.0088%
5-minute cache writeper 1M tokens$0.3088$2.5088%
1-hour cache writeper 1M tokens$0.4941$4.0088%
Cache hitper 1M tokens$0.0247$0.2088%

Model name claude-sonnet-5. Prices are in USD and billed on actual tokens used. List prices are from Anthropic's website; see the AnyAIGC Model Catalog for live pricing.

Cost examples

Estimates for common workloads. Strikethrough shows the same usage at Anthropic's list price.

  • One code review

    50K input + 5K output tokens

    $0.019

    List $0.15

  • A cached agent session

    200K tokens written to a 5-minute cache, then 20 turns that each hit the cache and add 5K input and 2K output

    $0.23

    List $1.90

  • 1M input + 1M output

    1M input + 1M output tokens

    $1.48

    List $12.00

What Claude Sonnet 5 is good at

Everyday coding and bug fixing

Build features, fix bugs, write tests, and review pull requests. The per-token price sits well below Opus-class models, which makes it a good fit for high-volume daily dev work. Add prompt caching and repeated project context is billed at the cache-hit rate.

Agents and tool use

Anthropic says Sonnet 5 can plan on its own, use tools like browsers and terminals, and keep going without hand-holding. Run multi-step tasks in Claude Code or your own agent framework, and with unlimited concurrency you can run many agents side by side.

Computer use and browser automation

It scores 81.2% on OSWorld-Verified in Anthropic's results, so it can handle form filling, web navigation, and cross-app workflows that need it to read the screen and click through.

Documents and knowledge work

Work through reports, contracts, spreadsheets, and research to produce summaries, comparisons, and structured analysis. Use tools or JSON Schema to shape the output for your existing systems.

Benchmarks

Coding, computer use, and knowledge work results published by Anthropic, with Opus 4.8 shown for reference.

Claude Sonnet 5 benchmarks compared with Sonnet 4.6 and Opus 4.8 (published by Anthropic)
BenchmarkSonnet 5Sonnet 4.6Opus 4.8
Software engineeringSWE-bench Pro63.2%58.1%69.2%
Agentic codingTerminal-Bench 2.180.4%67.0%82.7%
Computer useOSWorld-Verified81.2%78.5%83.4%
Knowledge workGDPval-AA v2161813951615

Source: Anthropic's launch announcement. GDPval-AA is an Elo-style score; the other rows are pass rates.

Call the Claude Sonnet 5 API in three steps

  1. Sign up and add credit: create an account at anyaigc.ai. Your balance works across every model on the platform.
  2. Create an API key: create a token in the console and copy the key that starts with sk-.
  3. Send a request: POST an Anthropic Messages request to https://anyaigc.ai/v1/messages, authenticating with Authorization: Bearer.
cURL
curl https://anyaigc.ai/v1/messages \
  -H "Authorization: Bearer $ANYAIGC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 2048,
    "system": "You are a senior engineer. Point out the bug first, then give the full fixed code.",
    "messages": [
      {"role": "user", "content": "This pagination function drops the last page. Fix it and add unit tests."}
    ]
  }'
Python · requests
import os, requests

resp = requests.post(
    "https://anyaigc.ai/v1/messages",
    headers={"Authorization": f"Bearer {os.environ['ANYAIGC_API_KEY']}"},
    json={
        "model": "claude-sonnet-5",
        "max_tokens": 2048,
        "messages": [
            {"role": "user", "content": "Turn these meeting notes into action items sorted by owner:\n..."},
        ],
    },
    timeout=300,
)
resp.raise_for_status()
for block in resp.json()["content"]:
    if block["type"] == "text":
        print(block["text"])
Prompt caching · cache_control
# Put long context (codebase, docs) in system and mark it for caching; later cache hits cost only $0.0247/1M
curl https://anyaigc.ai/v1/messages \
  -H "Authorization: Bearer $ANYAIGC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "system": [
      {"type": "text", "text": "You are the code assistant for this project."},
      {"type": "text", "text": "<your whole codebase or long document here>",
       "cache_control": {"type": "ephemeral"}}
    ],
    "messages": [{"role": "user", "content": "List every endpoint that is missing error handling"}]
  }'

# Cache lasts 5 minutes by default; for 1 hour use {"type": "ephemeral", "ttl": "1h"}

Per Anthropic's docs, Sonnet 5 uses adaptive thinking by default, and setting temperature, top_p, or top_k returns a 400 error. For more parameters (tools, thinking, streaming, PDF and image input, and more), see the AnyAIGC Messages API docs. Fields behave the same as in Anthropic's official docs.

Use Sonnet 5 in Claude Code

Install with one command that writes your AnyAIGC config automatically, or edit settings.json by hand.

One-line install (macOS / Linux)
curl -fsSL https://www.anyaigc.ai/install.sh | bash -s claude
# Windows PowerShell: irm https://www.anyaigc.ai/install.ps1 | iex
~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://anyaigc.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-api-key",
    "ANTHROPIC_MODEL": "claude-sonnet-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5",
    "API_TIMEOUT_MS": "300000"
  }
}

For full setup steps and common errors, see the Claude Code setup guide.

Claude Sonnet 5 API for teams and enterprises

Top up, issue invoices yourself, and work with a dedicated support and technical contact.

  • Invoices

    Issue them yourself

    Issue an invoice in the console for the amount you actually topped up, whenever you need one.

  • Dedicated support

    Account and technical contacts

    Work with a dedicated support contact and technical engineer for onboarding, migration and troubleshooting.

Payment methods
  • WeChat Pay
  • Alipay
  • USDT
  • Credit card

Why teams trust AnyAIGC

Trial credit, top-ups, refunds, data handling and billing, spelled out up front.

  • 5M free tokens to start

    New accounts get trial credit, so you can test before you top up.

  • Top up from $1, refundable

    Top up from $1. Unused balance can be refunded with no fee.

  • Official channels, real models

    Requests go to official model channels, never cheaper or reverse-engineered substitutes.

  • No retention, no training

    Unless the law requires it, your prompts and outputs are not persistently stored or used for training. See the privacy policy.

  • Transparent billing, spend caps

    See tokens and cost for every request in the console, and set a quota on each API key.

  • 24/7 support

    Contact support any time about integration, billing or incidents.

Why use AnyAIGC

  • 88% off

    12.4% of list price

    Sonnet already costs less than Opus. At 12.4% of list on top of that, you can scale everyday agent workloads without watching the meter.

  • Unlimited concurrency

    Included on every account

    Run batch jobs and parallel agents without queuing or requesting a quota increase.

  • Native API

    Works with the Anthropic SDK

    Keep the Messages format and cache_control. Change the base URL to migrate, and moving to Sonnet 5.5 later is a one-field change.

  • 300+ models

    One key for all of them

    Claude, GPT, Gemini, and more share one API key and one balance.

Specs and how to choose it

Claude Sonnet 5 was released on June 30, 2026.

It has a 1M-token context window and up to 128K output tokens.

It supports adaptive thinking with a default effort of high.

Its reliable knowledge cutoff is January 2026.

This page lists Input at $0.2471, Output at $1.2350, 5-minute cache write at $0.3088, 1-hour cache write at $0.4941, matching the pricing table above.

Compared with claude-sonnet-5-5: Compared with Claude Sonnet 5.5, context, max output and default effort are the same, but Sonnet 5.5 has a later knowledge cutoff (June 2026).

Specs come from the vendor's official documentation (platform.claude.com). The table on this page is the price, and the model catalog is authoritative for live rates.

Claude Sonnet 5 API FAQ

How much does the Claude Sonnet 5 API cost?

On AnyAIGC, claude-sonnet-5 is billed per token: $0.2471 per million input tokens, $1.235 per million output tokens, $0.3088 for 5-minute cache writes, $0.4941 for 1-hour cache writes, and $0.0247 for cache hits. Anthropic's list price is $2 input and $10 output, so AnyAIGC comes in at about 12.4% of list price.

What is the Claude Sonnet 5 model ID, and is the API Anthropic-compatible?

The model ID is claude-sonnet-5. Put it in the model field of your request body. The API is Anthropic-compatible: the endpoint is https://anyaigc.ai/v1/messages and the request body follows the Anthropic Messages format (model, max_tokens, system, messages, tools, cache_control, and so on). Authenticate with Authorization: Bearer followed by your API key. With the official SDK, just set the base URL to https://anyaigc.ai.

Can I use Claude Sonnet 5 in Claude Code?

Yes. In the env block of ~/.claude/settings.json, set ANTHROPIC_BASE_URL to https://anyaigc.ai, ANTHROPIC_AUTH_TOKEN to your API key, and both ANTHROPIC_MODEL and ANTHROPIC_DEFAULT_SONNET_MODEL to claude-sonnet-5, then run claude. You can also install and configure everything with one command: curl -fsSL https://www.anyaigc.ai/install.sh | bash.

How is prompt caching billed?

Add cache_control to a content block to enable caching. The first write is billed at the cache write rate ($0.3088 for 5 minutes or $0.4941 for 1 hour, per million tokens). After that, cached tokens cost only $0.0247 per million, about 10% of the regular input price. Caching works best for long system prompts, codebase context, and multi-turn agent tasks.

Are there concurrency or rate limits?

AnyAIGC sets no concurrency limit on claude-sonnet-5. Every account gets this by default, so it works well for batch jobs and running multiple agents in parallel.

What is Claude Sonnet 5 good at?

Anthropic says Sonnet 5 can make plans, use tools like browsers and terminals, and run autonomously, with performance close to Opus 4.8 at lower prices. It fits everyday coding and bug fixing, agentic tool use, computer use, and document-heavy knowledge work. In Anthropic's published results it scores 63.2% on SWE-bench Pro and 80.4% on Terminal-Bench 2.1.

Is Claude Sonnet 5 deprecated? How long can I keep using it?

It is not deprecated. Anthropic lists Claude Sonnet 5 as a legacy model (Active · Legacy) and commits to retiring it no earlier than June 30, 2027. You can still call claude-sonnet-5 on AnyAIGC today. For new projects, Anthropic's newer Claude Sonnet 5.5 (claude-sonnet-5-5) is the recommended choice.

How do I get a Claude Sonnet 5 API key?

Sign up at anyaigc.ai, add credit, and create a token in the console. The same key works for Claude Sonnet 5 and 300+ other models on the platform.

Can I get an invoice from AnyAIGC?

Yes. You can issue invoices yourself in the console, for the amount you actually topped up.

Which payment methods are supported?

You can top up with WeChat Pay, Alipay, USDT or a credit card. Your balance is in USD and works across every model on the platform. Invoices can be issued in the console for the amount you topped up.

Is there free trial credit for new users?

Yes. New accounts get 5 million tokens of trial credit, so you can test before deciding to top up. Top-ups start at $1.

Can I get a refund on my balance?

Yes. Unused balance can be refunded with no fee. Contact support to start a refund.

Are these the real models? Is my data safe?

Requests go to official model channels, never cheaper or reverse-engineered substitutes. Unless the law requires it, we do not persistently store your prompts or outputs or use them for training, and the console shows tokens and cost for every request.

Is my data used for training?

Requests are encrypted in transit over HTTPS. See the AnyAIGC Privacy Policy for data handling details. The model's own data policy is governed by Anthropic's official terms.

Run Sonnet 5 at 88% off list price

Sign up, create an API key, and you can be calling claude-sonnet-5 from your code or Claude Code in minutes.