For Gemini Live API calls that ended in a client timeout or a 5xx error, while AI Studio shows only aggregate usage, is there a way to retrieve request-level records after the fact and confirm whether a call was processed or billed, including its token counts? Which request identifiers or logging settings should be captured to troubleshoot future calls?
Hello @Rihch,
There is no self-serve way to retrieve post-facto request-level token records for Gemini Live API sessions. AI Studio Logs currently supports GenerateContent, BatchGenerateContent, StreamGenerateContent, and Interactions API calls (excluding Managed Agents), not Live API sessions, and AI Studio Usage and Cloud Billing only report aggregate usage.
For billing behavior on failed or canceled calls, see Am I charged for failed, blocked, or canceled requests and Live API pricing and billing. If you suspect you were billed for a specific failed call, you can contact Cloud Billing Support with your project ID and exact UTC timestamp window to review the charge.
To track token usage and troubleshoot future Live API sessions, capture these details on the client side:
- Periodic
usageMetadatamessages as they arrive on the stream (Token count). sessionResumptionUpdatehandles (by enablingsessionResumptionin setup) andgoAwaymessages before disconnects (Session management).- Model name, exact UTC timestamps, WebSocket close codes and reasons (or handshake HTTP status), and your own client session ID.