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

# Set the test balance

> Test mode only. Sets the test credit balance, for example to `0` to
exercise `402 insufficient_credits`. Live keys get `404`.




## OpenAPI

````yaml /openapi.yaml post /test_helpers/balance
openapi: 3.1.0
info:
  title: Relettr API
  version: '1'
  summary: Translate manhwa chapters (Korean comics) into lettered English.
  description: |
    The Relettr public REST API, version 1.

    Every request is authenticated with an API key sent as a bearer token
    (`rl_live_…` or `rl_test_…`). Credits are integers; 100 credits = $1.

    Within v1 only additive changes are made: new endpoints, new optional
    fields, new event types and new enum values. Ignore unknown fields, and
    treat an unknown chapter `status` as non-terminal.
  contact:
    name: Relettr support
    email: support@relettr.com
servers:
  - url: https://api.relettr.com/v1
    description: Production (live and test keys)
security:
  - bearer: []
tags:
  - name: Chapters
    description: Create, upload, quote, start, poll and download a chapter.
  - name: Regions and review
    description: >-
      Read and edit the translated text, re-render, and resolve failed-mask
      zones.
  - name: Series
    description: Series hold the binding glossary and the context shared between chapters.
  - name: Glossary
    description: Glossary entries of a series.
  - name: Webhooks
    description: Registered webhook endpoints.
  - name: Events
    description: The events that are delivered to webhooks, as a list you can page through.
  - name: Credits
    description: Balance, usage, ledger and price estimates.
  - name: Status
    description: Service status. No authentication.
  - name: Test helpers
    description: Endpoints that exist only for `rl_test_` keys.
paths:
  /test_helpers/balance:
    post:
      tags:
        - Test helpers
      summary: Set the test balance
      description: |
        Test mode only. Sets the test credit balance, for example to `0` to
        exercise `402 insufficient_credits`. Live keys get `404`.
      operationId: setTestBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - credits
              properties:
                credits:
                  type: integer
                  minimum: 0
      responses:
        '200':
          description: The test balance.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Balance'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Balance:
      type: object
      properties:
        object:
          const: balance
        livemode:
          type: boolean
        available:
          type: integer
          description: Credits you can spend now.
        held:
          type: integer
          description: Credits held by queued or running chapters.
        welcome_remaining:
          type: integer
          description: Unspent welcome credits
          included in `available`.: null
        usd_equivalent:
          type: string
          examples:
            - '11.40'
          description: '`available` / 100, for display only.'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          additionalProperties: true
          description: |
            Some codes add fields: `required` and `available` (402),
            `scope`, `limit` and `used_this_month` (spend limits), `limit` and
            `active` (concurrency), `estimated_wait_s` (503), `status` and
            `allowed_from` (invalid_state), `missing_indexes`
            (upload_incomplete).
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - authentication
                - permission
                - not_found
                - conflict
                - payment_required
                - rate_limited
                - capacity
                - api_error
            code:
              type: string
              examples:
                - parameter_invalid
            message:
              type: string
            param:
              type: string
              examples:
                - files[3].content_type
            doc_url:
              type: string
              format: uri
            request_id:
              type: string
  responses:
    BadRequest:
      description: '`parameter_invalid`, `parameter_missing` or `json_invalid`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: '`api_key_missing`, `api_key_invalid` or `api_key_revoked`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: '`not_found`. Also returned for ids that belong to another account.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: |
        An API key: `rl_live_…` for real work, `rl_test_…` for test mode.
        Create keys on the site. Never put a key in browser code.

````

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