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

# Create llm gateway budget

> Create and update spend and token limits and current-period allowances.



## OpenAPI

````yaml /openapi/forge-api.yaml post /api/headless/v1/organizations/{organizationId}/llm-gateway/budgets
openapi: 3.0.3
info:
  title: Forge API
  version: 0.1.0
  description: >-
    Automate Forge inventory, investigations, findings, governance, fleet,
    policy, configuration, compliance, MCP, service-account, and audit
    workflows.
servers:
  - url: https://api.forge.ai
    description: Forge production API
security:
  - serviceAccountBearer: []
tags:
  - name: approvals
    description: MCP approvals
  - name: audit
    description: Audit
  - name: capabilities
    description: Capabilities
  - name: compliance
    description: Compliance
  - name: findings
    description: Findings
  - name: fleet
    description: Fleet
  - name: governance
    description: Governance
  - name: inventory
    description: Inventory
  - name: investigation
    description: Investigations
  - name: managed-config
    description: Managed configuration
  - name: mcp
    description: MCP sessions
  - name: mcp-registry
    description: MCP and skill registry
  - name: operations
    description: operations
  - name: policies
    description: Policies and violations
  - name: resources
    description: Resources
  - name: service-accounts
    description: Service accounts
  - name: settings
    description: Automation settings
paths:
  /api/headless/v1/organizations/{organizationId}/llm-gateway/budgets:
    post:
      tags:
        - policies
      summary: Create llm gateway budget
      description: Create and update spend and token limits and current-period allowances.
      operationId: createHeadlessLlmGatewayBudget
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/ForgeReason'
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/ForgeConfirm'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForgeLLMGatewayBudgetCreateRequest'
      responses:
        '201':
          description: Gateway budget response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForgeLLMGatewayBudgetResponse'
        '202':
          description: Saved; runtime propagation is pending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForgeLLMGatewayBudgetResponse'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  parameters:
    OrganizationId:
      name: organizationId
      in: path
      required: true
      schema:
        type: string
    ForgeReason:
      name: X-Forge-Reason
      in: header
      required: true
      schema:
        type: string
        minLength: 1
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 1
    ForgeConfirm:
      name: X-Forge-Confirm
      in: header
      required: true
      schema:
        type: boolean
        enum:
          - true
  schemas:
    ForgeLLMGatewayBudgetCreateRequest:
      type: object
      description: >-
        Independent optional limit. All matching budgets apply cumulatively
        across providers and keys. Access assignments do not create budgets.
      properties:
        accessProfileId:
          type: string
          description: Optional profile filter; omission applies across access profiles.
        tokenId:
          type: string
        subjectKind:
          $ref: '#/components/schemas/ForgeLLMGatewaySubjectKind'
        subjectId:
          type: string
        budgetWindow:
          $ref: '#/components/schemas/ForgeLLMGatewayBudgetWindow'
        amountUsd:
          type: number
          format: double
          minimum: 0.000001
          maximum: 1000000000000
          exclusiveMaximum: true
        inputTokenLimit:
          type: integer
          format: int64
          minimum: 1
        outputTokenLimit:
          type: integer
          format: int64
          minimum: 1
        totalTokenLimit:
          type: integer
          format: int64
          minimum: 1
        action:
          type: string
          enum:
            - block
        metadata:
          $ref: '#/components/schemas/ForgeLLMGatewayBudgetWriteMetadata'
    ForgeLLMGatewayBudgetResponse:
      type: object
      required:
        - budget
      properties:
        budget:
          $ref: '#/components/schemas/ForgeLLMGatewayAdminBudget'
    ForgeLLMGatewaySubjectKind:
      type: string
      enum:
        - user
        - group
        - app
        - agent
        - service_account
        - customer_tenant
    ForgeLLMGatewayBudgetWindow:
      type: string
      enum:
        - daily
        - weekly
        - monthly
        - rolling_24h
        - rolling_7d
        - rolling_30d
    ForgeLLMGatewayBudgetWriteMetadata:
      type: object
      additionalProperties: false
      description: >-
        Accepted budget settings. Unknown keys are rejected. Server-owned fields
        may be returned unchanged on update; use allowanceUsd to change
        allowances.
      properties:
        memberLimitUsd:
          type: number
          format: double
          minimum: 0.000001
          maximum: 1000000000000
          exclusiveMaximum: true
        memberLimitsUsd:
          type: object
          additionalProperties:
            type: number
            format: double
            minimum: 0.000001
            maximum: 1000000000000
            exclusiveMaximum: true
        allowance:
          $ref: '#/components/schemas/ForgeLLMGatewayBudgetAllowance'
        memberAllowances:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ForgeLLMGatewayBudgetAllowance'
        memberOfBudget:
          type: string
        memberGroupId:
          type: string
        source:
          type: string
        quotaResetWindow:
          type: string
        discountSource:
          type: string
        managedAccessOverride: {}
        managedDeveloperOrganizationDefault: {}
        softBudgetUsd:
          type: number
          format: double
        softBudgetAlertEmails:
          type: array
          items:
            type: string
        warningThresholds:
          type: array
          items:
            type: number
            format: double
        negotiatedDiscountPercent:
          type: number
          format: double
        costMultiplier:
          type: number
          format: double
        warning_thresholds:
          x-go-name: LegacyWarningThresholds
          type: array
          items:
            type: number
            format: double
        negotiated_discount_percent:
          x-go-name: LegacyNegotiatedDiscountPercent
          type: number
          format: double
        cost_multiplier:
          x-go-name: LegacyCostMultiplier
          type: number
          format: double
    ForgeLLMGatewayAdminBudget:
      type: object
      required:
        - id
        - budgetWindow
        - state
        - metadata
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        accessProfileId:
          type: string
        tokenId:
          type: string
        subjectKind:
          $ref: '#/components/schemas/ForgeLLMGatewaySubjectKind'
        subjectId:
          type: string
        budgetWindow:
          $ref: '#/components/schemas/ForgeLLMGatewayBudgetWindow'
        amountUsd:
          type: number
          format: double
        inputTokenLimit:
          type: integer
          format: int64
        outputTokenLimit:
          type: integer
          format: int64
        totalTokenLimit:
          type: integer
          format: int64
        state:
          type: string
          enum:
            - active
            - disabled
        metadata:
          $ref: '#/components/schemas/ForgeLLMGatewayBudgetMetadata'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        spentUsd:
          type: number
          format: double
          description: >-
            Recorded spend for the current period on list responses. Untracked
            costs contribute zero.
        usedTokens:
          type: integer
          format: int64
        effectiveAmountUsd:
          type: number
          format: double
          description: USD limit including the current calendar-period allowance.
    MessageResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ForgeLLMGatewayBudgetAllowance:
      type: object
      required:
        - amountUsd
        - windowStart
      properties:
        amountUsd:
          type: number
          format: double
          minimum: 0.000001
          maximum: 1000000000000
          exclusiveMaximum: true
        windowStart:
          type: string
          format: date-time
    ForgeLLMGatewayBudgetMetadata:
      type: object
      additionalProperties: true
      description: >-
        Member limits are editable; allowance and member linkage fields are
        returned by the server. Normal updates preserve omitted server-owned
        fields and reject conflicting values. Change allowances using
        allowanceUsd on budget update.
      properties:
        memberLimitUsd:
          type: number
          format: double
          minimum: 0.000001
          maximum: 1000000000000
          exclusiveMaximum: true
          description: Per-user default within a group spending budget.
        memberLimitsUsd:
          type: object
          additionalProperties:
            type: number
            format: double
            minimum: 0.000001
            maximum: 1000000000000
            exclusiveMaximum: true
          description: Member user IDs mapped to replacement per-member limits.
        allowance:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/ForgeLLMGatewayBudgetAllowance'
        memberAllowances:
          type: object
          readOnly: true
          additionalProperties:
            $ref: '#/components/schemas/ForgeLLMGatewayBudgetAllowance'
        memberOfBudget:
          type: string
          readOnly: true
        memberGroupId:
          type: string
          readOnly: true
  responses:
    Error:
      description: Stable Forge error envelope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MessageResponse'
  securitySchemes:
    serviceAccountBearer:
      type: http
      scheme: bearer
      bearerFormat: Forge service-account or delegated OAuth access token
      description: >-
        Enter a Forge service-account token or delegated OAuth access token.
        Mintlify adds the Bearer prefix.

````

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