Getting Started
Authentication
Different providers use different authentication headers, but the key value is always your Access Token from this platform
Base URL Overview
| OpenAI | https://api.hai.network/openai |
| Anthropic | https://api.hai.network/anthropic |
https://api.hai.network/google | |
| Volcengine | https://api.hai.network/volcengine |
| OpenAI Compatible | https://api.hai.network/compatible-preview/openai |
| Anthropic Compatible | https://api.hai.network/compatible-preview/anthropic |
| Unified API (Preview) | https://api.hai.network/unified-preview/openai |
About Relay Mode API
To lower the barrier for using multiple advanced AI models, HAI Gateway provides a native API Relay feature. By integrating official API endpoints from mainstream AI platforms such as OpenAI, Anthropic, and Google, users can directly access a variety of third-party AI tools — including Claude Code — without registering, applying for keys, or configuring complex parameters on their own.
Common Pitfall: Different Header Names
OpenAI uses Authorization: Bearer xxx, Anthropic uses x-api-key: xxx, and Google uses x-goog-api-key: xxx. Make sure to use the correct authentication header for the provider you're calling!
| Provider | Authentication | Notes |
|---|---|---|
| Anthropic | x-api-key: sk-pat-xxx | Must include anthropic-version: 2023-06-01 |
| OpenAI | Authorization: Bearer sk-pat-xxx | Fully aligned with the official API |
| Google AI | x-goog-api-key: sk-pat-xxx | Can also use query parameter ?key=sk-pat-xxx |
| Volcengine | Authorization: Bearer sk-pat-xxx | Seedream image endpoint, same as OpenAI |
| Qwen | Authorization: Bearer sk-pat-xxx | Preview channel; use x-api-key for Anthropic Messages endpoint |
| GLM | Authorization: Bearer sk-pat-xxx | Same as above; use x-api-key for Anthropic Messages endpoint |
| DeepSeek | Authorization: Bearer sk-pat-xxx | Same as above; use x-api-key for Anthropic Messages endpoint |
| Kimi | Authorization: Bearer sk-pat-xxx | Same as above; use x-api-key for Anthropic Messages endpoint |
| MiniMax | Authorization: Bearer sk-pat-xxx | Same as above; use x-api-key for Anthropic Messages endpoint |
About the Bailian Preview Channel
Qwen, GLM, DeepSeek, Kimi, and MiniMax are served through a separate preview gateway at https://api.hai.network/compatible-preview, independent from the three Relay Mode gateways above. All channels use the same Access Token (with the sk-pat- prefix), but routing and billing are isolated per channel — pick the Base URL and model matching your target provider. See each provider's dedicated section for detailed usage.
About the Unified API Preview Channel
unified-preview is an experimental channel: callers use the OpenAI format to invoke Anthropic / Google and other upstream models, with the gateway automatically detecting each model's native schema and performing the conversion. This channel is currently in gated rollout and only available to a limited set of tenants. Authentication is identical to the OpenAI Relay (Authorization: Bearer sk-pat-xxx). See the dedicated section for detailed usage and known limitations.