Routing & BYOK
Antix is a multi-protocol gateway. It accepts requests in OpenAI, Anthropic, and Gemini shapes and normalizes streaming across upstream providers including Anthropic, Google Gemini, Alibaba Qwen, DeepSeek, Zai (GLM), xAI, and OpenAI.
Supported endpoints
| Endpoint | Method | Protocol |
|---|---|---|
/v1/chat/completions | POST | OpenAI Chat Completions |
/v1/responses | POST | OpenAI Responses API |
/v1/messages | POST | Anthropic Messages |
/v1/messages/count_tokens | POST | Anthropic token counter |
/v1/models/{action} | POST | Gemini native (:generateContent, :streamGenerateContent) |
/v1beta/models/{action} | POST | Gemini v1beta native path |
/v1/models, /models | GET | Public model catalog (no auth) |
/v2/model/info | GET | Catalog with pricing |
/v1/embeddings, audio, images, files, fine-tuning, and the batch API are not supported.
Drop-in SDK compatibility
Point any OpenAI, Anthropic, or Gemini SDK at Antix by changing the base URL and swapping in your Virtual Key. The proxy translates provider-specific quirks and keeps SSE streaming predictable.
from openai import OpenAI
client = OpenAI(
base_url="https://antix.antigma.ai/v1",
api_key="sk-antix-<your-key>",
)
response = client.chat.completions.create(
model="claude-sonnet-4-6",
messages=[{"role": "user", "content": "Hello!"}],
stream=True,
)
A streaming pipeline normalizes SSE events across providers so token deltas, tool calls, and stop reasons arrive in a consistent shape regardless of upstream.
Claude Code
Claude Code uses the Anthropic SDK internally, so redirecting it at Antix takes one environment variable:
export ANTHROPIC_BASE_URL="https://antix.antigma.ai"
That's it — Claude Code's SDK reads both and routes all /v1/messages traffic to Antix, which passes it through to Anthropic with your platform key substituted.
Bring Your Own Key (BYOK)
If you have negotiated direct rates with a provider but still want Antix's observability and routing, use BYOK. Send your provider key in Authorization and declare the provider with X-Antix-Provider:
curl -X POST https://antix.antigma.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ALIBABA_DASHSCOPE_KEY" \
-H "X-Antix-Provider: alibaba" \
-d '{
"model": "qwen-max",
"messages": [{"role": "user", "content": "Hello!"}]
}'
BYOK traffic is not re-billed by Antix. It is still tracked for observability.
Supported providers
Antix normalizes requests across these upstream providers. Route to any of them by model name (Antix infers the provider) or explicitly via X-Antix-Provider:
| Provider | Notable models | Accepted X-Antix-Provider values | Notes |
|---|---|---|---|
| Anthropic | Claude Sonnet, Opus, Haiku | anthropic | Native /v1/messages support. |
| OpenAI | GPT-5.x | openai | Native /v1/chat/completions and /v1/responses support. |
| Google Gemini | Gemini 3.x | google, gemini, google_ai_studio_gemini | Native Gemini protocol at /v1/models/{action} and /v1beta. |
| xAI | Grok | xai, x-ai | OpenAI-compatible upstream. |
| Alibaba Qwen | qwen3-max, qwen3-coder-plus, qwen3-coder-flash, qwq-plus, qwen-plus, qwen-max, and more | alibaba, qwen, dashscope | Routed via DashScope. No distinctive key prefix — you must set X-Antix-Provider on BYOK calls. |
| DeepSeek | deepseek-chat (V3), deepseek-reasoner (R1), deepseek-v4-pro, deepseek-v4-flash | deepseek | OpenAI-compatible upstream API. deepseek-reasoner returns a reasoning_content field alongside the final answer. |
| Zai (GLM) | glm-5.2, glm-5.1, glm-4.7 | zai | Zhipu AI's GLM model family, OpenAI-compatible upstream. No distinctive key prefix — you must set X-Antix-Provider on BYOK calls. |
When the header is omitted, Antix infers the provider from the key prefix (e.g., sk-ant-… → Anthropic, sk-… → OpenAI). Some keys (like Alibaba/DashScope or Zai) may have no distinctive prefix — you must set X-Antix-Provider for those requests, otherwise they will fail upstream with 401 Unauthorized.
See Models API to list exactly which models your gateway currently serves.