SDKs & API
One API. Every language.
The Hanzo API is drop-in compatible with both the OpenAI SDK and the Anthropic SDK. Keep the client you already use — change one line, the base URL — and get one gateway to 500+ models plus every Hanzo product SDK.
OpenAI-compatible
- base_url
- https://api.hanzo.ai/v1
- endpoint
- /v1/chat/completions
- auth
- Authorization: Bearer hk-...
Anthropic-compatible
- base_url
- https://api.hanzo.ai
- endpoint
- /v1/messages
- auth
- x-api-key: hk-...
Code Examples
Use the OpenAI SDK
POST /v1/chat/completions — identical request/response to OpenAI Chat Completions.
🐍Python
📘TypeScript
🔗cURL
Point the official OpenAI SDK at the Hanzo gateway.
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.hanzo.ai/v1",
api_key="hk-...", # your Hanzo API key
)
resp = client.chat.completions.create(
model="zen5", # any model on the gateway
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
Code Examples
Use the Anthropic SDK
POST /v1/messages — the native Anthropic Messages API, x-api-key auth and content-block responses.
🐍Python
📘TypeScript
🔗cURL
Point the official Anthropic SDK at the Hanzo gateway.
Python
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.hanzo.ai",
api_key="hk-...", # sent as the x-api-key header
)
msg = client.messages.create(
model="zen5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
print(msg.content[0].text)
SDKs & Libraries
Official Hanzo SDKs
Use our official SDKs to integrate Hanzo into your application
Per-product SDKs & APIs
Every product has its own SDK
One AI API covers the models. Each Hanzo product also ships a dedicated SDK — identity, secrets, storage, agents, tasks, memory, tools, and UI — so you compose exactly what you need.