From Anthropic
Move Claude calls onto Anthropic-via-Bedrock-EU through an OpenAI-compatible wrapper.
If you're on the Anthropic SDK directly, you can keep using Claude
through CleverRouter — but the route is AWS Bedrock in
eu-central-1 rather than Anthropic's own US endpoints, and the
wire format becomes OpenAI-compatible.
Why Bedrock instead of Anthropic direct?
Anthropic doesn't expose direct EU endpoints today. Bedrock EU hosts the same model weights under AWS's EU-DPA + SCCs, which keeps inference inside the EU and lets us tick the data-residency box.
What's different
| Topic | Anthropic SDK | CleverRouter (Bedrock EU) |
|---|---|---|
| Wire format | Anthropic Messages API | OpenAI chat-completions |
| Region | US | eu-central-1 (Frankfurt) |
| Model IDs | claude-3-5-sonnet-... | anthropic/claude-3-5-sonnet:eu |
| Streaming | Anthropic SSE shape | OpenAI SSE shape |
| Tool calls | Anthropic tools block | OpenAI tools (gateway translates) |
| Vision | Anthropic image block | OpenAI image_url (gateway translates) |
The gateway handles the format translation. You write OpenAI-shape requests; we send Anthropic-shape requests to Bedrock and translate the response back.
Minimal diff
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY!,
});
const res = await client.messages.create({
model: 'claude-3-5-sonnet-20241022',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello.' }],
});
console.log(res.content[0]);import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.CLEVERROUTER_API_KEY!,
baseURL: 'https://api.cleverouter.eu/v1',
});
const res = await client.chat.completions.create({
model: 'anthropic/claude-3-5-sonnet:eu',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello.' }],
});
console.log(res.choices[0]?.message.content);Tool calls
Anthropic's tool calls become OpenAI tool calls on the wire:
const res = await cr.chat({
model: 'anthropic/claude-3-5-sonnet:eu',
messages: [{ role: 'user', content: 'Weather in Paris?' }],
tools: [
{
type: 'function',
function: {
name: 'get_weather',
description: 'Current weather for a city.',
parameters: {
type: 'object',
properties: { city: { type: 'string' } },
required: ['city'],
},
},
},
],
});The gateway maps tools[] → Bedrock Converse toolConfig and
flattens tool_use results back to OpenAI tool_calls. Your loop
stays standard OpenAI — see Function
calling.
Reasoning (extended thinking)
Anthropic's thinking.budget_tokens parameter maps to the OpenAI
reasoning_effort knob:
| Anthropic | CleverRouter |
|---|---|
thinking.budget_tokens low | reasoning_effort: 'low' |
| medium | 'medium' |
| high | 'high' |
See Reasoning.
What you give up
Claude-3.5-Sonnet-Computer-Use— not available on Bedrock EU at time of writing.- System-prompt caching. Anthropic's prompt-caching beta is Anthropic-direct-only; Bedrock doesn't expose it the same way.
What you keep
- The same Claude weights and behaviour.
- Streaming with SSE.
- Tool use.
- Vision.
- Long context (200k tokens, model-dependent).
Related
- Function calling
- Vision
- Why EU-native — the data-residency reason this is worth doing.