Authentication methods
AIOHub supports multiple authentication headers for different client types:
All methods use the same
sk- API key value. AIOHub automatically detects the authentication format.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Authenticate with an API key through Authorization: Bearer, x-api-key, or x-goog-api-key headers.
| Method | Header | Client |
|---|---|---|
| Bearer auth | Authorization: Bearer sk-xxx | OpenAI SDK, Codex CLI, most OpenAI-compatible tools |
| Anthropic API Key | x-api-key: sk-xxx | Anthropic SDK |
| Anthropic bearer auth | Authorization: Bearer sk-xxx | Claude Code (ANTHROPIC_AUTH_TOKEN) |
| Google API Key | x-goog-api-key: sk-xxx | Gemini CLI, Google SDK |
sk- API key value. AIOHub automatically detects the authentication format.
curl https://api.aiohub.org/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hi"}]}'
curl https://api.aiohub.org/v1/messages \
-H "x-api-key: sk-your-api-key" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{"model": "claude-sonnet-4-20250514", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hi"}]}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.aiohub.org/v1",
api_key="sk-your-api-key"
)
import anthropic
client = anthropic.Anthropic(
base_url="https://api.aiohub.org",
api_key="sk-your-api-key"
)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.aiohub.org/v1",
apiKey: "sk-your-api-key",
});
| Status | Cause | Fix |
|---|---|---|
| 401 | API key is invalid, expired, or sent in the wrong header | Check that the API key is complete, enabled, and sent in the expected header |
| 403 | API key cannot access the requested model | Confirm the API key group includes the model and endpoint |
| 429 | Rate limit reached | Slow down requests and check console announcements or current limits |
curl https://api.aiohub.org/v1/models \
-H "Authorization: Bearer sk-your-api-key"