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:
| Crate | Install | What it is |
|---|---|---|
hanzo-client | cargo add hanzo-client | The generated client for every /v1 capability. Async, reqwest. |
hanzo | cargo add hanzo | The 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.aiThe 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.
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
hanzo-clienton crates.io ยทhanzoon crates.io- API reference and source โ
hanzo-clienton docs.rs ยทhanzoon docs.rs - Every
/v1operation โ