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

# Save one budget entry

> Sets the budget cap for one scope — provider '*', model '*' is the across-all-providers-and-models budget, (provider, '*') covers every model of one provider, and (provider, model) caps exactly one model. A null dailyTokenLimit disables (removes) the budget at that scope. The cap is enforced against the provider's own reported usage for its active spend window (the five-hour session window coding plans enforce); when the cap exceeds the provider's window allowance the response flags overProviderLimit so the UI can warn. Applies from the next model call; a reached limit pauses AI processing for that scope until the provider's window reset.



## OpenAPI

````yaml /api/openapi.json put /api/budget
openapi: 3.1.0
info:
  title: Aquila API
  version: 1.0.0
  description: >-
    Event-driven reconnaissance platform API. All /api/* routes except
    /api/public/* require an authenticated session (cookie), an X-Api-Key
    header, or a bearer token. Auth endpoints under /api/auth/* are generated by
    Better Auth.
servers:
  - url: https://aquila.attaxr.com
  - url: http://localhost
security: []
tags:
  - name: AI
  - name: Agents
  - name: Bulk Delete
  - name: Chat
  - name: Constraints
  - name: Dashboard
  - name: Events
  - name: JS
  - name: JS Analysis
  - name: JS Monitoring
  - name: Leads
  - name: MCP Key
  - name: Notification Channels
  - name: Notification Event Preferences
  - name: Notifications
  - name: OOB
  - name: Provider Keys
  - name: Public Shares
  - name: Reinforcements
  - name: Reports
  - name: Scans
  - name: Schedules
  - name: Shares
  - name: Tools
  - name: User Profiles
  - name: V1
  - name: Vulnerabilities
  - name: Workflows
  - name: Workspace
paths:
  /api/budget:
    put:
      tags:
        - Budget
      summary: Save one budget entry
      description: >-
        Sets the budget cap for one scope — provider '*', model '*' is the
        across-all-providers-and-models budget, (provider, '*') covers every
        model of one provider, and (provider, model) caps exactly one model. A
        null dailyTokenLimit disables (removes) the budget at that scope. The
        cap is enforced against the provider's own reported usage for its active
        spend window (the five-hour session window coding plans enforce); when
        the cap exceeds the provider's window allowance the response flags
        overProviderLimit so the UI can warn. Applies from the next model call;
        a reached limit pauses AI processing for that scope until the provider's
        window reset.
      operationId: putApiBudget
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                provider:
                  type: string
                  minLength: 1
                  maxLength: 64
                model:
                  type: string
                  minLength: 1
                  maxLength: 128
                dailyTokenLimit:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 1000000000
                    - type: 'null'
              required:
                - provider
                - model
                - dailyTokenLimit
      responses:
        '200':
          description: >-
            The saved scope, its live status, and the provider-window warning
            flags.
          content:
            application/json:
              schema: {}
        '400':
          description: Validation failed.
          content:
            application/json:
              schema: {}
        '401':
          description: No valid session cookie or API key.
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: Email address not verified, or the caller lacks the required role.
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '429':
          description: >-
            Risk-tier rate limit exceeded (writes 20/min, expensive 10/min, bulk
            60/min). Limited responses carry X-RateLimit-Limit,
            X-RateLimit-Remaining, X-RateLimit-Reset and Retry-After.
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: The save failed.
          content:
            application/json:
              schema: {}
      security:
        - apiKeyCookie: []
        - apiKeyHeader: []
        - bearerAuth: []
components:
  securitySchemes:
    apiKeyCookie:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Browser session cookie set by Better Auth sign-in.
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Personal API key (aquila_… prefix; settings → API keys).
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal API key sent as a bearer token.

````

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