Skip to main content
Monitor AI Gateway usage from app.ngrok.ai and the AI Gateway API.

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 carries Ngrok-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:
List individual usage events to see one record per upstream attempt. Each event reports the provider, model, status code, token counts, and a per-attempt cost breakdown. Attempts of the same client request share a 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.
View usage summaries in app.ngrok.ai when available.

Roadmap

  • Token usage visualization in app.ngrok.ai
  • Cost analytics per access key
Have feedback? Email niji@ngrok.ai with observability requests.