Skip to content

Analytics and logging

Your AI Gateway dashboard shows metrics on requests, tokens, caching, errors, and cost. You can filter these metrics by time. These analytics help you understand traffic patterns, token consumption, and potential issues across AI providers. You can view the following analytics:

  • Requests: Track the total number of requests processed by AI Gateway.
  • Token Usage: Analyze token consumption across requests, giving insight into usage patterns.
  • Costs: Gain visibility into the costs associated with using different AI providers, allowing you to track spending, manage budgets, and optimize resources.
  • Errors: Monitor the number of errors across the gateway, helping to identify and troubleshoot issues.
  • Cached Responses: View the percentage of responses served from cache, which can help reduce costs and improve speed.

View analytics

To view analytics in the dashboard:

  1. Log into the Cloudflare dashboard and select your account.
  2. Go to AI > AI Gateway.
  3. Make sure you have your gateway selected.

Logging

Your AI Gateway dashboard also shows real-time logs of individual requests, such as the prompt, response, provider, timestamps, and whether the request was successful, cached, or if there was an error. These logs now persist and can store up to 10,000 logs per gateway for better observability and analysis.