Skip to main content

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

EndpointMethodProtocol
/v1/chat/completionsPOSTOpenAI Chat Completions
/v1/responsesPOSTOpenAI Responses API
/v1/messagesPOSTAnthropic Messages
/v1/messages/count_tokensPOSTAnthropic token counter
/v1/models/{action}POSTGemini native (:generateContent, :streamGenerateContent)
/v1beta/models/{action}POSTGemini v1beta native path
/v1/models, /modelsGETPublic model catalog (no auth)
/v2/model/infoGETCatalog 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:

ProviderNotable modelsAccepted X-Antix-Provider valuesNotes
AnthropicClaude Sonnet, Opus, HaikuanthropicNative /v1/messages support.
OpenAIGPT-5.xopenaiNative /v1/chat/completions and /v1/responses support.
Google GeminiGemini 3.xgoogle, gemini, google_ai_studio_geminiNative Gemini protocol at /v1/models/{action} and /v1beta.
xAIGrokxai, x-aiOpenAI-compatible upstream.
Alibaba Qwenqwen3-max, qwen3-coder-plus, qwen3-coder-flash, qwq-plus, qwen-plus, qwen-max, and morealibaba, qwen, dashscopeRouted via DashScope. No distinctive key prefix — you must set X-Antix-Provider on BYOK calls.
DeepSeekdeepseek-chat (V3), deepseek-reasoner (R1), deepseek-v4-pro, deepseek-v4-flashdeepseekOpenAI-compatible upstream API. deepseek-reasoner returns a reasoning_content field alongside the final answer.
Zai (GLM)glm-5.2, glm-5.1, glm-4.7zaiZhipu AI's GLM model family, OpenAI-compatible upstream. No distinctive key prefix — you must set X-Antix-Provider on BYOK calls.
Provider inference

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.