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

# Update AI Mode

> Switch between managed and BYOK AI mode.

In managed mode, Rigbox injects API keys server-side and tracks credit usage. In BYOK mode, you provide your own provider keys.


## OpenAPI

````yaml PUT /api/v1/users/me/ai-mode
openapi: 3.1.0
info:
  title: Rigbox Public API
  description: >-
    Gateway-owned public API for Rigbox. The gateway composes its local
    lifecycle API with service-owned exported specs.
  contact:
    name: Rigbox
    url: https://rigbox.dev
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.rigbox.dev
    description: Production gateway
security: []
tags:
  - name: Workspaces
  - name: CLI
  - name: Observability
  - name: Auth
  - name: API Keys
  - name: Access Control
  - name: Apps
  - name: App Catalog
  - name: Logs
  - name: AI
  - name: Tools
  - name: Snapshots
  - name: SSH Keys
  - name: Templates
  - name: Setup Scripts
  - name: Service Specs
  - name: Deploy
  - name: Community
  - name: User Settings
  - name: Roadmap
  - name: System
paths:
  /api/v1/users/me/ai-mode:
    put:
      tags:
        - AI
      summary: Update AI mode for the authenticated user.
      description: Update the account AI mode (deprecated; use ai-defaults instead).
      operationId: update_ai_mode
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAiModeRequest'
        required: true
      responses:
        '200':
          description: Updated AI mode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiCredits'
      security:
        - bearer: []
components:
  schemas:
    UpdateAiModeRequest:
      type: object
      required:
        - mode
      properties:
        mode:
          type: string
    AiCredits:
      type: object
      required:
        - remaining
        - total
        - remaining_micro
        - total_micro
        - free
        - pro
        - free_micro
        - pro_micro
        - mode
      properties:
        free:
          type: number
          format: double
          description: Free bucket balance (resets to 250 each month, unused expires).
        free_micro:
          type: integer
          format: int64
        mode:
          type: string
        pro:
          type: number
          format: double
          description: >-
            Pro bucket balance (active pro_managed gets +2000/month, rolls
            over).
        pro_micro:
          type: integer
          format: int64
        remaining:
          type: number
          format: double
          description: Total spendable credits = free + pro.
        remaining_micro:
          type: integer
          format: int64
        total:
          type: number
          format: double
          description: >-
            Credits granted this cycle (the monthly entitlement: 250 free, plus
            2000

            for an active pro_managed subscriber). May be below `remaining` when
            pro

            credits have rolled over from prior months.
        total_micro:
          type: integer
          format: int64
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````