Skip to content
Try Hanzo
Language: English (United States)

SDKs

SDKs for every language

A full Cloud SDK generated from the OpenAPI document the API itself serves, and a hand-written AI + Agents library.

Code Examples

Use the OpenAI SDKPOST /v1/chat/completions — identical request/response to OpenAI Chat Completions.
Use the Anthropic SDKPOST /v1/messages — the native Anthropic Messages API, x-api-key auth and content-block responses.
POST https://api.hanzo.ai/v1/chat/completions
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)

Point the official OpenAI SDK at the Hanzo gateway.

POST https://api.hanzo.ai/v1/chat/completions

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)

The OpenAI JS SDK — just change baseURL.

import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.hanzo.ai/v1", apiKey: "hk-...", }); const resp = await client.chat.completions.create({ model: "zen5", messages: [{ role: "user", content: "Hello!" }], }); console.log(resp.choices[0].message.content);

OpenAI-style: Authorization: Bearer.

curl https://api.hanzo.ai/v1/chat/completions \ -H "Authorization: Bearer $HANZO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "zen5", "messages": [{"role": "user", "content": "Hello!"}] }'

POST https://api.hanzo.ai/v1/messages

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)

The Anthropic JS SDK — just change baseURL.

import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: "https://api.hanzo.ai", apiKey: "hk-...", }); const msg = await client.messages.create({ model: "zen5", max_tokens: 1024, messages: [{ role: "user", content: "Hello!" }], }); console.log(msg.content[0].text);

Anthropic-style: /v1/messages, x-api-key header.

curl https://api.hanzo.ai/v1/messages \ -H "x-api-key: $HANZO_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "zen5", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello!"}] }'

OpenAPI

A full Cloud SDK generated from the OpenAPI document the API itself serves.

API reference

Full Cloud SDK

Generated from one document and never edited by hand, so every route is reachable the day it ships — models, agents, data, compute, network, security, platform and chain. Method and class names are the document's operation ids, which is what makes a client checkable against a release instead of against somebody's memory. Real code lives in hanzo-<lang>/sdk.

AI + Agents

The hand-crafted flagship: models, agents, tools, memory, and MCP. Python hanzo is the most complete; Node ships @hanzo/ai. Distinct from the generated cloud SDK — this is the "we love this language" library.

your application

Use our official SDKs to integrate Cloud into your application

pip install hanzoai

Paste and ship

Paste this into any agent. It reads the skill manifest and calls SDKs from there.

Agent promptRead https://hanzo.ai/skill.md and use Hanzo SDKs in my project.

SDKs & Libraries

Official Cloud SDKs

Use our official SDKs to integrate Cloud into your application

Hanzo Python SDK

PyPI

pip install hanzoai

Real code lives in hanzo-py/sdk; its AI + Agents library is hanzo.

Per-language orgs

A home for every ecosystem

Each language has its own org holding the generated cloud SDK, an AI + agents library and the split-out packages. Every one of them ships the same six runnable examples — prove the key works, one completion, balance and usage, a store round-trip, create and run an agent, list the tools — so knowing one language's set is enough to navigate another's.

AI + Agents SDK

The flagship AI library

Models, agents, tools, memory, and MCP — hand-crafted, not generated. Python leads; Rust and Node follow.

Python

GA

hanzoai/python-sdk

pip install hanzo

Flagship — the most complete AI + agents library.

Node

GA

hanzo-js/ai

npm install @hanzo/ai

Models, agents, tools, memory, and MCP for TypeScript.

Rust

GA

hanzo-rs/sdk

cargo add hanzo

The AI + agents crate for Rust — crypto, DID, MCP, agents, embeddings, feature-gated.