Skip to content
Help & Billing

Channel Affinity & Routing ​

Multi-turn coding agents (Claude Code, Codex CLI, Cline) and long-context RAG pipelines achieve dramatically lower latency and up to 90% input cost reduction when consecutive turns hit the same upstream channel and warm prompt cache.

How Vanix AI Routes Traffic ​

  1. Least-Outstanding-Requests Balancing: Incoming requests route to the least-loaded gateway replica rather than blind round-robin, avoiding head-of-line blocking behind 60-second reasoning streams.
  2. Group-Aware Channel Pools: Tokens bound to a specific group (default, vip, svip) route exclusively across healthy channels assigned to that group.
  3. Automatic Failover: When an upstream channel returns 5xx or rate-limits, Vanix AI automatically retries across healthy fallback channels in the same group.

Maximizing Session & Prompt Cache Hit Rates ​

  • Use one stable token per agent session: Avoid rotating between tokens belonging to different groups mid-conversation.
  • Keep model and tools[] identical across turns: Changing tool order or toggling beta headers invalidates upstream KV caches.
  • Respect TTL windows: Anthropic ephemeral prompt caches stay warm for ~5 minutes per hit; keep interactive agent turns spaced within the warm window for continuous savings.
  • Pass user / session identifiers consistently when your client framework supports it to help observability and affinity tracking.

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