HAI Gateway Docs

Getting Started

Authentication

Different providers use different authentication headers, but the key value is always your Access Token from this platform

Base URL Overview

OpenAIhttps://api.hai.network/openai
Anthropichttps://api.hai.network/anthropic
Googlehttps://api.hai.network/google
Volcenginehttps://api.hai.network/volcengine
OpenAI Compatiblehttps://api.hai.network/compatible-preview/openai
Anthropic Compatiblehttps://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!

ProviderAuthenticationNotes
Anthropicx-api-key: sk-pat-xxxMust include anthropic-version: 2023-06-01
OpenAIAuthorization: Bearer sk-pat-xxxFully aligned with the official API
Google AIx-goog-api-key: sk-pat-xxxCan also use query parameter ?key=sk-pat-xxx
VolcengineAuthorization: Bearer sk-pat-xxxSeedream image endpoint, same as OpenAI
QwenAuthorization: Bearer sk-pat-xxxPreview channel; use x-api-key for Anthropic Messages endpoint
GLMAuthorization: Bearer sk-pat-xxxSame as above; use x-api-key for Anthropic Messages endpoint
DeepSeekAuthorization: Bearer sk-pat-xxxSame as above; use x-api-key for Anthropic Messages endpoint
KimiAuthorization: Bearer sk-pat-xxxSame as above; use x-api-key for Anthropic Messages endpoint
MiniMaxAuthorization: Bearer sk-pat-xxxSame 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.