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.
Python
Section titled “Python”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 sameresponse = client.messages.create( model="MiniMaxAI/MiniMax-M2.7", max_tokens=1024, messages=[{"role": "user", "content": "Hello!"}],)JavaScript / TypeScript
Section titled “JavaScript / TypeScript”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 sameconst 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.
Environment variables
Section titled “Environment variables”The official Anthropic SDKs read both values from the environment, so you can migrate without touching code:
ANTHROPIC_API_KEY=gnk-prx-your-api-keyANTHROPIC_BASE_URL=https://proxy.gonkabroker.comChoosing a model
Section titled “Choosing a model”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 of | Try |
|---|---|
claude-sonnet-* | MiniMaxAI/MiniMax-M2.7 |
claude-opus-* | moonshotai/Kimi-K2.6 (bigger context window) |
What about streaming, tool use, etc.?
Section titled “What about streaming, tool use, etc.?”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.
Coming from the OpenAI SDK instead?
Section titled “Coming from the OpenAI SDK instead?”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.