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

# Set Experiment Budget



## OpenAPI

````yaml /openapi.json patch /v1/experiments/{experiment_id}/budget
openapi: 3.1.0
info:
  description: Customer-owned evaluation lifecycle API.
  title: HeyBee Public API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.heybee.app
security: []
paths:
  /v1/experiments/{experiment_id}/budget:
    patch:
      tags:
        - Economy
      summary: Set Experiment Budget
      operationId: set_experiment_budget_v1_experiments__experiment_id__budget_patch
      parameters:
        - in: path
          name: experiment_id
          required: true
          schema:
            format: uuid
            title: Experiment Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: X-API-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetExperimentBudgetRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentCreditStatusResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    SetExperimentBudgetRequest:
      additionalProperties: false
      properties:
        cap_credits:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: Evaluation spend limit in credits. Null means no spend limit.
          title: Cap Credits
      title: SetExperimentBudgetRequest
      type: object
    ExperimentCreditStatusResponse:
      properties:
        account_credits_available:
          default: 0
          title: Account Credits Available
          type: integer
        budget_cap_credits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Budget Cap Credits
        budget_remaining_credits:
          anyOf:
            - type: integer
            - type: 'null'
          title: Budget Remaining Credits
        budget_spent_credits:
          default: 0
          title: Budget Spent Credits
          type: integer
        is_active:
          title: Is Active
          type: boolean
        purchased_comparisons:
          title: Purchased Comparisons
          type: integer
        remaining_comparisons:
          title: Remaining Comparisons
          type: integer
        used_comparisons:
          title: Used Comparisons
          type: integer
        vote_cost_credits:
          title: Vote Cost Credits
          type: integer
      required:
        - purchased_comparisons
        - used_comparisons
        - remaining_comparisons
        - vote_cost_credits
        - is_active
      title: ExperimentCreditStatusResponse
      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
  securitySchemes:
    BearerAuth:
      bearerFormat: Supabase JWT
      scheme: bearer
      type: http
    ApiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey

````