> ## Documentation Index
> Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Aggregated daily cost, request, and error series for the authenticated

# AI Gateway usage overview



## OpenAPI

````yaml openapi/ai-gateway.yaml GET /usage/overview
openapi: 3.0.3
info:
  title: AI Gateway APIs
  version: 0.1.0
  description: |
    Control-plane HTTP APIs served by the ai-gateway-control service.
servers:
  - url: https://api.ngrok.ai
security:
  - bearerAuth: []
tags:
  - name: AI Gateway Access Key Configurations
    description: Manage reusable access key configurations (scope and routing rules).
  - name: AI Gateway Access Keys
    description: Manage ngrok-managed access keys associated with AI Gateway endpoints.
  - name: AI Gateway Configuration
    description: >-
      Manage per-account AI Gateway configuration (timeouts, token caps,
      metadata).
  - name: AI Gateway API Keys
    description: Manage customer-facing AI Gateway API Keys.
  - name: AI Gateway Credits
    description: Purchase AI Gateway credits via Stripe Checkout.
  - name: AI Gateway Providers
    description: Manage AI Gateway providers and the models they expose.
  - name: AI Gateway Custom Providers
    description: Manage custom AI Gateway providers and the models they expose.
  - name: AI Gateway Provider Keys
    description: Manage provider keys attached to AI Gateway managed access keys.
  - name: AI Gateway Usage
    description: >-
      Read-only AI Gateway usage events and aggregated usage overview for the
      authenticated account.
paths:
  /usage/overview:
    get:
      tags:
        - AI Gateway Usage
      summary: AI Gateway usage overview
      description: |
        Aggregated daily cost, request, and error series for the authenticated
        account over a time window, plus window-wide totals. Grouped by provider
        or access key. Read-only and account-scoped.
      operationId: GetAIGatewayUsageOverview
      parameters:
        - name: startTime
          in: query
          required: true
          description: Start of the window as an RFC3339 timestamp. Inclusive.
          schema:
            type: string
            format: date-time
        - name: endTime
          in: query
          required: false
          description: End of the window as an RFC3339 timestamp. Defaults to now.
          schema:
            type: string
            format: date-time
        - name: groupBy
          in: query
          required: false
          description: Dimension to break the series down by. Defaults to provider.
          schema:
            type: string
            enum:
              - provider
              - accessKey
            default: provider
      responses:
        '200':
          description: The usage overview series and window totals.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIGatewayUsageOverview'
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    AIGatewayUsageOverview:
      type: object
      additionalProperties: false
      required:
        - uri
        - buckets
        - totals
      properties:
        uri:
          type: string
          description: URI of this overview resource.
        buckets:
          type: array
          description: Daily series ordered by day then group key.
          items:
            $ref: '#/components/schemas/AIGatewayUsageOverviewBucket'
        totals:
          $ref: '#/components/schemas/AIGatewayUsageOverviewTotals'
    AIGatewayUsageOverviewBucket:
      type: object
      additionalProperties: false
      required:
        - bucketStart
        - groupKey
        - cost
        - requests
        - errors
      properties:
        bucketStart:
          type: string
          format: date-time
          description: Start of the UTC day bucket.
        groupKey:
          type: string
          description: Provider ID or access key ID, depending on groupBy.
        cost:
          type: string
          description: Cost in US dollars as a decimal string, summed over all attempts.
        requests:
          type: integer
          format: int64
          description: Final-attempt request count.
        errors:
          type: integer
          format: int64
          description: Errored final-attempt count.
    AIGatewayUsageOverviewTotals:
      type: object
      additionalProperties: false
      required:
        - cost
        - requests
        - errors
      properties:
        cost:
          type: string
          description: Total cost over the window in US dollars as a decimal string.
        requests:
          type: integer
          format: int64
          description: Total final-attempt request count over the window.
        errors:
          type: integer
          format: int64
          description: Total errored final-attempt count over the window.
    Error:
      type: object
      additionalProperties: false
      required:
        - statusCode
        - msg
        - details
      properties:
        errorCode:
          type: string
          description: Stable ngrok error code when available.
        statusCode:
          type: integer
          format: int32
          description: HTTP status code for this error.
        msg:
          type: string
          description: Human-readable error message.
        details:
          type: object
          description: Structured error details.
          additionalProperties:
            type: string
  responses:
    Error:
      description: API error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````