Native Mode

Anthropic (Native Mode)

Use the Anthropic SDK with Enterprise Router

Setup

Install the Anthropic SDK:

$pip install anthropic

Configure the client:

1import anthropic
2
3client = anthropic.Anthropic(
4 api_key="sk-proxy-YOUR_KEY_HERE",
5 base_url="https://gateway.example.com/anthropic"
6)

Basic message

1message = client.messages.create(
2 model="claude-sonnet-4-6",
3 max_tokens=1024,
4 messages=[
5 {"role": "user", "content": "Explain quantum computing in one paragraph."}
6 ]
7)
8
9print(message.content[0].text)

Streaming

1with client.messages.stream(
2 model="claude-sonnet-4-6",
3 max_tokens=1024,
4 messages=[{"role": "user", "content": "Write a haiku about APIs."}]
5) as stream:
6 for text in stream.text_stream:
7 print(text, end="")

Tool use

1message = client.messages.create(
2 model="claude-sonnet-4-6",
3 max_tokens=1024,
4 tools=[
5 {
6 "name": "get_weather",
7 "description": "Get the current weather for a location",
8 "input_schema": {
9 "type": "object",
10 "properties": {
11 "location": {"type": "string", "description": "City name"}
12 },
13 "required": ["location"]
14 }
15 }
16 ],
17 messages=[{"role": "user", "content": "What's the weather in Tokyo?"}]
18)
19
20for block in message.content:
21 if block.type == "tool_use":
22 print(f"Tool: {block.name}, Input: {block.input}")

System prompts

1message = client.messages.create(
2 model="claude-sonnet-4-6",
3 max_tokens=1024,
4 system="You are a senior software engineer. Be concise and precise.",
5 messages=[{"role": "user", "content": "Review this function: def add(a, b): return a + b"}]
6)

TypeScript

1import Anthropic from "@anthropic-ai/sdk";
2
3const client = new Anthropic({
4 apiKey: "sk-proxy-YOUR_KEY_HERE",
5 baseURL: "https://gateway.example.com/anthropic",
6});
7
8const message = await client.messages.create({
9 model: "claude-sonnet-4-6",
10 max_tokens: 1024,
11 messages: [{ role: "user", content: "Hello!" }],
12});
13
14console.log(message.content[0].text);

Notes

  • anthropic-version header: The gateway automatically sets anthropic-version: 2023-06-01 if your request doesn’t include one.
  • All Anthropic features are supported: vision, tool use, extended thinking, batches — the request is proxied unmodified.

Supported models

  • claude-opus-4-6, claude-sonnet-4-6
  • claude-opus-4-5, claude-haiku-4-5

New Anthropic models work automatically.