Usage
Query usage events and aggregated overview via the AI Gateway API
Debugging
Troubleshoot failed requests and error codes
Error Codes
Reference for gateway error responses
Identify a request
Every gateway response carriesNgrok-AIG-Request-Id, plus Ngrok-AIG-Attempts and Ngrok-AIG-Model describing how the request was served.
Record the request ID in your application logs so you can tie a client-side failure to gateway usage data later.
See Response headers.
Usage API
Query usage with the AI Gateway API:requestId.
By default the list returns only each request’s terminal attempt.
Pass includeRetries=true to see the retries the gateway made along the way.
When a provider reports no usage of its own,
usageEstimated is true and the provider-reported token fields are all zero.
Read inputTokensEstimate and outputTokensEstimate on those attempts instead.Roadmap
- Token usage visualization in app.ngrok.ai
- Cost analytics per access key