Rust

cargo add hanzo-client โ€” the generated async client for every /v1 capability. The separate hanzo crate is the umbrella over the wider Rust stack.

Two crates, and they are not versions of each other:

CrateInstallWhat it is
hanzo-clientcargo add hanzo-clientThe generated client for every /v1 capability. Async, reqwest.
hanzocargo add hanzoThe umbrella over the Rust stack โ€” crypto, DID, MCP, agents, embeddings โ€” behind feature flags.

For calling the API, you want hanzo-client. The library name is hanzo_client, so that is what you use.

cargo add hanzo-client tokio --features tokio/full
export HANZO_API_KEY="sk-..."   # from platform.hanzo.ai

The shape

A Configuration value passed to free functions, grouped in a module per capability:

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

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let mut cfg = Configuration::new();
    cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

    ai_api::get_models(&cfg).await?;
    Ok(())
}

Configuration::new() already points at https://api.hanzo.ai; set base_path to reach a gateway you run yourself. The module is the capability and the function is the operation, both derived from the document โ€” the reference prints the pair per operation.

Where a return type is `()`

A few operations decode to () because the document states the route's address without stating its response shape. get_models is one of them. The request is still made and the status still checked; there is simply nothing typed to hand back until the schema is published.

Resources

Was this page useful?
Last updated Oct 5, 2026