SDKs & frameworks
There is no gateway SDK to install. We speak Anthropic's protocol, so the official clients work as they are.
One line changes
Point the client's base URL at us and use a gateway key instead of an Anthropic key. Everything else — streaming, tool use, retries, typed responses — behaves exactly as it did.
By language
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["GATEWAY_API_KEY"],
base_url="{BASE_URL_ROOT}", # the only line that changes
)
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)
Environment variables
The Anthropic SDKs read ANTHROPIC_BASE_URL, so in many projects you can
switch over without touching code at all.
GATEWAY_API_KEY=dj_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ANTHROPIC_BASE_URL={BASE_URL_ROOT}
Timeouts
A long completion can take a couple of minutes. Set a client timeout of at least 180 seconds, and prefer streaming for anything user-facing — you get the first token in under a second rather than waiting for the whole response.
What is not proxied
We expose the Messages API, token counting, models and usage. Anthropic features that depend on their own infrastructure are not available through any Bedrock-backed gateway, ours included:
- Files API and URL-based image or document sources
- Server-side tools — web search, web fetch, code execution
- Agent Skills and the MCP connector
- Message Batches
If you need one of these, that part of your workload has to talk to Anthropic directly — and it will be processed in the US. Keep it separate from the traffic you are routing through here for residency reasons.