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

# Set or clear the organisation's daily AI caps (a key not sent is kept)



## OpenAPI

````yaml https://platform.ankra.app/openapi.json put /api/v1/org/billing/ai-spend-cap
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/org/billing/ai-spend-cap:
    put:
      tags:
        - billing
      summary: Set or clear the organisation's daily AI caps (a key not sent is kept)
      operationId: update_ai_spend_cap_api_v1_org_billing_ai_spend_cap_put
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiSpendCapUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiSpendCap'
          description: Successful Response
        '400':
          description: A cap that is not positive, or a hard token cap below the soft cap
        '401':
          description: Unauthorized
        '403':
          description: billing.manage required
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    AiSpendCapUpdateRequest:
      properties:
        daily_chat_usd_cap:
          anyOf:
            - type: number
            - type: 'null'
          title: Daily Chat Usd Cap
          description: Null clears the money cap back to the plan default.
        daily_token_soft_cap:
          anyOf:
            - type: integer
            - type: 'null'
          title: Daily Token Soft Cap
          description: >-
            Past it every unattended run degrades to the quick tier for the rest
            of the UTC day; null clears.
        daily_token_hard_cap:
          anyOf:
            - type: integer
            - type: 'null'
          title: Daily Token Hard Cap
          description: >-
            Past it new unattended runs are refused until midnight UTC; null
            clears. Never below the soft cap.
      title: AiSpendCapUpdateRequest
      type: object
    AiSpendCap:
      properties:
        daily_chat_usd_cap:
          anyOf:
            - type: number
            - type: 'null'
          title: Daily Chat Usd Cap
        plan_default_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Plan Default Usd
        effective_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Effective Usd
        spent_today_usd:
          type: number
          title: Spent Today Usd
        daily_token_soft_cap:
          anyOf:
            - type: integer
            - type: 'null'
          title: Daily Token Soft Cap
        daily_token_hard_cap:
          anyOf:
            - type: integer
            - type: 'null'
          title: Daily Token Hard Cap
        tokens_today:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tokens Today
          description: Null when today's usage could not be read.
        token_budget_state:
          type: string
          enum:
            - unlimited
            - under
            - soft
            - hard
            - unknown
          title: Token Budget State
        monthly_free_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Monthly Free Usd
        monthly_plan_default_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Monthly Plan Default Usd
        monthly_override_usd:
          anyOf:
            - type: number
            - type: 'null'
          title: Monthly Override Usd
        monthly_platform_spent_usd:
          type: number
          title: Monthly Platform Spent Usd
        monthly_resets_at:
          type: string
          title: Monthly Resets At
        monthly_exhausted:
          type: boolean
          title: Monthly Exhausted
        allowance_exempt:
          type: boolean
          title: Allowance Exempt
        byok_configured:
          type: boolean
          title: Byok Configured
      required:
        - daily_chat_usd_cap
        - plan_default_usd
        - effective_usd
        - spent_today_usd
        - daily_token_soft_cap
        - daily_token_hard_cap
        - tokens_today
        - token_budget_state
        - monthly_free_usd
        - monthly_plan_default_usd
        - monthly_override_usd
        - monthly_platform_spent_usd
        - monthly_resets_at
        - monthly_exhausted
        - allowance_exempt
        - byok_configured
      title: AiSpendCap
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````