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
- 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.
- Group-Aware Channel Pools: Tokens bound to a specific group (
default,vip,svip) route exclusively across healthy channels assigned to that group. - Automatic Failover: When an upstream channel returns
5xxor 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
modelandtools[]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.