All insights

Model APIs

Claude Sonnet 4 API: Retirement Status and First Call

Check Claude Sonnet 4’s status on Anthropic and Google Cloud, see why their API routes differ, and make a first call with a currently documented Anthropic model.

Illustration for Claude 4 sonnet api

Short answer: The original Claude Sonnet 4 is retired on Anthropic’s direct API. Anthropic lists its retirement date as June 15, 2026; requests to retired models fail. Google Cloud is a separate case: its current model card still labels Sonnet 4 generally available and lists the model ID claude-sonnet-4, but Google’s current request guide does not include that model in its supported request-name list. So the Google model card alone does not establish a verified current first-call path. (Anthropic model deprecations, Anthropic release notes, Google Cloud Sonnet 4 model card, Google Cloud request guide)

Provider documentation checked November 12, 2026. Anthropic-operated and Google-managed Claude have separate lifecycle schedules and API requirements.

Is Claude Sonnet 4 still available through an API?

  • Anthropic direct API: No. Anthropic’s lifecycle documentation says the original model, claude-sonnet-4-20250514, retired on June 15, 2026. Anthropic states that requests to retired models fail. Do not use this model ID for a new direct API integration. (Anthropic model deprecations, Anthropic release notes)
  • Google-managed Claude on Google Cloud: Google’s model card still lists claude-sonnet-4 as generally available, gives a retirement date of “not sooner than May 14, 2026,” and identifies us-east5, europe-west1, and a global endpoint. However, Google’s current request guide lists several Claude model names but omits Sonnet 4. The available documentation therefore does not establish a verified current Sonnet 4 request path for a new integration. Confirm availability for your project in Google Cloud before building around it; do not apply Anthropic’s retirement date to Google-managed Claude. (Google Cloud Sonnet 4 model card, Google Cloud request guide, Anthropic model deprecations)

If you must use the original Sonnet 4 model, the Google project-level availability question remains to be confirmed. For a documented direct Anthropic API first call, use a currently listed model instead. The example below uses Claude Sonnet 5.5; it is not a claim that Sonnet 5.5 will behave identically to Sonnet 4.

Make a first call with a currently listed Anthropic model

This example uses Claude Sonnet 5.5 on Anthropic’s direct API, not Sonnet 4. Anthropic’s current model reference lists the API ID claude-sonnet-5-5. (Claude Sonnet 5.5 model reference)

Prerequisites: Python 3.10 or later, the Anthropic Python SDK, an Anthropic API key, and API billing set up for your account. Anthropic documents that a billing or payment issue can return a 402 billing error. (Python SDK documentation, API errors)

python -m pip install anthropic
export ANTHROPIC_API_KEY="YOUR_API_KEY"

Save as first_call.py, then run python first_call.py:

import os
from anthropic import Anthropic

client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])

message = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=128,
    messages=[{"role": "user", "content": "Reply with: API connection works."}],
)

for block in message.content:
    if block.type == "text":
        print(block.text)

A successful call returns an assistant message with content; the loop prints any text blocks in that response. Keep the API key outside source control. The SDK documentation shows the client initialization, messages.create fields, and text-block handling used here. (Python SDK documentation, Messages API guide)

Google Cloud limits and access notes

Google’s Sonnet 4 model card lists a 200,000-token maximum input for general availability (1 million is marked preview) and a 64,000-token maximum output. It also lists the us-east5 and europe-west1 regions and a global endpoint. These are model-card details, not confirmation that the current request guide supports a new Sonnet 4 call. Google’s pricing page is the place to check Google-managed model pricing; do not use Anthropic’s direct-API prices for Google Cloud billing. (Google Cloud Sonnet 4 model card, Google Cloud pricing)

Pricing and production checks for the direct API example

For Claude Sonnet 5.5 on Anthropic’s direct API, Anthropic lists base prices of USD $2 per million input tokens and USD $10 per million output tokens. Its model reference lists a 1-million-token context window and a 128,000-token maximum output. Check the live model and pricing pages before budgeting. (Anthropic Sonnet 5.5 information, Claude Sonnet 5.5 model reference)

For the direct API example:

  • Check errors before retrying. A 401 indicates an API-key authentication issue; 403 indicates a permissions issue; 402 indicates a billing or payment issue. Fix those conditions rather than repeatedly resending the same request. (Anthropic API errors)
  • Distinguish rate limits from spend caps. A 429 can mean either. Anthropic says a tier spend-cap 429 has no Retry-After header and continues until access resumes, so blindly retrying will not help. Check your organization’s current tier and limits in the Claude Console. (Anthropic API errors, Anthropic rate limits)
  • Handle server errors selectively. For a 500, Anthropic advises exponential backoff and contacting support with the request ID if the error persists. A 504 is a processing timeout; set an application-appropriate timeout and handle that failure in your client. (Anthropic API errors)
  • Protect credentials. Keep API keys server-side and out of source control. (Python SDK documentation)

Bottom line: The original Sonnet 4 model is retired on Anthropic’s direct API as of June 15, 2026. Google’s current model card still lists Sonnet 4 as generally available, but its request guide omits the model, so a current Google first-call path is not established by the documentation reviewed here. For a documented direct Anthropic API example, use a currently listed model such as Sonnet 5.5 and test it against your own application before migrating.

Sources

Model deprecations — Claude Platform Docs

Claude Platform release notes — Claude Platform Docs

Claude Sonnet 4 on Google Cloud

Request predictions with Claude models — Google Cloud

Claude Sonnet 5.5 — Claude Platform Docs

Python SDK — Claude Platform Docs

Using the Messages API — Claude Platform Docs

Claude API errors — Claude Platform Docs

Rate limits — Claude Platform Docs

Claude Sonnet — Anthropic

Vertex AI Model Garden pricing — Google Cloud

Contact us