Files

1 line
2.6 KiB
JSON

{"text":["Integrations","Rust","🦀","Languages","Use Hanzo AI with Rust","Use Hanzo AI in Rust via the async-openai crate or raw reqwest HTTP calls. Full async support with Tokio, streaming, and type-safe API access.","Base URL:","https://api.hanzo.ai/v1","Get yours at","Fully OpenAI-compatible","400+ models","available","API Key:","platform.hanzo.ai/api-keys","Created by","Rust Foundation","License:","MIT / Apache-2.0","View source on GitHub →","Hanzo AI is OpenAI-compatible, so existing Rust code works with zero refactoring. We deeply appreciate the Rust Foundation team for building and maintaining this open-source project.","Cargo.toml","toml","dependencies","async-openai","0.26","tokio","version","features","full","rust","use","async_openai::","config::OpenAIConfig","Client","types::*","};","#[","tokio::main","async","fn","main","()","let","config = OpenAIConfig::","new","with_api_base","with_api_key","std::env::","var","HANZO_API_KEY","unwrap","());","client = Client::","with_config","config",");","request = CreateChatCompletionRequestArgs::","default","model","zen4-pro","messages","([","ChatCompletionRequestUserMessageArgs::","content","Hello from Rust!","build","into","()])","();","response = client.","chat","create","request","await","println!","\"{}\"","response.choices",".message.content.","as_ref","reqwest raw HTTP","reqwest::Client","serde_json::json","resp = client","post","https://api.hanzo.ai/v1/chat/completions","bearer_auth","())","json","json!","({","[{","role","user","Hello!","}]","}))","send","resp.","text","Build and run","bash","export","HANZO_API_KEY=","your-hanzo-api-key","cargo","--release","./target/release/my-ai-app","Ready to get started?","Create a free account and get your API key. The Free plan includes free model requests and Kai decisions, no card.","Get API key — Free","Browse Models","More integrations","OpenAI Python SDK","Anthropic SDK","LangChain","LlamaIndex","Vercel AI SDK","Hugging Face","AutoGen","CrewAI","DSPy","Haystack","Cursor","Continue.dev","GitHub Copilot","Docker","Kubernetes","Python","TypeScript","Go"],"links":["/integrations","https://platform.hanzo.ai/api-keys","https://rust-lang.org","https://github.com/rust-lang/rust","/models","/integrations/openai-sdk","/integrations/anthropic-sdk","/integrations/langchain","/integrations/llamaindex","/integrations/vercel-ai-sdk","/integrations/huggingface","/integrations/autogen","/integrations/crewai","/integrations/dspy","/integrations/haystack","/integrations/cursor","/integrations/continue-dev","/integrations/github-copilot","/integrations/docker","/integrations/kubernetes","/integrations/python","/integrations/typescript","/integrations/go"]}