OneProvider
Guides

Migrate from Anthropic

Point the Anthropic SDK at OneProvider by setting one environment variable. Python and Node examples, model ID swap and a quick check that it worked.

If your code already calls api.anthropic.com today, the entire migration is one environment variable. Existing requests and responses are byte-for-byte identical.

All models, capabilities, and prices Documentation index for AI agents: https://oneprovider.dev/docs/llms.txt Before you start: a key from your cabinet Open your cabinet: the Telegram bot @oneprovider_robot (Account) or app.oneprovider.dev . Press “Issue a key”, give it a name (for example, this client) and a spend limit, and copy the key. You top up the balance in the same place. More about the cabinet and keys .

What changes (and what does not)

Nothing about the request schema, the response shape, the streaming events, or the SDK you’re already using needs to change. The only diff is where the bytes go:

Reference data
ConcernAnthropicOneProvider
Base URLhttps://api.anthropic.comhttps://api.oneprovider.dev
Auth headerx-api-keyx-api-key or Authorization: Bearer
Version headeranthropic-version: 2023-06-01anthropic-version: 2023-06-01
Request schemaAnthropic Messages APIIdentical
Response schemaAnthropic Messages APIIdentical
Streaming eventsSSE: message_start, content_block_delta...Identical, no buffering
Prompt caching (cache_control)NativeNative — pass-through
ModelsOld dated aliasesGenerated Claude allowlist — see Models
BillingCard, post-paid, monthlyCrypto top-up, pre-paid, no expiry

Environment-only migration

If your code reads credentials from env vars (it should), this is the whole change:

bash
# Before
export ANTHROPIC_API_KEY=sk-ant-...
# After
export ANTHROPIC_API_KEY=sk-... # OneProvider key
export ANTHROPIC_BASE_URL=https://api.oneprovider.dev

Both the official Anthropic Python and Node SDKs read ANTHROPIC_BASE_URL with no other code changes required.

Python — explicit form

python
# Before
from anthropic import Anthropic
client = Anthropic()
# After
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["ANTHROPIC_API_KEY"],
base_url="https://api.oneprovider.dev",
)

Node — explicit form

ts
// Before
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
// After
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: "https://api.oneprovider.dev",
});

Model id swap

The Anthropic-native surface serves the current Claude ids listed on the Models page. If your code references an older Anthropic alias (claude-3-5-sonnet, claude-3-opus-20240229, etc.) you’ll get a 400 invalid_request_error — replace it with the current canonical id:

Reference data
Old aliasUse instead
claude-3-5-sonnet*, claude-3-7-sonnet*, claude-sonnet-3-5claude-sonnet-5-5
claude-3-opus*, claude-opus-3claude-opus-5-5
claude-3-haiku*, claude-3-5-haiku*, claude-haiku-3-5claude-haiku-5-5

Verify the swap

bash
# Should print the current Claude model ids
curl -s https://api.oneprovider.dev/v1/models \
-H "x-api-key: $ANTHROPIC_API_KEY" | jq '.data[].id'
# Should return HTTP 200 and a short text message
curl -s https://api.oneprovider.dev/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-haiku-5-5","max_tokens":32,"messages":[{"role":"user","content":"hi"}]}'
Run both side-by-side first For paranoid migrations: keep your Anthropic client around for one deploy. Send 1% of traffic through OneProvider, diff the responses on identical prompts, then flip the share over a few days. The shape parity makes this trivial.

Quick answers

Which base URL do I use?

Claude Code and Anthropic SDKs use https://api.oneprovider.dev. OpenAI SDKs and OpenAI-compatible clients use https://api.oneprovider.dev/v1. One key works behind both; the model list is on the models page ; rates are on the pricing page .

How do I authenticate?

Send the raw sk-… key in x-api-key or Authorization: Bearer: one of them, never both. Keep the key in an environment variable, not in a file that gets committed. More on authentication .

Where do I get a key?

Open your cabinet in the Telegram bot @oneprovider_robot or at app.oneprovider.dev, top up the balance and press “Issue a key”. Each key can carry its own spend limit. Cabinet & API keys .

What do 401, 404 and 429 mean?

401: the key is missing, mistyped or sent in the wrong header; paste the whole key without quotes or spaces. 404: usually a wrong base URL, for example a missing or doubled /v1. 429 with “Insufficient balance”: the cabinet balance or the key’s spend limit is used up, so top up instead of retrying; any other 429 is a rate limit, so wait for Retry-After. Details: error codes and troubleshooting .

Why do streams cut off or reset?

VPN and VLESS proxies often buffer SSE or break HTTP/2 negotiation. OneProvider has no regional restrictions and does not buffer streams, so turn the proxy off and retry.

Where do I ask if this is not enough?

Message @Oneproviderhelpbot on Telegram or open “Support” in the web cabinet, with the HTTP status code and the exact error message. How support works .

Last updated: 2026-10-05 Found a bug? @Oneproviderhelpbot