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

# Image Generation

> Generate images from a prompt, optionally composing your organization's trained models.

Turn a text prompt into images with `POST /images/generations`, optionally
composing your organization's trained **style**, **object**, **person**, and
**setting** models plus a **color palette**. The default engine is
`nano_banana_pro` (pass `engine` to select `nano_banana_2`).

## Asynchronous pattern

Generation is asynchronous. `POST /images/generations` returns **`202 Accepted`**
immediately with a job `id`, `status`, and an `estimated_credits` figure. Poll
[`GET /images/generations/{id}`](/api-reference/images/get-generation) until
`status` is `completed` (or `failed`/`cancelled`), then read the produced images —
each carries a presigned URL valid for **24 hours**. Pass a `webhook_url` to be
notified instead of polling (see [Webhooks](/guides/webhooks)).

## Credits

Each output costs `5` credits at `1K`, scaling with resolution (`1K` ×1, `2K` ×2,
`4K` ×4) and multiplied by `num_outputs`. Costs draw from your organization's pool;
an exhausted pool returns `402`. See [Pricing](/guides/pricing).

<Card title="Quickstart" icon="rocket" href="/quickstart">
  A full zero-to-image walkthrough with curl, Python, and TypeScript.
</Card>
