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

# Get a two-dimension usage breakdown

> GoModel API reference for GET /admin/usage/breakdown: Get a two-dimension usage breakdown.



## OpenAPI

````yaml /openapi.json get /admin/usage/breakdown
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, Meta, OpenRouter, Kilo AI, DeepSeek, Z.ai, xAI,
    MiniMax, Xiaomi MiMo, OpenCode Go, Oracle, Ollama, Bailian). Drop-in
    OpenAI-compatible API.
  title: GoModel API
  contact: {}
  version: '1.0'
servers:
  - url: '{base_url}'
    description: Edit the base URL to point at your GoModel deployment.
    variables:
      base_url:
        default: http://localhost:8080
        description: Your GoModel deployment URL
security: []
paths:
  /admin/usage/breakdown:
    get:
      tags:
        - admin
      summary: Get a two-dimension usage breakdown
      description: >-
        Pivots the filtered usage by a row and an optional column dimension.
        Keys rank by the metric; those past limit fold into a trailing "other"
        key. Period keys follow interval and are never folded. A request with
        several labels counts once per label.
      parameters:
        - description: >-
            Row dimension: model, provider, user_path, label, endpoint,
            auth_key, period
          name: rows
          in: query
          required: true
          schema:
            type: string
        - description: >-
            Column dimension (same values, different from rows); omit or none
            for one column
          name: columns
          in: query
          schema:
            type: string
        - description: >-
            Ranking metric for the top-N cut: cost, tokens, requests (default
            cost)
          name: metric
          in: query
          schema:
            type: string
        - description: >-
            Keys kept per dimension before the rest fold into other (default 10,
            max 50)
          name: limit
          in: query
          schema:
            type: integer
        - description: >-
            Group user paths by their first N segments (0 keeps full paths, max
            16)
          name: user_path_depth
          in: query
          schema:
            type: integer
        - description: Number of days (default 30)
          name: days
          in: query
          schema:
            type: integer
        - description: Start date (YYYY-MM-DD)
          name: start_date
          in: query
          schema:
            type: string
        - description: End date (YYYY-MM-DD)
          name: end_date
          in: query
          schema:
            type: string
        - description: 'Period grouping: daily, weekly, monthly, yearly (default daily)'
          name: interval
          in: query
          schema:
            type: string
        - description: Filter by exact model names; repeat or comma-separate for several
          name: model
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: >-
            Filter by provider names or types; repeat or comma-separate for
            several
          name: provider
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: Filter by request labels (exact match); repeat for several
          name: label
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: >-
            Filter by exact request endpoints, e.g.
            /v1/chat/completions,/v1/messages; repeat or comma-separate for
            several
          name: endpoint
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: >-
            Filter by comma-separated operations, e.g.
            chat_completions,embeddings
          name: operation
          in: query
          schema:
            type: string
        - description: Filter by exact detected session ID
          name: session_id
          in: query
          schema:
            type: string
        - description: Filter by managed auth key IDs; repeat or comma-separate for several
          name: auth_key_id
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: Filter by tracked user path subtrees; repeat for several
          name: user_path
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
        - description: 'Cache mode filter: uncached, cached, all (default uncached)'
          name: cache_mode
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/usage.UsageBreakdown'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.GatewayError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.GatewayError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.GatewayError'
      security:
        - BearerAuth: []
components:
  schemas:
    usage.UsageBreakdown:
      type: object
      properties:
        cells:
          type: array
          items:
            $ref: '#/components/schemas/usage.BreakdownCell'
        column_dimension:
          $ref: '#/components/schemas/usage.BreakdownDimension'
        columns:
          type: array
          items:
            $ref: '#/components/schemas/usage.BreakdownKey'
        metric:
          $ref: '#/components/schemas/usage.BreakdownMetric'
        row_dimension:
          $ref: '#/components/schemas/usage.BreakdownDimension'
        rows:
          type: array
          items:
            $ref: '#/components/schemas/usage.BreakdownKey'
    core.GatewayError:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
        param:
          type: string
          nullable: true
        provider:
          type: string
        status_code:
          type: integer
        type:
          $ref: '#/components/schemas/core.ErrorType'
    usage.BreakdownCell:
      type: object
      properties:
        billed_cost:
          type: number
          nullable: true
        column:
          type: integer
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        requests:
          type: integer
        row:
          type: integer
        total_cost:
          type: number
          nullable: true
        total_tokens:
          type: integer
    usage.BreakdownDimension:
      type: string
      enum:
        - ''
        - model
        - provider
        - user_path
        - label
        - endpoint
        - auth_key
        - period
      x-enum-varnames:
        - BreakdownNone
        - BreakdownModel
        - BreakdownProvider
        - BreakdownUserPath
        - BreakdownLabel
        - BreakdownEndpoint
        - BreakdownAuthKey
        - BreakdownPeriod
    usage.BreakdownKey:
      type: object
      properties:
        folded:
          type: integer
        key:
          type: string
        other:
          type: boolean
    usage.BreakdownMetric:
      type: string
      enum:
        - cost
        - tokens
        - requests
      x-enum-varnames:
        - BreakdownMetricCost
        - BreakdownMetricTokens
        - BreakdownMetricRequests
    core.ErrorType:
      type: string
      enum:
        - provider_error
        - rate_limit_error
        - invalid_request_error
        - authentication_error
        - not_found_error
        - permission_error
        - internal_error
      x-enum-varnames:
        - ErrorTypeProvider
        - ErrorTypeRateLimit
        - ErrorTypeInvalidRequest
        - ErrorTypeAuthentication
        - ErrorTypeNotFound
        - ErrorTypePermission
        - ErrorTypeInternal
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.