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

# get a budget and its balance

> Get the budget at a key with its limits, the current balance of each, and the last ended periods with usage of each limited window.



## OpenAPI

````yaml /openapi.json get /v1/budgets/get
openapi: 3.0.3
info:
  title: Unprice API
  version: 1.0.0
servers:
  - url: https://api.unprice.dev
    description: Production
  - url: http://localhost:8787
    description: Development
  - url: https://preview-api.unprice.dev
    description: Preview
security:
  - bearerAuth: []
paths:
  /v1/budgets/get:
    get:
      tags:
        - budgets
      summary: get a budget and its balance
      description: >-
        Get the budget at a key with its limits, the current balance of each,
        and the last ended periods with usage of each limited window.
      operationId: budgets.get
      parameters:
        - schema:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9:/_.@-]{0,127}$
            description: >-
              The budget's key, chosen by you and unique within the project. Up
              to 128 letters, digits, and `: / _ . @ -`, starting with a letter
              or digit.
            example: customer:acme
          required: true
          name: key
          in: query
      responses:
        '200':
          description: The budget
          content:
            application/json:
              schema:
                type: object
                properties:
                  budget:
                    type: object
                    properties:
                      key:
                        type: string
                      unit:
                        type: string
                        description: money:<code>, credits:<id>, or units:<slug>
                        example: money:USD
                      version:
                        type: integer
                        description: Increments on every upsert that changes the budget
                      limits:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            amount:
                              type: string
                              description: A decimal amount in the budget's unit
                            window:
                              type: string
                              enum:
                                - hour
                                - day
                                - week
                                - month
                                - never
                              description: >-
                                The period a limit counts over. hour, day, week
                                (ISO, from Monday), and month are UTC calendar
                                periods unless anchored; never counts for the
                                life of the budget.
                              example: month
                            anchor:
                              type: integer
                              description: >-
                                The anchor instant of an anchored window, in
                                epoch milliseconds
                            enforce:
                              type: string
                              enum:
                                - hard
                                - soft
                              description: >-
                                hard denies authorize and charge that would
                                exceed the limit; soft never denies. Either kind
                                is reported in `crossed` once usage passes it,
                                and only a record can pass a hard limit.
                              example: hard
                          required:
                            - id
                            - amount
                            - window
                            - enforce
                      holds:
                        type: object
                        properties:
                          defaultTtlMs:
                            type: integer
                          maxTtlMs:
                            type: integer
                        required:
                          - defaultTtlMs
                          - maxTtlMs
                      onUnavailable:
                        type: string
                        enum:
                          - deny
                      closesAt:
                        type: integer
                        nullable: true
                        description: When the budget closes, in epoch milliseconds, or null
                      closed:
                        type: boolean
                        description: True from closesAt on
                      balance:
                        type: object
                        properties:
                          remaining:
                            type: string
                            nullable: true
                            description: >-
                              The least remaining over hard limits; null when
                              the budget has no hard limit
                          held:
                            type: string
                            description: >-
                              The sum of open holds and the unreported part of
                              open leases
                          limits:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                window:
                                  type: string
                                  enum:
                                    - hour
                                    - day
                                    - week
                                    - month
                                    - never
                                  description: >-
                                    The period a limit counts over. hour, day,
                                    week (ISO, from Monday), and month are UTC
                                    calendar periods unless anchored; never
                                    counts for the life of the budget.
                                  example: month
                                enforce:
                                  type: string
                                  enum:
                                    - hard
                                    - soft
                                  description: >-
                                    hard denies authorize and charge that would
                                    exceed the limit; soft never denies. Either
                                    kind is reported in `crossed` once usage
                                    passes it, and only a record can pass a hard
                                    limit.
                                  example: hard
                                amount:
                                  type: string
                                  description: The limit
                                consumed:
                                  type: string
                                  description: Used in the current period
                                held:
                                  type: string
                                  description: Held by open holds and leases
                                remaining:
                                  type: string
                                  description: >-
                                    amount - consumed - held; negative for a
                                    soft limit, or a hard limit a record passed
                                resetsAt:
                                  type: integer
                                  nullable: true
                                  description: >-
                                    When the limit's current period ends, in
                                    epoch milliseconds; null for never
                              required:
                                - id
                                - window
                                - enforce
                                - amount
                                - consumed
                                - held
                                - remaining
                                - resetsAt
                          asOf:
                            type: integer
                            description: >-
                              When this balance was computed, in epoch
                              milliseconds
                        required:
                          - remaining
                          - held
                          - limits
                          - asOf
                      operations:
                        type: object
                        properties:
                          upsert:
                            type: integer
                            minimum: 0
                          authorize:
                            type: integer
                            minimum: 0
                          settle:
                            type: integer
                            minimum: 0
                          release:
                            type: integer
                            minimum: 0
                          charge:
                            type: integer
                            minimum: 0
                          record:
                            type: integer
                            minimum: 0
                          lease:
                            type: integer
                            minimum: 0
                          report:
                            type: integer
                            minimum: 0
                        required:
                          - upsert
                          - authorize
                          - settle
                          - release
                          - charge
                          - record
                          - lease
                          - report
                        description: >-
                          Accepted calls that changed the budget, per verb,
                          since it was created. Replays, rejections, reads,
                          upserts that changed nothing, and holds and leases the
                          alarm closed at expiry are not counted.
                    required:
                      - key
                      - unit
                      - version
                      - limits
                      - holds
                      - onUnavailable
                      - closesAt
                      - closed
                      - balance
                      - operations
                  history:
                    type: array
                    items:
                      type: object
                      properties:
                        windowId:
                          type: string
                          example: month
                        start:
                          type: integer
                          description: Period start, in epoch milliseconds
                        end:
                          type: integer
                          description: Period end (exclusive), in epoch milliseconds
                        consumed:
                          type: string
                          description: Used in the period
                      required:
                        - windowId
                        - start
                        - end
                        - consumed
                    description: >-
                      The last 12 ended periods with usage of each limited
                      window, newest first. Older periods are not kept.
                required:
                  - budget
                  - history
        '400':
          description: >-
            The server cannot or will not process the request due to something
            that is perceived to be a client error (e.g., malformed request
            syntax, invalid request message framing, or deceptive request
            routing).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBadRequest'
        '401':
          description: >-
            Although the HTTP standard specifies "unauthorized", semantically
            this response means "unauthenticated". That is, the client must
            authenticate itself to get the requested response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
        '403':
          description: >-
            The client does not have access rights to the content; that is, it
            is unauthorized, so the server is refusing to give the requested
            resource. Unlike 401 Unauthorized, the client's identity is known to
            the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrForbidden'
        '404':
          description: >-
            The server cannot find the requested resource. In the browser, this
            means the URL is not recognized. In an API, this can also mean that
            the endpoint is valid but the resource itself does not exist.
            Servers may also send this response instead of 403 Forbidden to hide
            the existence of a resource from an unauthorized client. This
            response code is probably the most well known due to its frequent
            occurrence on the web.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
        '409':
          description: >-
            This response is sent when a request conflicts with the current
            state of the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrConflict'
        '412':
          description: >-
            The requested operation cannot be completed because certain
            conditions were not met. This typically occurs when a required
            resource state or version check fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrPreconditionFailed'
        '413':
          description: The request payload is larger than the server is willing to process.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrPayloadTooLarge'
        '429':
          description: >-
            The user has sent too many requests in a given amount of time ("rate
            limiting")
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrTooManyRequests'
        '500':
          description: >-
            The server has encountered a situation it does not know how to
            handle.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrInternalServerError'
components:
  schemas:
    ErrBadRequest:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
              description: A machine readable error code.
              example: BAD_REQUEST
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/BAD_REQUEST
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrUnauthorized:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - UNAUTHORIZED
              description: A machine readable error code.
              example: UNAUTHORIZED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/UNAUTHORIZED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrForbidden:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - FORBIDDEN
              description: A machine readable error code.
              example: FORBIDDEN
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/FORBIDDEN
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrNotFound:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - NOT_FOUND
              description: A machine readable error code.
              example: NOT_FOUND
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/NOT_FOUND
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrConflict:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - CONFLICT
              description: A machine readable error code.
              example: CONFLICT
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: https://docs.unprice.dev/api-reference/errors/code/CONFLICT
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrPreconditionFailed:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - PRECONDITION_FAILED
              description: A machine readable error code.
              example: PRECONDITION_FAILED
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/PRECONDITION_FAILED
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrPayloadTooLarge:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - PAYLOAD_TOO_LARGE
              description: A machine readable error code.
              example: PAYLOAD_TOO_LARGE
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/PAYLOAD_TOO_LARGE
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrTooManyRequests:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - TOO_MANY_REQUESTS
              description: A machine readable error code.
              example: TOO_MANY_REQUESTS
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/TOO_MANY_REQUESTS
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
    ErrInternalServerError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - INTERNAL_SERVER_ERROR
              description: A machine readable error code.
              example: INTERNAL_SERVER_ERROR
            docs:
              type: string
              description: >-
                A link to our documentation with more details about this error
                code
              example: >-
                https://docs.unprice.dev/api-reference/errors/code/INTERNAL_SERVER_ERROR
            message:
              type: string
              description: A human readable explanation of what went wrong
            requestId:
              type: string
              description: Please always include the requestId in your error report
              example: req_1234
            details:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - invalid_config
                        - slug_conflict
                        - unresolved_reference
                      description: What kind of failure this is
                      example: invalid_config
                    issues:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                            description: JSON path into the submitted document
                            example: config.plans[0].version.features[1].featureSlug
                          message:
                            type: string
                        required:
                          - path
                          - message
                      description: Per-location detail, when the failure has locations
                  required:
                    - kind
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_exceeded
                    blocked:
                      type: object
                      properties:
                        limitId:
                          type: string
                        window:
                          type: string
                          enum:
                            - hour
                            - day
                            - week
                            - month
                            - never
                          description: >-
                            The period a limit counts over. hour, day, week
                            (ISO, from Monday), and month are UTC calendar
                            periods unless anchored; never counts for the life
                            of the budget.
                          example: month
                        remaining:
                          type: string
                          description: A decimal amount in the budget's unit
                        held:
                          type: string
                          description: A decimal amount in the budget's unit
                        resetsAt:
                          type: integer
                          nullable: true
                          description: >-
                            When the limit's current period ends, in epoch
                            milliseconds; null for never
                        remedy:
                          type: string
                          enum:
                            - release_holds
                            - wait_for_reset
                            - raise_limit
                          description: >-
                            release_holds: releasing holds makes the request fit
                            all failing limits. wait_for_reset: resetting the
                            failing windows makes the request fit with holds
                            unchanged. raise_limit: neither action alone is
                            sufficient; one or more limits need a change.
                      required:
                        - limitId
                        - window
                        - remaining
                        - held
                        - resetsAt
                        - remedy
                      description: >-
                        A failing hard limit smaller than the request, or
                        otherwise the one that resets last. Other limits can
                        also block the request. The remedy considers all failing
                        limits.
                    balance:
                      type: object
                      properties:
                        remaining:
                          type: string
                          nullable: true
                          description: >-
                            The least remaining over hard limits; null when the
                            budget has no hard limit
                        held:
                          type: string
                          description: >-
                            The sum of open holds and the unreported part of
                            open leases
                        limits:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: string
                              window:
                                type: string
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                  - never
                                description: >-
                                  The period a limit counts over. hour, day,
                                  week (ISO, from Monday), and month are UTC
                                  calendar periods unless anchored; never counts
                                  for the life of the budget.
                                example: month
                              enforce:
                                type: string
                                enum:
                                  - hard
                                  - soft
                                description: >-
                                  hard denies authorize and charge that would
                                  exceed the limit; soft never denies. Either
                                  kind is reported in `crossed` once usage
                                  passes it, and only a record can pass a hard
                                  limit.
                                example: hard
                              amount:
                                type: string
                                description: The limit
                              consumed:
                                type: string
                                description: Used in the current period
                              held:
                                type: string
                                description: Held by open holds and leases
                              remaining:
                                type: string
                                description: >-
                                  amount - consumed - held; negative for a soft
                                  limit, or a hard limit a record passed
                              resetsAt:
                                type: integer
                                nullable: true
                                description: >-
                                  When the limit's current period ends, in epoch
                                  milliseconds; null for never
                            required:
                              - id
                              - window
                              - enforce
                              - amount
                              - consumed
                              - held
                              - remaining
                              - resetsAt
                        asOf:
                          type: integer
                          description: >-
                            When this balance was computed, in epoch
                            milliseconds
                      required:
                        - remaining
                        - held
                        - limits
                        - asOf
                  required:
                    - kind
                    - blocked
                    - balance
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - budget_closed
                    closedAt:
                      type: integer
                      description: When the budget closed, in epoch milliseconds
                  required:
                    - kind
                    - closedAt
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - hold_amount_exceeded
                    holdId:
                      type: string
                      pattern: ^h_[1-9][0-9]{0,15}$
                      description: The hold, as returned by authorize
                      example: h_42
                    maximum:
                      type: string
                      description: A decimal amount in the budget's unit
                    actual:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - holdId
                    - maximum
                    - actual
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - limit_below_usage
                    limitId:
                      type: string
                    minimum:
                      type: string
                      description: A decimal amount in the budget's unit
                    requested:
                      type: string
                      description: A decimal amount in the budget's unit
                  required:
                    - kind
                    - limitId
                    - minimum
                    - requested
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - window_capacity_exceeded
                    maximum:
                      type: integer
                      minimum: 0
                    retained:
                      type: integer
                      minimum: 0
                  required:
                    - kind
                    - maximum
                    - retained
          required:
            - code
            - docs
            - message
            - requestId
      required:
        - error
  securitySchemes:
    bearerAuth:
      bearerFormat: root key
      type: http
      scheme: bearer
      x-speakeasy-example: UNPRICE_API_KEY

````

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