Files

1 line
2.5 KiB
JSON

{"text":["Integrations","Python","🐍","Languages","Use Hanzo AI with Python","Use Hanzo AI in Python with the official OpenAI SDK (fully compatible), the Anthropic SDK, or via HTTP with httpx/requests. Zero lock-in, standard interfaces.","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","Python Software Foundation","License:","PSF License","View source on GitHub →","Hanzo AI is OpenAI-compatible, so existing Python code works with zero refactoring. We deeply appreciate the Python Software Foundation team for building and maintaining this open-source project.","OpenAI SDK (recommended)","python","pip install openai","from","openai","import","OpenAI","client = OpenAI","base_url=","api_key=","your-hanzo-api-key","response = client","chat","completions","create","model=","zen4-pro","messages=","[{","role","user","content","Hello!","}],","print","response","choices","].","message","httpx (raw HTTP)","httpx","json","response = httpx","post","https://api.hanzo.ai/v1/chat/completions","headers=","Authorization","Bearer your-hanzo-api-key","},","json=","model","messages","()[","][","])","Async with asyncio","asyncio","AsyncOpenAI","client = AsyncOpenAI","async","def","main","():","response =","await","client","Hello async!","run","())","Environment setup","# .env","HANZO_API_KEY","=your-hanzo-api-key","# Load in code","dotenv","load_dotenv","os","()","api_key=os","environ","],","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","TypeScript","Go","Rust"],"links":["/integrations","https://platform.hanzo.ai/api-keys","https://python.org","https://github.com/python/cpython","/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/typescript","/integrations/go","/integrations/rust"]}