Skip to Content
Simpang Router

Anthropic SDK

The Anthropic SDK with Simpang as its base URL.

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://simpang.zakiego.com/api",
  apiKey: process.env.SIMPANG_API_KEY,
});

const msg = await client.messages.create({
  model: "claude-sonnet-4-5-20250929",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hi" }],
});

Python:

import anthropic

client = anthropic.Anthropic(base_url="https://simpang.zakiego.com/api", api_key="sk-sp-...")
msg = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hi"}],
)

The base URL stops at /api: the SDK adds /v1/messages.