AI Gateway adds Sessions view to logs for tracking session affinity and cache efficiency

·2026.10.17 09:00

Key point

The new view groups requests by session to display cache hit rates, duration, and provider routing paths for coding agents like Claude Code and Codex.

1 / 3

Details

AI Gateway logs now include a Sessions view that groups requests into sessions and visualizes how session affinity routed each one. Each row identifies the coding agent or application, such as Claude Code, Codex, or Cursor, alongside metrics for cost, models, providers, and the percentage of input cached across all turns.

Session Details and Routing

Opening a session reveals its cache hit rate, duration, and routing path. The path lists every turn with its specific model and timing, identifying the provider serving the session and any previous providers. Session affinity directs each turn to the provider that handled the preceding one, ensuring the provider retains most of the prompt in cache. Consequently, sessions that remain on a single provider achieve higher cache read rates.

Filtering and Configuration

Users can filter sessions by turns, client, model, provider, authentication, or cost. By default, single-turn sessions are hidden unless the minimum turns filter is cleared. Session affinity runs automatically on text and chat requests. For manual grouping, developers can send the same sessionId in providerOptions.gateway or use the same x-session-id header across requests in a conversation. Requests lacking these identifiers are grouped by a fingerprint of the conversation's opening and appear as fingerprinted sessions.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.