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, 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.

Accepted X-Antix-Provider values

ProviderAccepted values
OpenAIopenai
Anthropicanthropic
Google Geminigoogle, gemini, google_ai_studio_gemini
xAIxai, x-ai
Alibaba / DashScopealibaba, qwen, dashscope
Provider inference

When the header is omitted, Antix infers the provider from the key prefix (e.g., sk-ant-… → Anthropic, sk-… → OpenAI). Alibaba/DashScope keys have no distinctive prefix — you must set X-Antix-Provider for those requests, otherwise they will fail upstream with 401 Unauthorized.