> ## Documentation Index
> Fetch the complete documentation index at: https://unevenlabs-ted-int2-729-document-new-api-endpoint.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Usage

> This API returns API call counts for the authenticated API key, grouped by endpoint, status code, and error code.



## OpenAPI

````yaml get /metrics/usage
openapi: 3.0.3
info:
  title: Cross-chain solver
  version: 1.0.0
servers:
  - url: https://api.relay.link
    description: Mainnet API
  - url: https://api.testnets.relay.link
    description: Testnet API
security: []
paths:
  /metrics/usage:
    get:
      description: >-
        Get API call counts for the authenticated API key, grouped by endpoint,
        status code, and error code.
      parameters:
        - schema:
            type: string
            enum:
              - minutely
              - hourly
              - daily
            default: hourly
          in: query
          name: granularity
          required: false
          description: >-
            Time bucket granularity. minutely defaults to last 24h, hourly to
            last 7d, daily to last 14d.
        - schema:
            type: number
          in: query
          name: startTimestamp
          required: false
          description: >-
            Start of the query window as a Unix timestamp (seconds). Defaults
            based on granularity.
        - schema:
            type: number
          in: query
          name: endTimestamp
          required: false
          description: >-
            End of the query window as a Unix timestamp (seconds). Defaults to
            now.
        - schema:
            type: string
          in: query
          name: apiKey
          required: false
          description: >-
            Filter metrics by API key. Accepts a single value or a
            comma-separated list (e.g. key1,key2) — results include metrics
            matching any of the supplied keys. Maximum 50 keys.
        - schema:
            type: string
          in: header
          name: x-api-key
          required: false
          description: Integrator API key.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        apiKey:
                          type: string
                        timestamp:
                          type: string
                        endpoint:
                          type: string
                        statusCode:
                          type: number
                        errorCode:
                          type: string
                          description: >-
                            Only present on rows where statusCode is 400.
                            Contains the machine-readable error code (e.g.
                            AMOUNT_TOO_LOW).
                        count:
                          type: number

````