Vercel's AI Gateway logs now include a Sessions view that groups multi-turn requests and exposes how session affinity routed each one. Every row surfaces the client that ran the session, including Claude Code, Codex, and Cursor, alongside cost, models, providers, and per-session cache utilization.
The mechanism behind the numbers is worth understanding. Session affinity routes each turn to the provider that handled the previous one, keeping most of the prompt already in that provider's cache. A session that stays on a single provider reads more of each prompt from cache, which cuts latency and cost. The detailed path view inside each session shows exactly which provider served which turn and when, making routing behavior visible for the first time.
Sessions are identified three ways: a manual sessionId passed via providerOptions.gateway or the x-session-id header, automatic affinity on all text and chat requests, or a fingerprint derived from the conversation's opening exchange. Single-turn sessions are filtered out by default. The full session affinity documentation explains how Gateway resolves edge cases across all three identification methods, which is the section most operators will need.
[READ ORIGINAL →]