TheRouter Deprecates /v1/anthropic/* Paths: Migrate to /v1/messages Before September 3, 2026

TheRouter's legacy /v1/anthropic/messages paths are deprecated and will be removed on September 3, 2026. The canonical path is /v1/messages — the same path official Anthropic SDKs use. Migration is a one-line base-URL change.

Published via TheRouter

Archive item produced with AI assistance from the cited source and published without individual review. Editor of record: Joe Werner.

Abstract editorial illustration of two API paths converging into one canonical route with a sunset timeline marker

If you call TheRouter's Anthropic-format ingress at /v1/anthropic/messages or /v1/anthropic/messages/count_tokens, you have a deadline: September 3, 2026. On that date the legacy paths are removed. The canonical paths — /v1/messages and /v1/messages/count_tokens — are already live, behave identically, and are not affected.

This is a path rename, not a behavior change. Same request format, same response format, same streaming, same billing, same API keys.

What changes, and when

DateWhat happens
NowEvery response on /v1/anthropic/* carries Deprecation: true and Sunset: Wed, 03 Sep 2026 00:00:00 GMT headers
August 19, 2026D-15 checkpoint — we contact tenants still sending successful traffic to the legacy paths
September 3, 2026Legacy paths removed; requests to /v1/anthropic/* return 404

The path mapping:

DeprecatedCanonical
POST /v1/anthropic/messagesPOST /v1/messages
POST /v1/anthropic/messages/count_tokensPOST /v1/messages/count_tokens

Why /v1/messages

/v1/messages is the official Anthropic API path — it is what every official Anthropic SDK appends to its base URL. The /v1/anthropic/ prefix was an early TheRouter convention that official SDKs do not recognize, forcing manual URL construction. Standardizing on the official path means pointing any Anthropic SDK at TheRouter is a one-line change with zero path configuration.

How to migrate

If you use an Anthropic SDK, set the base URL to the TheRouter root — no path suffix at all:

from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.therouter.ai",  # SDK appends /v1/messages itself
    api_key="sk-tr-YOUR_KEY",
)

message = client.messages.create(
    model="anthropic/claude-sonnet-4.5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)

If you make raw HTTP calls, replace the path:

- POST https://api.therouter.ai/v1/anthropic/messages
+ POST https://api.therouter.ai/v1/messages

Both Authorization: Bearer and x-api-key authentication headers work on the canonical path, exactly as before.

How to check whether you are affected

Inspect any response from your current integration. If it includes a Deprecation: true header, you are calling a legacy path. If there is no such header, you are already on the canonical path and nothing changes for you.

A quick check from the command line:

curl -si https://api.therouter.ai/v1/anthropic/messages \
  -H "x-api-key: $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-sonnet-4.5","max_tokens":1,"messages":[{"role":"user","content":"ping"}]}' \
  | grep -i -E "^(deprecation|sunset):"

What TheRouter users should do

  • Search your code and configs for /v1/anthropic. Any match — SDK base URLs, raw HTTP calls, environment variables, infrastructure-as-code — needs the one-line update before September 3.
  • Prefer the SDK base-URL form. base_url="https://api.therouter.ai" is forward-compatible; hand-built paths are where migrations rot.
  • Don't wait for the D-15 contact. August 19 is when we start reaching out to tenants still on the legacy paths — being migrated before then means one less operational interruption on your side.
Help & contact