---
title: "Preview an idea before creating a collection"
method: POST
path: "/v1/generate/preview"
tags: ["Generate"]
---

# Preview an idea before creating a collection

`POST /v1/generate/preview`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/generate/preview`
- Auth: HTTP bearer

Synchronous, throwaway image generation for iterating on mascot ideas cheaply before committing to a collection. No collection required. Tweak the prompt, regenerate, compare, then use the winning prompt + a reference image in POST /v1/collections. Also supports `reference_image_urls` to check "does this prompt resemble my sketch?". Returns signed URLs with a 1-hour expiry - the images are not stored. Costs 1 credit per image (the `cost` field in the response confirms the amount). Returns 402 if credits are insufficient.

## Headers

- `Idempotency-Key` string

## Request body

- PreviewBody
  - `prompt` string, required: Text description of the mascot to preview. Preview exists for cheap idea iteration: tweak the prompt, regenerate, compare, then create the collection with the winning reference. Costs 1 credit per image generated.
  - `preset_id` string: Optional style preset ID. List presets via GET /v1/styles.
  - `count` number: Number of preview variants to generate. 1 to 6. Defaults to 1.
  - `reference_image_urls` string[]: Optional "check against" images. Feed an image you want the mascot to resemble; the preview tries to match it. Useful for "does this prompt produce something close to my sketch?" iterations. Not stored - use POST /v1/collections/:id/references for persistent references.

## Response `200`

Preview images

- PreviewResponse
  - `data` PreviewData, required
    - `images` object[], required
      - `url` string, uri, required
      - `expires_in` number, required
    - `cost` number, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict

---

[API](https://skmtc.dev/masko/apis/masko-api.md) · [All operations](https://skmtc.dev/masko/apis/masko-api/llms.txt) · [OpenAPI document](https://skmtc.dev/masko/apis/masko-api/revisions/91eb3006a92f?raw)
