---
title: "Quote Generation"
method: POST
path: "/api/generate/quote"
---

# Quote Generation

`POST /api/generate/quote`

## 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/quote`
- Auth: HTTP bearer

Price a book before creating it. Never blocks the creation: if the balance or
the plan lookup fails, answer with the price the request alone implies and let
POST /api/generate (which re-checks credits and plan limits before spending
anything) be the authority.

## Request body

- GenerationQuoteRequest: Lenient twin of GenerateRequest, used only to price a book. The price must never be what stops a creation. POST /api/generate re-validates everything (moderation, plan limits, credits) before spending a single credit, so POST /api/generate/quote prices whatever the planner produced instead of answering 422 — a 422 the UI could only show as "Could not calculate the final price, try again", with the Create button stuck on its loading state forever. The price depends on ``pages`` and the front-matter flags alone, so every text field here drops its length bounds and the page count is clamped into the range /api/generate accepts rather than rejected.
  - `theme` string
  - `title` string, nullable
  - `length` 'test' | 'short' | 'medium' | 'long'
  - `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

- GenerationQuoteResponse
  - `title` string, required
  - `pages` integer, required
  - `frontmatter_pages` integer, required
  - `cover_credits` integer, required
  - `cover` CoverQuoteSummary, required
    - `included` boolean
    - `credits` integer, required
    - `variant_count` integer
  - `required_credits` integer, required
  - `credits_to_charge` integer, required
  - `available_credits` integer, required
  - `is_free` boolean, required
  - `can_create` boolean, required
  - `blocker_code` string, nullable
  - `blocker_message` string, nullable

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