Quick Start
This guide helps you integrate with the HaoAI Gateway and start calling leading global models in just 3 minutes.
Prerequisites
- Go to the HaoAI Console
- Open the API Keys page
- Click Create API Key
- Have a development environment ready (Python 3.8+ / Node.js 18+)
HaoAI offers four protocol families — OpenAI-compatible, Anthropic, Grok / xAI, and Gemini. Grok uses its own route with an xAI OpenAI-compatible text interface.
Choose Your Protocol
OpenAI SDK (Recommended)
OpenAI Compatible Protocol — The most universal integration method.
cURL
Terminal
# HaoAI API endpoint. Get your API Key at https://hao.ai/console/api-keys
curl https://api.hao.ai/v1/chat/completions \
-H "Authorization: Bearer <your HAOAI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4-mini",
"messages": [
{"role": "user", "content": "What is the meaning of life?"}
]
}'