Skip to content

Migrating from Anthropic

If you’re already using the Anthropic API (the Claude API), switching to Gonka Broker takes two changes: the base URL and the API key. Gonka Broker serves the Anthropic Messages API natively, so your existing SDK code keeps working; only the models change.

from anthropic import Anthropic
client = Anthropic(
api_key="gnk-prx-your-api-key", # ← your Gonka key
base_url="https://proxy.gonkabroker.com", # ← Gonka endpoint, no /v1
)
# Everything else stays exactly the same
response = client.messages.create(
model="MiniMaxAI/MiniMax-M2.7",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: "gnk-prx-your-api-key", // ← your Gonka key
baseURL: "https://proxy.gonkabroker.com", // ← Gonka endpoint, no /v1
});
// Everything else stays exactly the same
const response = await client.messages.create({
model: "MiniMaxAI/MiniMax-M2.7",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello!" }],
});

Note the base URL is the bare host, without a /v1 suffix; Anthropic clients append the API paths themselves.

The official Anthropic SDKs read both values from the environment, so you can migrate without touching code:

.env
ANTHROPIC_API_KEY=gnk-prx-your-api-key
ANTHROPIC_BASE_URL=https://proxy.gonkabroker.com

Replace the Claude model name with a Gonka-supported model; claude-* model ids are not aliased, so this change is required. See Supported Models for the full list.

Common mappings:

Instead ofTry
claude-sonnet-*MiniMaxAI/MiniMax-M2.7
claude-opus-*moonshotai/Kimi-K2.6 (bigger context window)

Streaming with the standard Anthropic SSE events, tool use with full round-trips, system prompts, stop_sequences, and token counting all work. Models with extended reasoning return their reasoning as thinking content blocks, just like Anthropic clients expect — and the standard thinking parameter controls it: {"type": "disabled"} turns thinking off on models with a thinking switch. Note the models think by default, so you get thinking blocks without asking. See Anthropic API Compatibility for the full parameter list and the known divergences.

The same two changes apply (base URL and key), except the OpenAI base URL includes the version prefix: https://proxy.gonkabroker.com/v1. See Migrating from OpenAI.