Migrating from the Anthropic API
Move an existing Anthropic-SDK codebase over by changing two values.
Because the gateway speaks the Messages format, migration is a configuration change. Request bodies, response parsing, streaming handlers and tool definitions all stay as they are.
Python
from anthropic import Anthropic
client = Anthropic(
api_key=class="s">"sk-your-gateway-key", class=class="s">"c"># was your Anthropic key
base_url=class="s">"https://aiprimetech.io", class=class="s">"c"># new line
)
class=class="s">"c"># everything below is unchanged
TypeScript
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.CLAUDEAPIKEY,
baseURL: "https:">//aiprimetech.io",
});
Environment-only migration
export ANTHROPIC_BASE_URL="https://aiprimetech.io"
export ANTHROPIC_API_KEY="sk-your-gateway-key"
Migration checklist
- Change the base URL and the key. No
/v1suffix for Anthropic clients. - Map model ids — see Models. Ids are pinned, so
claude-3-5-sonnet-20241022style names from an older integration need updating to a current id. - Re-run your test suite. Response shapes are identical, so anything that breaks is a model-id or base-URL issue.
- Check streaming if you use it: the event shape is unchanged, but any hardcoded hostname in a proxy or allowlist needs updating.
- Move one service first and compare outputs before switching everything.
What does not carry over
- Anthropic Console features — workbench, org billing, per-workspace limits — are Anthropic products and have no equivalent here.
- Batch API and any beta feature not exposed by this gateway. Check Overview for the current endpoint list.
- Contractual terms. If you need a DPA or SLA signed by Anthropic, stay on the official API.