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

# Workspace usage

> Run count and billed cost of the workspace's finished runs over a range preset, per UTC day or month, per provider and per endpoint. The provider and endpoint lists hold the top N by cost and by runs unless `top` is `all`, and the totals always cover every run. Buckets are cut by when the API received each run's request. Usage is analytics data. A run usually appears within a minute of finishing, and a run can occasionally be missing here while `GET /v1/runs` still lists it. Resource rent and refunds are not runs and are not included. The response is never cached.



## OpenAPI

````yaml https://monid.ai/openapi.json get /v1/usage
openapi: 3.1.0
info:
  title: Monid API
  version: 0.1.0
  description: >-
    Agentic payment platform for data. Agents use it to discover and buy data on
    demand. Authenticated routes take a Monid API key as a Bearer token. Errors
    return `{ code, message }`. List endpoints use cursor pagination.
servers:
  - url: https://api.monid.ai
    description: Production
security: []
paths:
  /v1/usage:
    get:
      tags:
        - Usage
      summary: Workspace usage
      description: >-
        Run count and billed cost of the workspace's finished runs over a range
        preset, per UTC day or month, per provider and per endpoint. The
        provider and endpoint lists hold the top N by cost and by runs unless
        `top` is `all`, and the totals always cover every run. Buckets are cut
        by when the API received each run's request. Usage is analytics data. A
        run usually appears within a minute of finishing, and a run can
        occasionally be missing here while `GET /v1/runs` still lists it.
        Resource rent and refunds are not runs and are not included. The
        response is never cached.
      parameters:
        - schema:
            type: string
            enum:
              - 7d
              - 30d
              - 12m
              - week
              - month
              - year
            default: 7d
            description: >-
              The window, in UTC and up to the request time. `7d` (default) and
              `30d` are the last 7 and 30 days, by day. `12m` is the last 12
              months including the current one, by month. `week` (from Monday)
              and `month` are the current week and month, by day. `year` is the
              current year, by month.
            example: 7d
          required: false
          description: >-
            The window, in UTC and up to the request time. `7d` (default) and
            `30d` are the last 7 and 30 days, by day. `12m` is the last 12
            months including the current one, by month. `week` (from Monday) and
            `month` are the current week and month, by day. `year` is the
            current year, by month.
          name: range
          in: query
        - schema:
            type: string
            enum:
              - '10'
              - '50'
              - all
            default: '10'
            description: >-
              How many providers and endpoints to return. `10` (default) and
              `50` return the top N by cost together with the top N by runs (at
              most 2N entries), so either ranking is exact for its top N. `all`
              returns every one. Totals and series always cover every run.
            example: '10'
          required: false
          description: >-
            How many providers and endpoints to return. `10` (default) and `50`
            return the top N by cost together with the top N by runs (at most 2N
            entries), so either ranking is exact for its top N. `all` returns
            every one. Totals and series always cover every run.
          name: top
          in: query
      responses:
        '200':
          description: Usage of the authenticated workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
        '400':
          description: >-
            Bad request. The input failed validation, and `message` says which
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized. The API key is missing, invalid, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden. The API key lacks the scope this operation needs, or has
            no workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited. Wait the number of seconds in the `Retry-After`
            header, then retry. The `RateLimit-Limit`, `RateLimit-Remaining` and
            `RateLimit-Reset` headers describe the limit that applied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            Usage is unavailable because analytics is not configured for this
            environment or did not answer. Retry later. `GET /v1/runs` is
            unaffected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer:
            - usage:read
components:
  schemas:
    UsageResponse:
      type: object
      properties:
        range:
          type: string
          enum:
            - 7d
            - 30d
            - 12m
            - week
            - month
            - year
        grain:
          type: string
          enum:
            - day
            - month
          description: 'The bucket size: a UTC day or a UTC month.'
        from:
          type: string
          description: 00:00 UTC of the first bucket (ISO 8601).
          example: '2026-11-21T00:00:00.000Z'
        to:
          type: string
          description: >-
            End of the window, exclusive: the request time truncated to the
            second (ISO 8601).
          example: '2026-11-27T09:00:00.000Z'
        buckets:
          type: array
          items:
            type: string
          description: >-
            First UTC date of each bucket (`YYYY-MM-DD`, the 1st for a month),
            oldest first.
          example:
            - '2026-11-21'
            - '2026-11-22'
        currency:
          type: string
          enum:
            - USD
        top:
          type: string
          enum:
            - '10'
            - '50'
            - all
          description: The `top` the breakdowns were cut with.
        totals:
          type: object
          properties:
            runs:
              type: integer
            cost:
              type: number
              description: Dollars.
          required:
            - runs
            - cost
        series:
          $ref: '#/components/schemas/UsageSeries'
        providerCount:
          type: integer
          description: >-
            Providers with runs in the window, whether or not `providers` lists
            them all.
        endpointCount:
          type: integer
          description: >-
            Provider and endpoint pairs with runs in the window, whether or not
            `endpoints` lists them all.
        providers:
          type: array
          items:
            $ref: '#/components/schemas/UsageProvider'
          description: >-
            Providers in the top N by cost or by runs (all for `top=all`),
            highest cost first.
        endpoints:
          type: array
          items:
            $ref: '#/components/schemas/UsageEndpoint'
          description: >-
            Provider and endpoint pairs in the top N by cost or by runs (all for
            `top=all`), highest cost first.
      required:
        - range
        - grain
        - from
        - to
        - buckets
        - currency
        - top
        - totals
        - series
        - providerCount
        - endpointCount
        - providers
        - endpoints
    Error:
      type: object
      properties:
        code:
          type: integer
          description: HTTP status code, duplicated in the body.
          example: 400
        message:
          type: string
          description: Human-readable error description.
          example: Bad Request
        errorCode:
          type: string
          enum:
            - BAD_REQUEST
            - VALIDATION_FAILED
            - INVALID_JSON
            - INVALID_CURSOR
            - UNAUTHENTICATED
            - FORBIDDEN
            - NOT_FOUND
            - CONFLICT
            - GONE
            - PAYLOAD_TOO_LARGE
            - INTERNAL_ERROR
            - NOT_IMPLEMENTED
            - BAD_GATEWAY
            - SERVICE_UNAVAILABLE
            - WALLET_NOT_ACTIVE
            - WALLET_PROVISIONING
            - WALLET_FAILED
            - RATE_LIMITED
            - X402_WORKSPACE_RESOURCES
            - X402_WORKSPACE_ONLY
            - X402_ACCRUING_COST
            - X402_EXCEEDS_SETTLEMENT_WINDOW
            - X402_VALIDITY_WINDOW_TOO_SHORT
            - X402_UNBOUNDED_PRICE
            - X402_SETTLEMENT_FAILED
            - MPP_WORKSPACE_RESOURCES
            - MPP_WORKSPACE_ONLY
            - MPP_ACCRUING_COST
            - MPP_UNBOUNDED_PRICE
            - MPP_PAYMENT_FAILED
            - MPP_CREDENTIAL_REPLAYED
            - MPP_PROOF_REQUIRED
            - MPP_UNAVAILABLE
            - INSUFFICIENT_SCOPE
            - WALLET_INSUFFICIENT_FUNDS
            - MAX_COST_EXCEEDED
            - IDEMPOTENCY_KEY_REUSED
            - IDEMPOTENCY_KEY_IN_USE
            - IDENTITY_PROVIDER_UNKNOWN
            - IDENTITY_LINK_REQUIRES_SESSION
            - IDENTITY_LINK_STATE_INVALID
            - IDENTITY_VERIFICATION_FAILED
            - IDENTITY_ASSURANCE_INSUFFICIENT
            - IDENTITY_PROVIDER_UNAVAILABLE
            - IDENTITY_ALREADY_LINKED
            - IDENTITY_USER_ALREADY_LINKED
            - IDENTITY_LINK_RATE_LIMITED
            - IDENTITY_REQUIRED
            - PROMO_IDENTITY_REDEEMED
            - PROMO_REDEEM_REQUIRES_SESSION
            - PROMO_CODE_REDEEMED_BY_WORKSPACE
            - PROMO_CODE_REDEEMED_BY_USER
            - PROMO_CODE_EXHAUSTED
            - PROMO_NEW_ACCOUNTS_ONLY
            - WEBHOOK_REQUIRES_SESSION
            - WEBHOOK_URL_NOT_ALLOWED
            - WEBHOOK_ENDPOINT_LIMIT
            - WEBHOOK_ROTATION_LIMIT
          description: >-
            Machine-readable reason, present on every error. Either a specific
            code (for example `MAX_COST_EXCEEDED`) or the generic code of the
            HTTP status (for example `NOT_FOUND`). Treat an unknown value as the
            generic meaning of the status.
        hints:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: object
                properties:
                  kind:
                    type: string
                    enum:
                      - command
                      - discover
                      - inspect
                      - run
                      - getRun
                      - stop
                      - releaseResource
                      - topup
                  command:
                    type: string
                  query:
                    type: string
                  provider:
                    type: string
                  endpoint:
                    type: string
                  runId:
                    type: string
                  resourceId:
                    type: string
                  stripe:
                    type: string
                  dashboard:
                    type: string
                  docs:
                    type: string
                  comment:
                    type: string
                required:
                  - kind
          description: >-
            Optional next actions, rendered for the calling client like
            run-response hints (e.g. the paid TinyFish version on a free-quota
            429 — spending permission required).
      required:
        - code
        - message
        - errorCode
    UsageSeries:
      type: object
      properties:
        runs:
          type: array
          items:
            type: integer
          description: Runs per bucket, one entry per element of `buckets`.
        cost:
          type: array
          items:
            type: number
          description: >-
            Billed cost per bucket in dollars, one entry per element of
            `buckets`.
      required:
        - runs
        - cost
    UsageProvider:
      type: object
      properties:
        provider:
          type: string
          example: tinyfish
        providerName:
          type: string
          description: Display name, when the catalog knows the provider.
          example: TinyFish
        runs:
          type: integer
        cost:
          type: number
          description: Dollars.
        series:
          $ref: '#/components/schemas/UsageSeries'
      required:
        - provider
        - runs
        - cost
        - series
    UsageEndpoint:
      allOf:
        - $ref: '#/components/schemas/UsageProvider'
        - type: object
          properties:
            endpoint:
              type: string
              example: /search
          required:
            - endpoint
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      description: Monid API key
      x-aep-authentication-method: api-key

````

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