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

# Get usage and cost

> Calls, tokens and cost for the calling organization over a window of at most 31 days, or for one of its projects with `project_uuid`, optionally grouped by API key, model, provider or project and split into hourly or daily UTC buckets. The figures are the ones the platform's usage pages show. `count`, the token sums and `cost` cover model calls; `evals_cost` and `guards_cost` are what evaluations and guard or routing checks cost, and `total_cost` is all three. Grouped by `api_key_id`, each row carries the key's id and, while the key exists, its name; calls made without a key have neither. Grouped by `project`, each row carries the project's UUID and name. Grouped totals are ranked by `total_cost`, most first. Web search surcharges are not included. Requires the `usage:read` scope.



## OpenAPI

````yaml get /management/v1/usage
openapi: 3.1.0
info:
  description: Schema-driven generative API that orchestrates LLM-powered workflows.
  title: Task API
  version: 3.0.0
servers:
  - description: Production
    url: https://api.opper.ai
  - description: Local development
    url: http://localhost:8080
security:
  - BearerAuth: []
tags:
  - description: Schema-driven function management and execution
    name: Functions
  - description: OpenAI-compatible chat completions
    name: Chat
  - description: OpenAI Responses API compatible endpoint
    name: Responses
  - description: Google-compatible interactions endpoint
    name: Interactions
  - description: Model registry and capabilities
    name: Models
  - description: Synchronous image generation
    name: Images
  - description: Text-to-speech and speech-to-text
    name: Audio
  - description: Asynchronous video generation
    name: Videos
  - description: Reusable file storage for media inputs and generated outputs
    name: Files
  - description: Async generation status and downloads
    name: Artifacts
  - description: OpenAI-compatible embeddings
    name: Embeddings
  - description: Recorded HTTP request/response generations
    name: Generations
  - description: System health and status
    name: System
  - description: Roundtable endpoint — fan out a query to multiple LLMs and combine results
    name: Roundtable
  - description: Web search, fetch, and other utility tools
    name: Tools
  - description: Caller identity, credits, and usage
    name: Account
  - description: >-
      Programmatic project and API-key management. Authenticates with an
      `op-mak-…` management token; available on the control_plane and enterprise
      plans.
    name: Management
paths:
  /management/v1/usage:
    get:
      tags:
        - Management
      summary: Get usage and cost
      description: >-
        Calls, tokens and cost for the calling organization over a window of at
        most 31 days, or for one of its projects with `project_uuid`, optionally
        grouped by API key, model, provider or project and split into hourly or
        daily UTC buckets. The figures are the ones the platform's usage pages
        show. `count`, the token sums and `cost` cover model calls; `evals_cost`
        and `guards_cost` are what evaluations and guard or routing checks cost,
        and `total_cost` is all three. Grouped by `api_key_id`, each row carries
        the key's id and, while the key exists, its name; calls made without a
        key have neither. Grouped by `project`, each row carries the project's
        UUID and name. Grouped totals are ranked by `total_cost`, most first.
        Web search surcharges are not included. Requires the `usage:read` scope.
      operationId: getManagementUsage
      parameters:
        - description: >-
            Inclusive RFC 3339 start. Defaults to seven days before `to`. At
            most 31 days before `to`.
          in: query
          name: from
          schema:
            format: date-time
            type: string
        - description: Exclusive RFC 3339 end. Defaults to now.
          in: query
          name: to
          schema:
            format: date-time
            type: string
        - description: '`none` (default), `api_key_id`, `model`, `provider` or `project`.'
          in: query
          name: group_by
          schema:
            default: none
            enum:
              - none
              - api_key_id
              - model
              - provider
              - project
            type: string
        - description: >-
            `none` (default) for totals over the window, `hour` or `day` for a
            UTC series.
          in: query
          name: bucket
          schema:
            default: none
            enum:
              - none
              - hour
              - day
            type: string
        - description: >-
            Read one of the organization's projects instead of the whole
            organization.
          in: query
          name: project_uuid
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      properties:
                        api_key_id:
                          type: integer
                        api_key_name:
                          type: string
                        bucket:
                          description: >-
                            Start of the UTC hour or day; absent when
                            bucket=none.
                          format: date-time
                          type: string
                        cache_creation_tokens:
                          type: integer
                        cache_read_tokens:
                          type: integer
                        cache_savings:
                          type: number
                        completion_tokens:
                          type: integer
                        cost:
                          description: USD, model calls.
                          type: number
                        count:
                          description: Model calls.
                          type: integer
                        duration_ms_sum:
                          type: integer
                        errors_other:
                          type: integer
                        errors_policy:
                          type: integer
                        errors_provider:
                          type: integer
                        errors_rate_limited:
                          type: integer
                        evals_cost:
                          description: USD, evaluations.
                          type: number
                        group:
                          description: >-
                            The group's key: the API key id, model, provider or
                            project UUID. Absent for calls with no value for the
                            grouping.
                          type: string
                        guards_cost:
                          description: USD, guard and routing checks.
                          type: number
                        last_called_at:
                          description: Grouped by project only.
                          format: date-time
                          type: string
                        project_name:
                          type: string
                        project_uuid:
                          format: uuid
                          type: string
                        prompt_tokens:
                          type: integer
                        total_cost:
                          description: USD, cost + evals_cost + guards_cost.
                          type: number
                        total_tokens:
                          type: integer
                      type: object
                    type: array
                  meta:
                    properties:
                      bucket:
                        type: string
                      currency:
                        example: USD
                        type: string
                      from:
                        format: date-time
                        type: string
                      group_by:
                        type: string
                      project_uuid:
                        description: The project read, when `project_uuid` was given.
                        format: uuid
                        type: string
                      to:
                        format: date-time
                        type: string
                      total_count:
                        type: integer
                    type: object
                type: object
          description: Successful response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '401':
          description: Unauthorized - missing or invalid API key
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                  required_scope:
                    description: Present on the scope refusal.
                    type: string
                type: object
          description: >-
            The token lacks the scope this endpoint requires (`required_scope`
            is returned). Presenting a runtime `op-…` key instead of a
            management `op-mak-…` token also lands here.
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                type: object
          description: '`project_uuid` names no project of the calling organization.'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      security:
        - ManagementBearer: []
components:
  schemas:
    ErrorResponse:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              description: Any value
            message:
              type: string
          required:
            - code
            - message
          type: object
        meta:
          type: object
      required:
        - error
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http
    ManagementBearer:
      bearerFormat: Management API Key
      description: >-
        Management API authentication. Pass an `op-mak-…` management token as a
        Bearer token. Runtime `op-…` API keys are rejected with 403 — they
        belong on the data-plane endpoints. Mint a management key from the
        platform UI under Settings → API keys.
      scheme: bearer
      type: http

````

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