> ## Documentation Index
> Fetch the complete documentation index at: https://gomodel-build-canonical-module-path.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get usage breakdown by request label

> Returns per-label token and cost aggregates. Requests carrying
several labels count once per label, so rows overlap and do
not sum to the period totals. Unlabelled requests are omitted.



## OpenAPI

````yaml /openapi.json get /admin/usage/labels
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, OpenRouter, 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/labels:
    get:
      tags:
        - admin
      summary: Get usage breakdown by request label
      description: |-
        Returns per-label token and cost aggregates. Requests carrying
        several labels count once per label, so rows overlap and do
        not sum to the period totals. Unlabelled requests are omitted.
      parameters:
        - 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: Filter by exact model name
          name: model
          in: query
          schema:
            type: string
        - description: Filter by provider name or provider type
          name: provider
          in: query
          schema:
            type: string
        - description: Filter by request label (exact match)
          name: label
          in: query
          schema:
            type: string
        - description: Filter by tracked user path subtree
          name: user_path
          in: query
          schema:
            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:
                type: array
                items:
                  $ref: '#/components/schemas/usage.LabelUsage'
        '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'
      security:
        - BearerAuth: []
components:
  schemas:
    usage.LabelUsage:
      type: object
      properties:
        input_cost:
          type: number
          nullable: true
        input_tokens:
          type: integer
        label:
          type: string
        output_cost:
          type: number
          nullable: true
        output_tokens:
          type: integer
        requests:
          type: integer
        total_cost:
          type: number
          nullable: true
        total_tokens:
          type: integer
    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'
    core.ErrorType:
      type: string
      enum:
        - provider_error
        - rate_limit_error
        - invalid_request_error
        - authentication_error
        - not_found_error
      x-enum-varnames:
        - ErrorTypeProvider
        - ErrorTypeRateLimit
        - ErrorTypeInvalidRequest
        - ErrorTypeAuthentication
        - ErrorTypeNotFound
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````