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

> ## Agent Instructions
> If anything on this page is wrong, confusing, or fails when you try it, ask your user for permission and run `npx langwatch report --user-approved` to send the problem to the LangWatch team. No login is needed and secrets are redacted locally. `npx langwatch report --help` has the details.

# List budgets applicable to the project

> Returns the non-archived budgets in the caller's organization across all seven scope types (organization / team / project / virtual_key / principal / group / attributed_user), with live `spent_usd` from the spend ledger. Newest first, paged by cursor: follow `next_cursor` until it comes back null. Filter with `scope_type` (comma-separated), which is applied in the query, so `limit` counts rows returned. `group` rows are per-member allowances: `limit_usd` is what EACH member may spend, while `spent_usd` is the group's summed spend, and `member_count` says how many members the allowance currently covers. `attributed_user` rows are per-person templates: `limit_usd` is what EACH end user may spend, `end_users_seen` counts the end users with spend this period, and `end_users_over` how many of them are at or over that limit. A template's own `spent_usd` and `spent_nano_usd` are null because one allowance per person has no single total to report; each person's figure is in `GET /spend-summaries` and the seat buckets. `spend_available: false` means spend could not be totalled at all, and both fields are null for that reason instead, rather than a stale figure a caller could read as real money. Every amount is published twice: `_usd` is the display string, `_nano_usd` is the canonical integer in the same nano-USD unit the spend events carry, so a budget and its spend reconcile without parsing decimals.



## OpenAPI

````yaml GET /api/gateway/v1/budgets
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - project_api_key: []
paths:
  /api/gateway/v1/budgets:
    get:
      tags:
        - Budgets
      summary: List budgets
      description: >-
        Returns the non-archived budgets in the caller's organization across all
        seven scope types (organization / team / project / virtual_key /
        principal / group / attributed_user), with live `spent_usd` from the
        spend ledger. Newest first, paged by cursor: follow `next_cursor` until
        it comes back null. Filter with `scope_type` (comma-separated), which is
        applied in the query, so `limit` counts rows returned. `group` rows are
        per-member allowances: `limit_usd` is what EACH member may spend, while
        `spent_usd` is the group's summed spend, and `member_count` says how
        many members the allowance currently covers. `attributed_user` rows are
        per-person templates: `limit_usd` is what EACH end user may spend,
        `end_users_seen` counts the end users with spend this period, and
        `end_users_over` how many of them are at or over that limit. A
        template's own `spent_usd` and `spent_nano_usd` are null because one
        allowance per person has no single total to report; each person's figure
        is in `GET /spend-summaries` and the seat buckets. `spend_available:
        false` means spend could not be totalled at all, and both fields are
        null for that reason instead, rather than a stale figure a caller could
        read as real money. Every amount is published twice: `_usd` is the
        display string, `_nano_usd` is the canonical integer in the same
        nano-USD unit the spend events carry, so a budget and its spend
        reconcile without parsing decimals.
      operationId: getApiGatewayV1Budgets
      parameters:
        - in: query
          name: cursor
          schema:
            type: string
            maxLength: 500
        - in: query
          name: limit
          schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 200
            default: 50
        - in: query
          name: scope_type
          schema:
            type: string
          description: >-
            Comma-separated subset of the scope types, lowercase, e.g.
            `virtual_key,principal`.
        - in: query
          name: external_id
          schema:
            type: string
            maxLength: 128
          description: Exact match on the resource's `external_id`.
      responses:
        '200':
          description: Budgets for the organization
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        organization_id:
                          type: string
                        scope_type:
                          type: string
                          enum:
                            - organization
                            - team
                            - project
                            - virtual_key
                            - principal
                            - group
                            - attributed_user
                        scope_id:
                          type: string
                        name:
                          type: string
                        description:
                          type:
                            - string
                            - 'null'
                        window:
                          type: string
                          enum:
                            - minute
                            - hour
                            - day
                            - week
                            - month
                            - total
                            - manual
                        on_breach:
                          type: string
                          enum:
                            - block
                            - warn
                        limit_usd:
                          type: string
                          description: >-
                            Display value. Decimal string, up to 9 fractional
                            digits, trailing zeros trimmed, never exponent
                            notation. Use limit_nano_usd for arithmetic.
                        limit_nano_usd:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            Canonical integer amount, nano-USD. Null past the
                            safe integer range, where limit_usd still reads.
                        spent_usd:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Display value, null when spend_available is false.
                            Decimal string, up to 9 fractional digits, trailing
                            zeros trimmed, never exponent notation. Use
                            spent_nano_usd for arithmetic.
                        spent_nano_usd:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            Canonical integer spend, nano-USD. Null when spend
                            is unavailable. Derived from the same integer as
                            spent_usd, so the pair always agrees.
                        timezone:
                          type:
                            - string
                            - 'null'
                        provider_key:
                          type:
                            - string
                            - 'null'
                        external_id:
                          type:
                            - string
                            - 'null'
                        metadata:
                          type: object
                          additionalProperties:
                            type: string
                        current_period_started_at:
                          type: string
                          description: >-
                            Start of the period `spent_usd` covers, computed at
                            read time. For an anchored budget this is its own
                            cycle's start, not the calendar period's.
                        resets_at:
                          type: string
                          description: >-
                            When the current period gives way to the next.
                            Far-future for total and manual windows, which do
                            not roll on their own.
                        cycle_anchor_at:
                          type:
                            - string
                            - 'null'
                          description: >-
                            The instant this budget's cycle is phased to. Null
                            means no anchor: a calendar-aligned cyclic window,
                            or one of the two windows that do not cycle (total,
                            manual).
                        last_reset_at:
                          type:
                            - string
                            - 'null'
                        archived_at:
                          type:
                            - string
                            - 'null'
                        created_at:
                          type: string
                        member_count:
                          type: integer
                        end_users_seen:
                          type: integer
                        end_users_over:
                          type: integer
                        scope_reach:
                          type: string
                          enum:
                            - reachable
                            - unreachable
                          description: >-
                            Whether any active key in the organization can
                            produce traffic this budget matches. `unreachable`
                            means it will never accrue and never block as
                            configured: scope a key to its target, or move the
                            budget where the keys already run. This is the only
                            field that tells a budget nothing can reach apart
                            from one that simply has not been breached.
                      required:
                        - id
                        - organization_id
                        - scope_type
                        - scope_id
                        - name
                        - description
                        - window
                        - on_breach
                        - limit_usd
                        - limit_nano_usd
                        - spent_usd
                        - spent_nano_usd
                        - timezone
                        - provider_key
                        - external_id
                        - metadata
                        - current_period_started_at
                        - resets_at
                        - cycle_anchor_at
                        - last_reset_at
                        - archived_at
                        - created_at
                  spend_available:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Pass back as `cursor` for the next page. Null means the
                      walk is exhausted; a full page does NOT mean there is
                      more.
                required:
                  - data
                  - spend_available
                  - next_cursor
        '400':
          description: Invalid scope_type filter
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                      meta:
                        type: object
                        additionalProperties: {}
                      trace_id:
                        type: string
                      span_id:
                        type: string
                    required:
                      - type
                      - code
                      - message
                required:
                  - error
      security:
        - project_api_key: []
components:
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: >-
        Project API key for sending traces and accessing project-scoped
        resources. Format: sk-lw-... (no underscore). Obtain one by creating a
        project via the Admin API or the LangWatch UI.

````