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

# Get org usage

> Tallies model token usage and provider-reported cost across every agent in the organization, broken down by configured model. Optionally limits the tally to a time window or to a subset of projects.



## OpenAPI

````yaml /api-reference/openapi.yaml get /orgs/{orgID}/usage
openapi: 3.1.2
info:
  title: Omnara API
  version: 0.1.0
  description: Public HTTP API contract for Omnara.
servers:
  - url: https://api.omnara.com/v1
    description: Hosted Omnara
  - url: /api/v1
    description: Self-hosted Omnara, relative to the deployment origin
security:
  - bearerAuth: []
  - browserSessionCookie: []
tags:
  - name: Agents
    description: >-
      Launch agents, send inputs, manage the input backlog, and work with tool
      calls.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/agents/overview
  - name: Interactions
    description: List and resolve the approvals and questions that pause an agent.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/events/interactions
  - name: Actors
    description: Attribute agent inputs and interaction responses to external users.
    externalDocs:
      description: Guide
      url: >-
        https://docs.omnara.com/events/sending-input#who-said-that-actors-and-attribution
  - name: Events
    description: Read or stream the agent timeline, list turns, and download artifacts.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/events/streaming
  - name: Configs and Profiles
    description: >-
      Create agent configs, manage reusable launch profiles, and set up
      integrations.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/agents/configuration
  - name: Models
    description: Configure model providers and models, and grant projects access to them.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/organization/model-providers
  - name: Machines
    description: Register machines, control project access, and manage daemon tokens.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/machines/connect
  - name: Machine Pools
    description: Define machine pools and grant projects access to them.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/machines/pools
  - name: Secrets
    description: >-
      Manage secret ownership and versions, and inspect or grant project
      availability.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/organization/secrets
  - name: Skills
    description: Manage versioned skill ownership and load skill instructions on demand.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/tools/skills
  - name: Organizations and Projects
    description: Create organizations and projects and manage membership.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/organization/members
  - name: Users and API Keys
    description: >-
      The authenticated user, personal and organization API keys, and
      invitations.
    externalDocs:
      description: Guide
      url: https://docs.omnara.com/api/authentication
  - name: Machine Daemon
    description: Routes the Omnara machine daemon uses to connect a machine.
paths:
  /orgs/{orgID}/usage:
    parameters:
      - name: orgID
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/OrganizationID'
    get:
      tags:
        - Organizations and Projects
      summary: Get org usage
      description: >-
        Tallies model token usage and provider-reported cost across every agent
        in the organization, broken down by configured model. Optionally limits
        the tally to a time window or to a subset of projects.
      operationId: getOrgUsage
      parameters:
        - $ref: '#/components/parameters/UsageSince'
        - $ref: '#/components/parameters/UsageUntil'
        - $ref: '#/components/parameters/UsageIncludeProjectIDs'
        - $ref: '#/components/parameters/UsageExcludeProjectIDs'
      responses:
        '200':
          description: Usage totals for the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReport'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    OrganizationID:
      type: string
      pattern: ^org_[a-z2-7]{26}$
    UsageReport:
      type: object
      additionalProperties: false
      required:
        - totals
        - by_model
      properties:
        totals:
          $ref: '#/components/schemas/UsageTotals'
        by_model:
          type: array
          description: >-
            Per-model rows ordered by provider config name, configured model
            name, then provider model slug. Models with distinct provider slugs
            across revisions appear once per slug.
          items:
            $ref: '#/components/schemas/ModelUsageTotals'
    ProjectID:
      type: string
      pattern: ^proj_[a-z2-7]{26}$
    UsageTotals:
      type: object
      additionalProperties: false
      required:
        - model_calls
        - tokens
        - cost
      properties:
        model_calls:
          type: integer
          format: int64
          minimum: 0
          description: Model calls that recorded token usage or a provider-reported cost.
        tokens:
          $ref: '#/components/schemas/UsageTokenTotals'
        cost:
          $ref: '#/components/schemas/UsageCostTotals'
    ModelUsageTotals:
      type: object
      additionalProperties: false
      required:
        - model
        - model_calls
        - tokens
        - cost
      properties:
        model:
          $ref: '#/components/schemas/UsageModel'
        model_calls:
          type: integer
          format: int64
          minimum: 0
        tokens:
          $ref: '#/components/schemas/UsageTokenTotals'
        cost:
          $ref: '#/components/schemas/UsageCostTotals'
    Error:
      type: object
      additionalProperties: false
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Human-readable error message. Do not match on it programmatically.
        issues:
          type: array
          description: >-
            Field-level problems when a submitted document (such as an agent
            config source) failed validation. Absent for errors that are not
            about a specific field.
          items:
            $ref: '#/components/schemas/AgentConfigErrorIssue'
        code:
          type: string
          description: Stable error code for programmatic handling.
          enum:
            - invalid_request
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - gone
            - request_too_large
            - unsupported_media_type
            - unprocessable
            - rate_limited
            - internal_error
            - upstream_error
            - service_unavailable
            - idempotency_key_conflict
            - state_transition_conflict
            - managed_work_admission_denied
            - pending_work
            - not_wake_capable
            - daemon_runtime_unregistered
            - validation_failed
            - csrf_check_failed
            - authentication_unavailable
    ClientErrorCode:
      type: string
      description: >-
        Stable error code carried by 4XX statuses. Subset of the Error code enum
        whose statuses are client errors.
      enum:
        - invalid_request
        - validation_failed
        - unauthorized
        - forbidden
        - csrf_check_failed
        - not_found
        - conflict
        - idempotency_key_conflict
        - state_transition_conflict
        - pending_work
        - not_wake_capable
        - gone
        - daemon_runtime_unregistered
        - request_too_large
        - unsupported_media_type
        - unprocessable
        - rate_limited
    ServerErrorCode:
      type: string
      description: >-
        Stable error code carried by 5XX statuses. Subset of the Error code enum
        whose statuses are server errors.
      enum:
        - internal_error
        - upstream_error
        - service_unavailable
        - authentication_unavailable
    UsageTokenTotals:
      type: object
      additionalProperties: false
      description: >-
        Summed token counts across the tallied model calls. Input totals are the
        sum of uncached, cache-read, and cache-write tokens; output totals
        include reasoning tokens.
      required:
        - input_tokens_total
        - uncached_input_tokens
        - cache_read_input_tokens
        - cache_write_input_tokens
        - output_tokens_total
        - reasoning_output_tokens
      properties:
        input_tokens_total:
          type: integer
          format: int64
          minimum: 0
        uncached_input_tokens:
          type: integer
          format: int64
          minimum: 0
        cache_read_input_tokens:
          type: integer
          format: int64
          minimum: 0
        cache_write_input_tokens:
          type: integer
          format: int64
          minimum: 0
        output_tokens_total:
          type: integer
          format: int64
          minimum: 0
        reasoning_output_tokens:
          type: integer
          format: int64
          minimum: 0
    UsageCostTotals:
      type: object
      additionalProperties: false
      required:
        - provider_reported_usd
        - model_calls_with_reported_cost
      properties:
        provider_reported_usd:
          type: string
          description: >-
            Exact decimal sum in USD of the costs the provider reported for the
            tallied model calls. Calls whose provider reported no cost
            contribute nothing; compare model_calls_with_reported_cost against
            model_calls to see how complete the figure is.
          pattern: ^(0|[1-9][0-9]*)(\.[0-9]+)?$
        model_calls_with_reported_cost:
          type: integer
          format: int64
          minimum: 0
    UsageModel:
      type: object
      additionalProperties: false
      required:
        - configured_model_id
        - name
        - provider_model_slug
        - model_provider_config_id
        - model_provider_config_name
      properties:
        configured_model_id:
          $ref: '#/components/schemas/ConfiguredModelID'
        name:
          $ref: '#/components/schemas/ResourceName'
          description: >-
            Configured model name, resolved even if the model has since been
            deleted.
        provider_model_slug:
          type: string
        model_provider_config_id:
          $ref: '#/components/schemas/ModelProviderConfigID'
        model_provider_config_name:
          $ref: '#/components/schemas/ResourceName'
    AgentConfigErrorIssue:
      type: object
      additionalProperties: false
      required:
        - path
        - message
      properties:
        path:
          type: string
          description: >-
            JSON Pointer (RFC 6901) to the offending field in the submitted
            document. An empty string refers to the whole document.
        message:
          type: string
          description: Human-readable description of the problem with this field.
        line:
          type: integer
          minimum: 1
          description: >-
            1-based line of the offending field in the submitted source, when it
            can be located.
        column:
          type: integer
          minimum: 1
          description: >-
            1-based column of the offending field in the submitted source, when
            it can be located.
    ConfiguredModelID:
      type: string
      pattern: ^mdl_[a-z2-7]{26}$
    ResourceName:
      type: string
      minLength: 1
      maxLength: 64
      x-omnara-unicode-normalization: NFC
      description: >-
        Human-readable name. Spaces and punctuation are allowed; leading or
        trailing whitespace and invisible or control characters are not.
    ModelProviderConfigID:
      type: string
      pattern: ^mpc_[a-z2-7]{26}$
  parameters:
    UsageSince:
      name: since
      in: query
      required: false
      schema:
        type: string
        format: date-time
      description: >-
        Only tally model calls started at or after this instant. Omit to start
        from the earliest recorded call.
    UsageUntil:
      name: until
      in: query
      required: false
      schema:
        type: string
        format: date-time
      description: >-
        Only tally model calls started before this instant. Must be later than
        `since` when both are given. Omit to include calls up to now.
    UsageIncludeProjectIDs:
      name: include_project_ids
      in: query
      required: false
      schema:
        type: array
        minItems: 1
        maxItems: 100
        items:
          $ref: '#/components/schemas/ProjectID'
      description: >-
        Only tally model calls from these projects. Cannot be combined with
        `exclude_project_ids`.
    UsageExcludeProjectIDs:
      name: exclude_project_ids
      in: query
      required: false
      schema:
        type: array
        minItems: 1
        maxItems: 100
        items:
          $ref: '#/components/schemas/ProjectID'
      description: >-
        Tally model calls from every project except these. Cannot be combined
        with `include_project_ids`.
  responses:
    Unauthorized:
      description: Authentication is required or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The authenticated principal is not authorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found or is not visible.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: The service dependency required to satisfy the request is unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ClientError:
      description: >-
        Any other client error. The body carries the shared Error envelope
        restricted to client error codes; statuses with a dedicated response
        above are documented precisely.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - error
              - code
            properties:
              error:
                type: string
                description: >-
                  Human-readable error message. Do not match on it
                  programmatically.
              code:
                $ref: '#/components/schemas/ClientErrorCode'
    ServerError:
      description: >-
        Any other server error. The body carries the shared Error envelope
        restricted to server error codes.
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - error
              - code
            properties:
              error:
                type: string
                description: >-
                  Human-readable error message. Do not match on it
                  programmatically.
              code:
                $ref: '#/components/schemas/ServerErrorCode'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Omnara personal or organization access token
      description: An opaque Omnara personal or organization bearer token.
    browserSessionCookie:
      type: apiKey
      in: cookie
      name: __Host-omnara_session
      description: >-
        Browser session cookie. HTTPS deployments use __Host-omnara_session;
        local HTTP development uses omnara_session.

````