---
title: "Start Generation"
method: POST
path: "/api/generate"
---

# Start Generation

`POST /api/generate`

## Request

- Base URL: `https://api.kdpcoloringbook.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kdpcoloringbook.com/api/generate`
- Auth: HTTP bearer

Start a new book generation job. Free users get one watermarked book of up to
3 pages (FREE_MAX_PAGES_PER_BOOK in credits_service).

## Request body

- GenerateRequest
  - `theme` string, required
  - `title` string, nullable
  - `length` 'test' | 'short' | 'medium' | 'long', required
  - `pages` integer, nullable
  - `style_id` string, nullable
  - `custom_style` string, nullable
  - `reference_prompt` string, nullable
  - `distribution_type` 'progressive' | 'bold_and_easy' | 'cute_and_cozy'
  - `character_count` integer, nullable
  - `language` 'en' | 'es'
  - `style_description` string, nullable
  - `allow_text` boolean
  - `distribution` DistributionRange[], nullable
    - `start_page` integer, required
    - `end_page` integer, required
    - `theme` string, required
    - `description` string, nullable
  - `include_copyright` boolean
  - `include_tips` boolean
  - `include_review` boolean
  - `include_test` boolean

## Response `200`

Successful Response

- StartJobResponse
  - `job_id` string, required
  - `status` string, required
  - `progress` number, required
  - `theme` string, required
  - `title` string, required
  - `pages` integer, required
  - `selected_style` string, required
  - `images` ImageStatus[], required
    - `slot` integer, required
    - `status` string, required
    - `prompt` string, nullable
    - `simple_prompt` string, nullable
    - `simple_prompt_es` string, nullable
    - `url` string, nullable
    - `creative_brief` string, nullable
    - `simple_creative_brief` string, nullable
    - `simple_creative_brief_es` string, nullable
    - `bw_image_path` string, nullable
    - `error` string, nullable
    - `retries` integer
    - `bw_image_prompt` string, nullable
    - `bw_image_model` string, nullable
    - `completed_at` string, nullable
    - `framed` boolean
    - `page_type` string
  - `created_at` string, required
  - `user_id` string, nullable
  - `watermarked` boolean
  - `brand_signature` string, nullable
  - `language` string
  - `is_shared` boolean
  - `amazon_url` string, nullable
  - `shared_page_slots` integer[], nullable
  - `cover` CoverSummary
    - `cover_id` string, required
    - `status` string, required
    - `title` string, required
    - `preview_url` string, nullable
    - `front_url` string, nullable
    - `error_message` string, nullable
    - `generation_elapsed_seconds` number, nullable
    - `estimated_generation_seconds` number, nullable
    - `estimate_sample_count` integer
  - `message` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kdpcoloringbook/apis/book-generator-api.md) · [All operations](https://skmtc.dev/kdpcoloringbook/apis/book-generator-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kdpcoloringbook/apis/book-generator-api/revisions/f330c566ffc2?raw)
