Trending:

AI Gateway Sessions view and session affinity: what the evidence shows (with caveats)

Prepared with AI assistance from source material. Automated editorial review recorded . Automated checks can miss errors and do not represent human approval. Editorial policy and corrections.

Illustration of AI Gateway session routing with provider hops and cached prompts
TechStaged-owned

Summary

  • AI Gateway logs now have a Sessions view that groups requests into sessions and shows how session affinity routed each one.
  • The view lists the coding agents/apps (Claude Code, Codex, Cursor) and includes cost, models, providers, and cached input across turns.
  • Open a session to see its cache hit rate, duration, and path.
  • The path lists each turn with its model and timing, and names the provider serving the session along with any earlier ones.

AI Gateway now exposes a Sessions view that groups requests into sessions and shows how session affinity routed each one. The session row includes the coding agent or app (for example, Claude Code, Codex, or Cursor), its cost, models, providers, and how much of input was cached across turns.

WHAT THE SESSIONS VIEW DISPLAYS

You can open a session to see its cache hit rate, duration, and path. The path lists each turn with its model and timing, and names the provider serving the session along with any earlier ones.

"The path lists each turn with its model and timing, and names the provider serving the session along with any earlier ones."

A session that stays on one provider reads more of each prompt from cache.

HOW READERS CAN INTERPRET AND USE THE NEW DATA

The changelog notes that you can filter sessions by turns, client, model, provider, authentication, or cost, enabling targeted analysis of how prompts are cached and how routing choices affect performance.

To group requests yourself, send the same sessionId in providerOptions.gateway, or the same x-session-id header on every request in a conversation.

The article also advises reading the session affinity documentation for more information on how AI Gateway identifies sessions.

WHAT REMAINS UNCERTAIN OR UNVERIFIED

Some claims are presented as implications or recommended practices rather than explicit, verifiable outcomes from the changelog. For example, the assertion that filtering attributes support targeted analysis and that cache effectiveness varies with staying versus hopping between providers are treated as bounded inferences rather than established facts.

KEY TAKEAWAYS AND NEXT STEPS

The new Sessions view provides concrete, verifiable data points about session grouping, per-turn routing, and per-turn providers. Readers can use the built-in filters to examine how different models or providers behave within a session, while remaining aware that some causal impacts (like caching performance differences) are not definitively proven in the changelog text.