hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation

hanzo-client

The Rust client for the Hanzo API. Generated from hanzoai/cloud's openapi.yaml, which cloud emits by projecting its own routers, so it cannot describe a route the binary does not serve. Every Hanzo SDK reads that one document, so this crate and the Go, TypeScript and Python clients describe the same product. Which commit of it this crate is a projection of is written beside the code, in the repository's .spec-lock.

Every service, one crate.

[dependencies]
hanzo-client = "0.1"
tokio = { version = "1", features = ["full"] }

Use

Every request carries a bearer token. Configuration::default() already points at https://api.hanzo.ai; set the token and go.

use hanzo_client::apis::{configuration::Configuration, mcp_api};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cfg = Configuration {
        bearer_access_token: std::env::var("HANZO_API_KEY").ok(),
        ..Default::default()
    };

    let list = mcp_api::get_mcp_servers(&cfg).await?;
    println!("{} MCP server(s)", list.servers.unwrap_or_default().len());
    Ok(())
}

Org-scoped services (kv, agents) also need an X-Org-Id header — build cfg.client with it as a default header.

Flows

Six runnable journeys, the same six in every Hanzo SDK, live in this repository's examples/:

HANZO_API_KEY=sk-... cargo run -p hanzo-examples --example hello

hello, chat, money, store, agent, tools.

Do not edit

src/ is generated. The document comes from hanzoai/cloud; run ./scripts/generate.sh from the repository root to project it again, and ./scripts/generate.sh --check to prove the committed tree has not drifted.

License

MIT OR Apache-2.0.