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

# Self-service usage, budget, and rate limit status

> Returns recorded usage, budget statuses, and rate limit statuses for the caller's effective user path (the path bound to the managed API key, or the user-path header for master-key callers).



## OpenAPI

````yaml /openapi.json get /v1/usage
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, Meta, 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:
  /v1/usage:
    get:
      tags:
        - usage
      summary: Self-service usage, budget, and rate limit status
      description: >-
        Returns recorded usage, budget statuses, and rate limit statuses for the
        caller's effective user path (the path bound to the managed API key, or
        the user-path header for master-key callers).
      parameters:
        - description: >-
            Inclusive window start (YYYY-MM-DD, UTC); defaults to 29 days before
            end_date
          name: start_date
          in: query
          schema:
            type: string
        - description: >-
            Inclusive window end (YYYY-MM-DD, UTC); defaults to today; the whole
            range may span at most 365 days
          name: end_date
          in: query
          schema:
            type: string
        - description: >-
            Window length ending today when no explicit dates are given (default
            30, max 365)
          name: days
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/server.usageStatusResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
      security:
        - BearerAuth: []
components:
  schemas:
    server.usageStatusResponse:
      type: object
      properties:
        budgets:
          type: array
          items:
            $ref: '#/components/schemas/server.usageStatusBudget'
        rate_limits:
          type: array
          items:
            $ref: '#/components/schemas/server.usageStatusRateLimit'
        server_time:
          type: string
        usage:
          $ref: '#/components/schemas/server.usageStatusSummary'
        user_path:
          type: string
    core.OpenAIErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/core.OpenAIErrorObject'
    server.usageStatusBudget:
      type: object
      properties:
        amount:
          type: number
        exceeded:
          type: boolean
        period_end:
          type: string
        period_label:
          type: string
        period_seconds:
          type: integer
        period_start:
          type: string
        remaining:
          type: number
        resets_in_seconds:
          type: integer
        spent:
          type: number
        usage_ratio:
          description: |-
            UsageRatio is spent/amount, deliberately unclamped: values above 1
            mean the budget is blown through.
          type: number
        user_path:
          type: string
    server.usageStatusRateLimit:
      type: object
      properties:
        exhausted:
          type: boolean
        in_flight:
          type: integer
        max_requests:
          type: integer
        max_tokens:
          type: integer
        period_label:
          type: string
        period_seconds:
          type: integer
        requests_remaining:
          type: integer
        requests_usage_ratio:
          description: >-
            The usage ratios are used/limit per dimension, present only when
            that

            limit exists and unclamped (token windows can overshoot past 1).
          type: number
        requests_used:
          type: integer
        resets_in_seconds:
          type: integer
        tokens_remaining:
          type: integer
        tokens_usage_ratio:
          type: number
        tokens_used:
          type: integer
        user_path:
          type: string
        window_end:
          type: string
        window_start:
          type: string
    server.usageStatusSummary:
      type: object
      properties:
        cache_write_input_tokens:
          type: integer
        cached_input_tokens:
          type: integer
        end_date:
          type: string
        rewrite_cost_saved:
          type: number
        rewrite_tokens_saved:
          description: |-
            Rewrite savings: prompt tokens request rewriters removed before the
            provider call, and the estimated input cost avoided (nil when no
            matched row had a priced savings estimate).
          type: integer
        start_date:
          type: string
        total_cost:
          type: number
        total_input_cost:
          type: number
        total_input_tokens:
          type: integer
        total_output_cost:
          type: number
        total_output_tokens:
          type: integer
        total_requests:
          type: integer
        total_tokens:
          type: integer
        uncached_input_tokens:
          type: integer
    core.OpenAIErrorObject:
      type: object
      required:
        - code
        - message
        - param
        - type
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
        param:
          type: string
          nullable: true
        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

````