API Reference
Zen LM Cloud API -- OpenAI-compatible endpoints for all 14 Zen models
Zen LM Cloud API
Use all 14 Zen models via the Hanzo AI cloud API. Fully OpenAI-compatible -- works with every SDK, framework, and tool that supports the OpenAI API format.
Base URL
https://api.hanzo.ai/v1Also available at https://api.zen.hanzo.ai/v1.
Authentication
All API requests require a HANZO_API_KEY (prefix: hk-) obtained from console.hanzo.ai.
Authorization: Bearer $HANZO_API_KEYFree Credit
Every new account receives $5 free credit (expires in 30 days). A $1 minimum balance is required to use the API.
Quickstart
curl
curl https://api.hanzo.ai/v1/chat/completions \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zen4",
"messages": [{"role": "user", "content": "Hello, Zen."}]
}'Python
from hanzoai import Hanzo
client = Hanzo(api_key="hk-your-api-key")
response = client.chat.completions.create(
model="zen4",
messages=[{"role": "user", "content": "Hello, Zen."}],
)
print(response.choices[0].message.content)TypeScript
import Hanzo from "hanzoai";
const client = new Hanzo({ apiKey: "hk-your-api-key" });
const response = await client.chat.completions.create({
model: "zen4",
messages: [{ role: "user", content: "Hello, Zen." }],
});
console.log(response.choices[0].message.content);Endpoints
Chat Completions
POST /v1/chat/completions -- Generate text with any Zen model
Models
GET /v1/models -- List all 14 available models
Embeddings
POST /v1/embeddings -- Generate 3072-dim vector embeddings
Pricing
Transparent pricing at 3x upstream inference cost
Supported SDKs
| SDK | Install | Notes |
|---|---|---|
| Python (hanzoai) | pip install hanzoai | Official SDK — supports OpenAI + Claude-style endpoints |
| TypeScript (hanzoai) | npm install hanzoai | Official SDK |
| Go (hanzoai) | go get github.com/hanzoai/go-sdk | Official SDK |
| Rust (hanzoai) | cargo add hanzoai | Official SDK |
| Python (openai) | pip install openai | Compatible — set base_url="https://api.hanzo.ai/v1" |
| LangChain | pip install langchain-openai | Compatible — set base URL |
| LlamaIndex | pip install llama-index-llms-openai | Compatible — set base URL |
Rate Limits
| Tier | Requests/min | Tokens/min |
|---|---|---|
| Free ($5 credit) | 60 | 100K |
| Prepaid | 500 | 1M |