API
The REST API reference for every Hanzo Cloud service -- one base URL, one bearer key, at api.hanzo.ai/v1.
Build Anything with Hanzo
Over 400 models, one platform. Pick how much you want to type.
Build me a multiplayer snake game with a
leaderboard, and deploy it.Get going
Install the CLI and sign in. Two commands, then you have a key.
curl -fsSL hanzo.sh | bash
hanzo auth loginhanzo auth login opens hanzo.id in your browser and writes the credential locally,
so every later command — and every SDK on this machine — is authenticated. To call
the API directly instead, mint a key with API Keys and send it as a
bearer token.
Every Hanzo service exposes a REST API under one base URL. One credential works across all of them, and the request shape is uniform: a bearer token, a JSON body, a JSON response.
Base URL and Authentication
https://api.hanzo.ai/v1Authenticate every request with a bearer token in the Authorization header. Use an API key (sk-...) for server-to-server calls, or an IAM access token for user-facing apps:
Authorization: Bearer sk-...All traffic is TLS-only and passes through the Gateway, which authenticates, rate-limits, and routes it. See API Keys to create a key and Authentication for OIDC tokens.
Service Namespaces
Each service is namespaced under /v1/<service>, and the full list is the
reference — one page per product, generated from the same
description the SDKs and the CLI are generated from. A table here would be a
second list of products maintained by hand, and it was: it advertised a
namespace the API does not serve, for months, because nothing compared it to
anything.
The API is versioned at v1; it evolves additively, so integrations stay stable.
Example Request
curl https://api.hanzo.ai/v1/models \
-H "Authorization: Bearer sk-..."Responses are JSON. Errors use standard HTTP status codes -- 401 for a bad or missing key, 403 when authenticated but forbidden, 429 when rate-limited, 402 when out of credits.
Related
- API Keys -- create and manage
sk-credentials - Authentication -- OAuth 2.0 + OIDC for user tokens
- Gateway -- the entry point every request passes through
- OpenAPI -- machine-readable specs and generated references
- SDKs -- Python, TypeScript, Go, and Rust clients
How is this guide?