# One API. Every language. — Hanzo AI

> 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.

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+ modelsplus every Hanzo product SDK.

[Full API reference](https://docs.hanzo.ai/docs/sdks)[Get an API key](https://hanzo.ai/pricing)

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.

```
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.

```
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

### Hanzo Python SDK

PyPI

pip install hanzoai

[hanzoai](https://pypi.org/project/hanzoai/)[Docs](https://docs.hanzo.ai/docs/sdks/python)

### Hanzo Go SDK

Go Modules

go get github.com/hanzoai/go-sdk

[github.com/hanzoai/go-sdk](https://pkg.go.dev/github.com/hanzoai/go-sdk)[Docs](https://docs.hanzo.ai/docs/sdks/go)

### Hanzo TypeScript SDK

npm

npm install @hanzo/sdk

[@hanzo/sdk](https://www.npmjs.com/package/@hanzo/sdk)[Docs](https://docs.hanzo.ai/docs/sdks/typescript)

### Hanzo Rust SDK

crates.io

cargo add hanzo

[hanzo](https://github.com/hanzo-rs/sdk)[Docs](https://docs.hanzo.ai/docs/sdks/rust)

### Hanzo Swift SDK

SwiftPM

.package(url: "https://github.com/hanzo-swift/sdk")

[hanzo-swift/sdk](https://github.com/hanzo-swift)[Docs](https://docs.hanzo.ai/docs/sdks/swift)

### Hanzo Kotlin SDK

JitPack

implementation("com.github.hanzo-kt:sdk:v8.0.0")

[hanzo-kt/sdk](https://github.com/hanzo-kt/sdk)[Docs](https://docs.hanzo.ai/docs/sdks/kotlin)

Per-product SDKs & APIs

## Every product has its own SDK

The unified AI API is one surface. Each Hanzo product also ships a dedicated SDK — identity, secrets, storage, agents, tasks, memory, tools, and UI — so you compose exactly what you need.

[### MCP 260+ Model Context Protocol tools for agents & editors.npm@hanzo/mcppiphanzo-mcp](https://github.com/hanzoai/mcp)[### IAM OIDC / SSO — sign in with Hanzo ID (PKCE, server + browser).npm@hanzo/iampiphanzo-iam](https://github.com/hanzoai/iam)[### KMS Secrets & key management — read, seal, and sync org secrets.piphanzo-kms](https://github.com/hanzoai/kms)[### S3 S3-compatible object storage — buckets, objects, presigned URLs.piphanzo-s3](https://github.com/hanzoai/s3)[### Agents Multi-agent SDK — build, orchestrate, and hand off between agents.piphanzo-agent](https://github.com/hanzoai)[### Tasks Durable workflows & scheduling — retries, timers, signals.piphanzo-tasks](https://github.com/hanzoai/tasks)[### Memory Long-term memory — store, recall, and summarize across sessions.piphanzo-memory](https://github.com/hanzoai)[### UI Headless React components — the @hanzo/ui design system.npm@hanzo/ui](https://github.com/hanzoai/ui)

[Explore SDKs for every language](https://hanzo.ai/sdks)[hanzoai/sdk — every service, every language](https://github.com/hanzoai/sdk)[SDK documentation](https://docs.hanzo.ai/docs/sdks)
