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

# Turn AI auto-recharge on or off

> When on, Dojo charges the card the last top-up saved `amountUSD` plus the processing fee of 4.6% + $0.31 whenever the AI balance drops under `thresholdUSD` ($20 under $5 until set). Omitted numbers keep their values. Whole dollars. Add $10 to $1,000 each time; the threshold is at least $1 and below the amount, so one recharge always lifts the balance over it. A declined charge turns it off and emails the workspace's admins. Saving while the balance is under the threshold charges at once; if Stripe can't be reached, the answer is 503 and nothing changes. Only a person signed in to Dojo in the browser can change it: an API key, the CLI or an MCP connection gets 403 with a link to the Usage tab, and reads the setting with `GET /api/billing/ai`.



## OpenAPI

````yaml https://dojo.frogbot.ai/api/openapi.json post /api/billing/ai-auto-recharge
openapi: 3.1.0
info:
  title: Dojo API
  version: '1'
  description: >-
    Everything Dojo's pages do, for scripts and agents. Sign in with an API key
    as `Authorization: Bearer fb_…`. Paying and accepting the terms happen at a
    link a route answers, for a person to open.
servers:
  - url: https://dojo.frogbot.ai
security:
  - apiKey: []
tags:
  - name: Sign-in
  - name: Workspaces
  - name: Projects
  - name: Apps
  - name: Templates
  - name: Sharing
  - name: Deployments
  - name: Environment variables
  - name: Domains
  - name: Data
  - name: Billing
  - name: API keys
paths:
  /api/billing/ai-auto-recharge:
    post:
      tags:
        - Billing
      summary: Turn AI auto-recharge on or off
      description: >-
        When on, Dojo charges the card the last top-up saved `amountUSD` plus
        the processing fee of 4.6% + $0.31 whenever the AI balance drops under
        `thresholdUSD` ($20 under $5 until set). Omitted numbers keep their
        values. Whole dollars. Add $10 to $1,000 each time; the threshold is at
        least $1 and below the amount, so one recharge always lifts the balance
        over it. A declined charge turns it off and emails the workspace's
        admins. Saving while the balance is under the threshold charges at once;
        if Stripe can't be reached, the answer is 503 and nothing changes. Only
        a person signed in to Dojo in the browser can change it: an API key, the
        CLI or an MCP connection gets 403 with a link to the Usage tab, and
        reads the setting with `GET /api/billing/ai`.
      operationId: post/api/billing/ai-auto-recharge
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: string
                  description: A document id.
                'on':
                  type: boolean
                thresholdUSD:
                  type: integer
                amountUSD:
                  type: integer
                app:
                  type: string
                  description: A document id.
              required:
                - workspace
                - 'on'
            example:
              workspace: 6720f1…
              'on': true
              thresholdUSD: 10
              amountUSD: 50
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  autoRecharge:
                    type: boolean
                  thresholdUSD:
                    type: integer
                  amountUSD:
                    type: integer
                  feeUSD:
                    type: number
                  totalUSD:
                    type: number
                  balanceUSD:
                    type: number
                required:
                  - autoRecharge
                  - thresholdUSD
                  - amountUSD
                  - feeUSD
                  - totalUSD
                  - balanceUSD
        '400':
          description: '`invalid_request`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: '`unauthorized`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: '`forbidden`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '409':
          description: '`conflict`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '503':
          description: '`unavailable`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
components:
  schemas:
    Errors:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - message
            properties:
              message:
                type: string
              data:
                type: object
                properties:
                  code:
                    type: string
                  url:
                    type: string
                    description: Where a person takes the next step, such as paying.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An API key from `frogbot deploy`'s sign-in, `/api/cli/device/token`, or
        the API keys page.

````

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