> ## 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.

# Create a chapter

> Creates a chapter, declares its files in reading order, and returns one
presigned `PUT` URL per file. Upload each file to its URL with exactly
the `Content-Type` and `Content-Length` you declared, then call
`POST /chapters/{id}/uploads/complete`.

`Idempotency-Key` is **required** on this endpoint.




## OpenAPI

````yaml /openapi.yaml post /chapters
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:
  /chapters:
    post:
      tags:
        - Chapters
      summary: Create a chapter
      description: |
        Creates a chapter, declares its files in reading order, and returns one
        presigned `PUT` URL per file. Upload each file to its URL with exactly
        the `Content-Type` and `Content-Length` you declared, then call
        `POST /chapters/{id}/uploads/complete`.

        `Idempotency-Key` is **required** on this endpoint.
      operationId: createChapter
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChapterCreate'
            example:
              source_language: ko
              series_id: ser_3hT9aB7cD1eF2gH3iJ4kL5
              number: 42
              layout: strip
              translate_sfx: false
              output:
                layout: original
                format: webp
                quality: 90
              auto_start: true
              max_credits: 600
              files:
                - index: 1
                  filename: 001.jpg
                  content_type: image/jpeg
                  size_bytes: 812345
                - index: 2
                  filename: 002.jpg
                  content_type: image/jpeg
                  size_bytes: 790111
              metadata:
                source_ref: tower-42
      responses:
        '201':
          description: The chapter, in `awaiting_upload`, with its upload URLs.
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Chapter'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/TooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    IdempotencyKeyRequired:
      name: Idempotency-Key
      in: header
      required: true
      description: A unique key for this request (a UUIDv4 is recommended). Required here.
      schema:
        type: string
        maxLength: 255
  schemas:
    ChapterCreate:
      allOf:
        - $ref: '#/components/schemas/ChapterOptions'
        - type: object
          required:
            - source_language
            - files
          properties:
            source_language:
              type: string
              enum:
                - ko
              description: Korean only. Any other value returns `422 unsupported_language`.
            target_language:
              type: string
              enum:
                - en
              default: en
            series_id:
              type: string
              description: Use this series' glossary and context.
            number:
              type: integer
              minimum: 1
              maximum: 99999
              description: Chapter number, unique within the series (`409 chapter_exists`).
            glossary:
              type: array
              maxItems: 300
              description: >-
                Inline glossary for a chapter without a series. Ignored when
                `series_id` is set.
              items:
                $ref: '#/components/schemas/GlossaryTerm'
            files:
              type: array
              minItems: 1
              maxItems: 300
              items:
                $ref: '#/components/schemas/FileDecl'
            metadata:
              $ref: '#/components/schemas/Metadata'
            test_scenario:
              type: string
              enum:
                - succeed
                - needs_review
                - fail_read
                - fail_render_partial
                - slow_queue
                - capacity_unavailable
              description: Test mode only. Live keys get `400`.
    Chapter:
      type: object
      properties:
        id:
          type: string
          examples:
            - ch_7Kq2mXaB3cD4eF5gH6iJ7k
        object:
          const: chapter
        livemode:
          type: boolean
        status:
          $ref: '#/components/schemas/ChapterStatus'
        series_id:
          type:
            - string
            - 'null'
        number:
          type:
            - integer
            - 'null'
        source_language:
          type: string
          enum:
            - ko
        target_language:
          type: string
          enum:
            - en
        options:
          $ref: '#/components/schemas/ChapterOptions'
        uploads:
          type: array
          description: Only present on create and while `awaiting_upload`.
          items:
            $ref: '#/components/schemas/Upload'
        quote:
          $ref: '#/components/schemas/Quote'
        credits:
          $ref: '#/components/schemas/Credits'
        progress:
          $ref: '#/components/schemas/Progress'
        queue:
          $ref: '#/components/schemas/Queue'
        review:
          $ref: '#/components/schemas/Review'
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/Warning'
        error:
          $ref: '#/components/schemas/ChapterError'
        result_version:
          type:
            - integer
            - 'null'
        metadata:
          $ref: '#/components/schemas/Metadata'
        created_at:
          type: string
          format: date-time
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
    ChapterOptions:
      type: object
      properties:
        layout:
          type: string
          enum:
            - strip
            - pages
          default: strip
          description: >
            `strip` joins the images into one vertical strip (vertical-scroll
            manhwa).

            `pages` treats each image as its own page.
        translate_sfx:
          type: boolean
          default: false
          x-beta: true
          description: '**Beta.** Translate drawn sound effects. Adds 3 credits per part.'
        output:
          $ref: '#/components/schemas/OutputOptions'
        on_mask_failure:
          type: string
          enum:
            - hold
            - accept
          default: hold
          description: |
            `hold` stops in `needs_review` with exports locked when a zone
            cannot be cleaned safely. `accept` accepts those zones
            automatically: their Korean stays and they are listed in
            `warnings`.
        auto_start:
          type: boolean
          default: false
          description: Start as soon as the quote is known. Requires `max_credits`.
        max_credits:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Do not start if the quote is higher than this.
    GlossaryTerm:
      type: object
      required:
        - source
        - target
      properties:
        source:
          type: string
          maxLength: 60
          description: Korean term.
        target:
          type: string
          maxLength: 60
          description: English rendering.
        type:
          type: string
          enum:
            - name
            - place
            - title
            - technique
            - term
            - address
            - speech
            - sfx
        gender:
          type: string
          enum:
            - f
            - m
        since_chapter:
          type: integer
          minimum: 1
          description: First chapter where this entry applies.
        note:
          type: string
          maxLength: 200
    FileDecl:
      type: object
      required:
        - index
        - content_type
        - size_bytes
      properties:
        index:
          type: integer
          minimum: 1
          maximum: 300
          description: Reading order, 1..N, top to bottom.
        filename:
          type: string
          maxLength: 200
          description: Stored as text only.
        content_type:
          type: string
          enum:
            - image/png
            - image/jpeg
            - image/webp
        size_bytes:
          type: integer
          minimum: 1
          maximum: 52428800
        width:
          type: integer
          minimum: 64
        height:
          type: integer
          minimum: 64
    Metadata:
      type: object
      maxProperties: 20
      additionalProperties:
        type: string
        maxLength: 500
      description: |
        Your own key/value strings, returned on the object and in events.
        Never shown in our UI and never sent to the translator.
    ChapterStatus:
      type: string
      description: >-
        May gain values in v1. Treat an unknown value as non-terminal and keep
        polling.
      enum:
        - awaiting_upload
        - validating
        - ready
        - queued
        - processing
        - needs_review
        - succeeded
        - failed
        - canceled
        - expired
    Upload:
      type: object
      properties:
        index:
          type: integer
        method:
          const: PUT
        url:
          type: string
          format: uri
        headers:
          type: object
          description: Send exactly these headers with the PUT.
          additionalProperties:
            type: string
        expires_at:
          type: string
          format: date-time
    Quote:
      type:
        - object
        - 'null'
      description: Exact price, known from `ready`. You are never charged more than this.
      properties:
        credits:
          type: integer
          examples:
            - 462
        parts:
          type: integer
          examples:
            - 21
        breakdown:
          type: object
          properties:
            ocr:
              type: integer
            translate:
              type: integer
            clean_letter:
              type: integer
            sfx:
              type: integer
    Credits:
      type: object
      properties:
        held:
          type: integer
        charged:
          type: integer
        refunded:
          type: integer
    Progress:
      type: object
      properties:
        step:
          type:
            - string
            - 'null'
          enum:
            - read
            - translate
            - render
            - stitch
            - null
        percent:
          type: integer
          minimum: 0
          maximum: 100
        parts_total:
          type:
            - integer
            - 'null'
        parts_done:
          type: integer
        steps:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                enum:
                  - read
                  - translate
                  - render
                  - stitch
              status:
                type: string
                enum:
                  - pending
                  - running
                  - succeeded
                  - failed
                  - skipped
    Queue:
      type: object
      properties:
        position:
          type:
            - integer
            - 'null'
          description: Place in the shared first-come-first-served queue while `queued`.
        estimated_start_at:
          type:
            - string
            - 'null'
          format: date-time
        gpu:
          type: string
          enum:
            - online
            - cooling
            - offline
    Review:
      type:
        - object
        - 'null'
      properties:
        open:
          type: integer
        accepted:
          type: integer
        zones:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              page:
                type: integer
              box:
                $ref: '#/components/schemas/Box'
              reason:
                type: string
    Warning:
      type: object
      properties:
        code:
          type: string
          examples:
            - missing_glyphs
          description: |
            For example `missing_glyphs`, `no_fit`, `tiny_lettering`,
            `korean_may_remain`, `mask_failed`, `heal_error`,
            `untranslated_erased`, `part_failed`.
        page:
          type: integer
        region_ids:
          type: array
          items:
            type: string
    ChapterError:
      type:
        - object
        - 'null'
      properties:
        code:
          type: string
          enum:
            - invalid_image
            - read_failed
            - translate_failed
            - render_failed
            - gpu_unavailable_timeout
            - internal_error
        message:
          type: string
        step:
          type:
            - string
            - 'null'
        file_index:
          type:
            - integer
            - 'null'
    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
    OutputOptions:
      type: object
      properties:
        layout:
          type: string
          enum:
            - original
            - parts
          default: original
          description: |
            `original` cuts the output back to your uploaded image boundaries
            (same count, same order). `parts` returns the processing parts
            (at most 1,600 px tall).
        strip:
          type: boolean
          default: false
          description: Also return the stitched chapter, cut at about 30,000 px.
        format:
          type: string
          enum:
            - png
            - webp
            - jpeg
          default: png
        quality:
          type: integer
          minimum: 1
          maximum: 100
          default: 90
    Box:
      type: array
      description: '[x0, y0, x1, y1] in pixels of the chosen output layout.'
      items:
        type: integer
      minItems: 4
      maxItems: 4
  headers:
    Request-Id:
      description: Unique id of this request. Quote it when you email support.
      schema:
        type: string
        examples:
          - req_8f2a1b3c4d5e6f7a8b9c0d
    Idempotent-Replayed:
      description: '`true` when this response is a replay of a saved response.'
      schema:
        type: string
        enum:
          - 'true'
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  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'
    Forbidden:
      description: >-
        `scope_missing`, `test_key_live_object`, `live_key_test_object` or
        `account_suspended`.
      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'
    Conflict:
      description: |
        `invalid_state`, `chapter_exists`, `idempotency_key_reused`,
        `idempotency_in_progress`, `chapter_not_ready`, `chapter_locked` or
        `quote_exceeds_max`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooLarge:
      description: '`too_many_files`, `chapter_too_large` or `too_many_parts`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnsupportedMediaType:
      description: >-
        `unsupported_media_type`. Only image/png, image/jpeg and image/webp are
        accepted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unprocessable:
      description: >-
        `upload_incomplete`, `invalid_image`, `image_too_large`,
        `unsupported_language` or `nothing_to_translate`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: '`rate_limited` or `concurrency_limit`.'
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      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.