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

# Get a connector's usage

> Read gateway spend telemetry for a connector for the current day, week and month to date, with per-model attribution for the month. Windows are calendar periods in UTC: since midnight today, since Monday 00:00 of this week and since the first of the month, not rolling 24-hour, 7-day or 30-day windows. Only provisioned and platform connectors emit gateway metrics; other connectors answer 404. Results are cached for 60 seconds and lag ingestion, so they may differ from the provider's balance. Requires an unrestricted token.



## OpenAPI

````yaml /sprites/api/openapi.json get /v1/oauth/connections/{id}/usage
openapi: 3.1.0
info:
  title: Sprites API
  version: 0.1.12
  x-sprite-env-version: 0.0.5
servers:
  - url: https://api.sprites.dev
security: []
paths:
  /v1/oauth/connections/{id}/usage:
    get:
      tags:
        - Connectors
      summary: Get a connector's usage
      description: >-
        Read gateway spend telemetry for a connector for the current day, week
        and month to date, with per-model attribution for the month. Windows are
        calendar periods in UTC: since midnight today, since Monday 00:00 of
        this week and since the first of the month, not rolling 24-hour, 7-day
        or 30-day windows. Only provisioned and platform connectors emit gateway
        metrics; other connectors answer 404. Results are cached for 60 seconds
        and lag ingestion, so they may differ from the provider's balance.
        Requires an unrestricted token.
      operationId: connection_usage_usage_get
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionUsageResponse'
          description: Success
        '401':
          description: Missing or invalid authentication
        '403':
          description: Unrestricted token required
        '404':
          description: Connector not found or not a metered connector
        '502':
          description: The metrics backend did not answer
        '503':
          description: No metrics backend is configured
      security:
        - bearerAuth: []
components:
  schemas:
    ConnectionUsageResponse:
      description: Connector usage response
      properties:
        usage:
          $ref: '#/components/schemas/ConnectionUsage'
          description: >-
            Usage from the Sprites gateway's own telemetry. It lags ingestion
            and may differ from the provider's balance.
          example:
            daily_usd: 0.42
            monthly_usd: 8.75
            weekly_usd: 2.1
      required:
        - usage
      type: object
    ConnectionUsage:
      description: Connector usage
      properties:
        daily_series:
          description: Spend per one-hour bucket since midnight UTC today.
          example:
            - ts: 1760832000
              usd: 0.0123
          items:
            $ref: '#/components/schemas/UsagePoint'
          type: array
        daily_usd:
          description: Spend since midnight UTC today in USD.
          example: 0.42
          type:
            - number
            - 'null'
        model_breakdown:
          description: Spend attributed to each model, month to date.
          example:
            - model: anthropic/claude-sonnet-4
              usd: 1.25
          items:
            $ref: '#/components/schemas/UsageModelBreakdown'
          type: array
        monthly_series:
          description: Spend per one-day bucket since the first of the month.
          example:
            - ts: 1760832000
              usd: 0.3
          items:
            $ref: '#/components/schemas/UsagePoint'
          type: array
        monthly_usd:
          description: Spend since 00:00 UTC on the first of the month in USD.
          example: 8.75
          type:
            - number
            - 'null'
        weekly_series:
          description: >-
            Spend per six-hour bucket since Monday 00:00 UTC of the current
            week.
          example:
            - ts: 1760832000
              usd: 0.3
          items:
            $ref: '#/components/schemas/UsagePoint'
          type: array
        weekly_usd:
          description: Spend since Monday 00:00 UTC of the current week in USD.
          example: 2.1
          type:
            - number
            - 'null'
      required:
        - daily_series
        - weekly_series
        - monthly_series
        - model_breakdown
      type: object
    UsagePoint:
      description: Usage series point
      properties:
        ts:
          description: Unix timestamp in seconds at the start of the bucket.
          example: 1760832000
          type: integer
        usd:
          description: Spend in the bucket in USD.
          example: 0.0123
          type: number
      required:
        - ts
        - usd
      type: object
    UsageModelBreakdown:
      description: Usage by model
      properties:
        model:
          description: Model identifier as reported by the provider.
          example: anthropic/claude-sonnet-4
          type: string
        usd:
          description: Spend attributed to the model in USD.
          example: 1.25
          type: number
      required:
        - model
        - usd
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````