Menu
Important
Stay updated on React2Shell

Usage & Billing

Last updated December 1, 2025

The AI Gateway provides endpoints to monitor your credit balance, track usage, and retrieve detailed information about specific generations.

The Usage & Billing API is available at the following base URL:

The AI Gateway supports the following Usage & Billing endpoints:

  • - Check your credit balance and usage information
  • - Retrieve detailed information about a specific generation

Check your AI Gateway credit balance and usage information.

Endpoint
Example request
Sample response
Response fields
  • : The remaining credit balance
  • : The total amount of credits used

Retrieve detailed information about a specific generation by its ID. This endpoint allows you to look up usage data, costs, and metadata for any generation created through the AI Gateway. Generation information is available shortly after the generation completes. Note much of this data is also included in the field of the chat completion responses.

Endpoint
Parameters
  • (required): The generation ID to look up (format: )
Example request
Sample response
Response fields
  • : The generation ID
  • : Total cost in USD for this generation
  • : Usage cost (same as total_cost)
  • : ISO 8601 timestamp when the generation was created
  • : Model identifier used for this generation
  • : Whether this generation used Bring Your Own Key credentials
  • : The provider that served this generation
  • : Whether this generation used streaming ( for streamed responses, otherwise)
  • : Time to first token in milliseconds
  • : Total generation time in milliseconds
  • : Number of prompt tokens
  • : Number of completion tokens
  • : Native prompt tokens (provider-specific)
  • : Native completion tokens (provider-specific)
  • : Reasoning tokens used (if applicable)
  • : Cached tokens used (if applicable)

Generation IDs: Generation IDs are included in chat completion responses as the field as well as in the provider metadata returned in the response.


Was this helpful?

supported.