Hanzo

Hanzo Cloud

AI Cloud OS — model gateway, knowledge base, and infrastructure management

Hanzo Cloud

Hanzo Cloud is the core AI Cloud OS that powers api.hanzo.ai. It provides a unified model gateway (ZAP protocol), knowledge base with RAG, container orchestration, and infrastructure management across the Hanzo ecosystem.

Features

  • Three Protocols: REST API, MCP (Model Context Protocol), ZAP (Zero-overhead API Protocol)
  • Model Gateway: Route inference requests across 50+ models and providers
  • Knowledge Base: RAG-powered document stores with vector embeddings
  • Container Cloud: Kubernetes application templates and management
  • Multi-Provider: OpenAI, Anthropic, Fireworks, DO-AI, and custom Zen models
  • IAM Authentication: OAuth2/OIDC via Hanzo IAM, API keys (hk-*), widget keys (hz-*)
  • Usage Billing: Per-request metering via Hanzo Commerce API
  • Rate Limiting: Dynamic tier-based limits (free → enterprise)
  • Node Management: Remote infrastructure via VNC/RDP

Architecture

┌──────────────────────────────────────────────────────────────────┐
│                        HANZO CLOUD                               │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌─────────────────────┐    ┌──────────────────────────────┐    │
│  │   ZAP Model Gateway │    │     Knowledge / RAG          │    │
│  │  ┌───────┐ ┌──────┐ │    │  ┌────────┐  ┌───────────┐  │    │
│  │  │OpenAI │ │Zen   │ │    │  │ Stores │  │ Vectors   │  │    │
│  │  │Anthro │ │Models│ │    │  │ (docs) │  │ (embeds)  │  │    │
│  │  │Firew. │ │      │ │    │  └────────┘  └───────────┘  │    │
│  │  └───────┘ └──────┘ │    └──────────────────────────────┘    │
│  └─────────────────────┘                                        │
│                                                                  │
│  ┌─────────────────────┐    ┌──────────────────────────────┐    │
│  │   Auth & Billing    │    │     Container Cloud          │    │
│  │  ┌───────┐ ┌──────┐ │    │  ┌────────┐  ┌───────────┐  │    │
│  │  │ IAM   │ │Comm. │ │    │  │  K8s   │  │ Templates │  │    │
│  │  │ OIDC  │ │ API  │ │    │  │ Apps   │  │           │  │    │
│  │  └───────┘ └──────┘ │    │  └────────┘  └───────────┘  │    │
│  └─────────────────────┘    └──────────────────────────────┘    │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

Endpoints

EnvironmentURLPurpose
Productionhttps://api.hanzo.aiAPI gateway
Consolehttps://console.hanzo.aiAdmin UI
Lux Cloudhttps://cloud.lux.networkLux network instance

Quick Start

Get an API Key

Create an API key at console.hanzo.ai or via the API:

curl -X POST https://api.hanzo.ai/api/add-token \
  -H "Authorization: Bearer $IAM_TOKEN" \
  -d '{"name": "my-key", "organization": "hanzo"}'

Chat Completion (OpenAI-Compatible)

curl https://api.hanzo.ai/v1/chat/completions \
  -H "Authorization: Bearer hk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zen4-mini",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

SDK Usage

import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://api.hanzo.ai/v1',
  apiKey: 'hk-your-api-key'
})

const response = await client.chat.completions.create({
  model: 'zen4-mini',
  messages: [{ role: 'user', content: 'Hello' }]
})

Protocols

Hanzo Cloud exposes three protocols for accessing AI services:

ProtocolTransportUse Case
RESTHTTPS (JSON)Standard OpenAI-compatible API for chat completions, embeddings, models
MCPstdio / SSEModel Context Protocol — 260+ tools for AI agents (filesystem, search, browser, etc.)
ZAPWebSocket (binary)Zero-overhead API Protocol — native binary streaming for low-latency inference

REST (OpenAI-Compatible)

curl https://api.hanzo.ai/v1/chat/completions \
  -H "Authorization: Bearer hk-your-key" \
  -d '{"model": "zen4-mini", "messages": [{"role": "user", "content": "Hello"}]}'

MCP (Model Context Protocol)

npx @hanzo/mcp --api-key hk-your-key

Or configure in your AI client's MCP settings:

{
  "mcpServers": {
    "hanzo": {
      "command": "npx",
      "args": ["@hanzo/mcp", "--api-key", "hk-your-key"]
    }
  }
}

ZAP (WebSocket)

const ws = new WebSocket('wss://api.hanzo.ai/zap')
ws.send(JSON.stringify({
  type: 'chat.completions',
  model: 'zen4-mini',
  messages: [{ role: 'user', content: 'Hello' }]
}))

Authentication

Hanzo Cloud supports multiple auth methods:

MethodFormatUse Case
IAM API Keyhk-*Server-side API access
IAM JWTBearer tokenUser sessions via hanzo.id
Provider Keysk-*Direct provider passthrough
Widget Keyhz-*Public-facing chat widgets

All auth flows integrate with Hanzo IAM for identity management.

Rate Limits

TierRequests/minSet By
Free10Default
Starter60Commerce billing
Pro300Commerce billing
Enterprise1000Commerce billing

KMS Integration

All secrets (provider API keys, database credentials, IAM client secrets) are managed by Hanzo KMS. See KMS Service Integration for the pattern.

Next Steps

Core concepts: providers, stores, vectors, chats

Configure model, storage, and embedding providers

OpenAI-compatible API and SDK integration

Kubernetes application management

How is this guide?

Last updated on

On this page