Skip to content
Guides

API Keys & Authentication ​

All Vanix AI API requests are authenticated over HTTPS (TLS 1.2+) using a single sk-... API token issued from Console → API Tokens.

Protocol Header Matrix ​

ProtocolRequired Header(s)Example
OpenAI (/v1/*)AuthorizationAuthorization: Bearer sk-vanix-...
Anthropic (/v1/messages)x-api-key, anthropic-versionx-api-key: sk-vanix-... and anthropic-version: 2023-06-01
Google Gemini (/v1beta/*)x-goog-api-key (or ?key=)x-goog-api-key: sk-vanix-...
Realtime WebSocketAuthorization, OpenAI-BetaAuthorization: Bearer sk-vanix-... + OpenAI-Beta: realtime=v1

Never Expose Keys in Client Bundles

Browser apps and mobile clients should proxy requests through your own backend. Only use direct browser calls in local development or inside the Live API Playground.

Scoped Token Controls ​

Each Vanix AI token supports independent production guardrails configured in the Console:

GuardrailDescriptionRecommended Use
Quota CeilingHard spending limit per token, independent of your account balance.Cap spend per developer, CI pipeline, or tenant environment.
Model AllowlistRestrict a token to specific model IDs (e.g., gpt-4o-mini, text-embedding-3-small).Prevent accidental invocation of expensive frontier reasoning models.
Token GroupBind a token to a routing group (e.g., default, vip, svip) with dedicated channels and pricing multipliers.Separate staging traffic from high-priority production SLAs.
IP AllowlistAccept requests only from listed egress IPs or CIDRs.Lock server-side keys to NAT gateway or VPC egress addresses.
Expiration TimeAutomatic revocation timestamp.Temporary keys for demos, hackathons, or contractor access.
  1. One key per workload: Issue separate keys for production API, batch jobs, coding CLIs, and local development so any single key can be revoked without downtime.
  2. Enforce least privilege: Apply both a Model Allowlist and a Quota Ceiling on every automated worker key.
  3. Zero-downtime rotation: Create a replacement token, roll it out through your secret manager (AWS Secrets Manager / SSM Parameter Store), monitor zero traffic on the old token in Console Logs, then disable and delete the old token.

Quick Verification ​

bash
curl -sS https://api.vanix.io/v1/models \
  -H "Authorization: Bearer $VANIX_API_KEY" | head -c 400

A 200 OK JSON response containing "object": "list" confirms your token is active and authorized.

Vanix AI Unified Model Gateway · https://api.vanix.io