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

# Generate AI Images and Videos with Prompt Bank

> Learn how to queue AI image and video generations, use image inputs for img2img, set aspect ratios and batch counts, and retrieve outputs from your vault.

The Prompt Bank generation API lets you queue image and video creation jobs with a single `POST` request to `/api/v1/generations`. Your job is dispatched asynchronously to fal.ai, and the output is saved directly to the vault you specify once processing completes. This guide covers every major generation scenario with complete, ready-to-run curl examples.

## Generate an image

Send a `POST /api/v1/generations` request with `generationType: "image"` and a fal.ai `modelId`. The request requires the `prompts:write` scope. The example below uses Recraft v4.1:

```bash theme={null}
curl -X POST https://www.promptbank.club/api/v1/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "fal-ai/recraft/v4.1/text-to-image",
    "prompt": "A vast cyberpunk city at dusk, towering neon-lit skyscrapers reflected in rain-soaked streets, volumetric fog, cinematic composition, 8k detail",
    "generationType": "image",
    "aspectRatio": "16:9",
    "vaultId": 42
  }'
```

The API responds with `202 Accepted` to confirm your job is queued:

```json theme={null}
{
  "data": {
    "success": true,
    "clientJobId": "my-job-001",
    "falRequestId": "fal-req-abc123def456",
    "statusUrl": "https://www.promptbank.club/api/v1/generations/my-job-001/status"
  },
  "error": null
}
```

The generated image will appear in vault `42` once the fal.ai job completes. Use the `statusUrl` from the response to check progress.

## Generate a video

Use `generationType: "video"` and a video-capable fal.ai endpoint. Everything else works the same as an image generation:

```bash theme={null}
curl -X POST https://www.promptbank.club/api/v1/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "fal-ai/kling-video/v1.6/standard/text-to-video",
    "prompt": "A slow aerial pan over a rain-soaked cyberpunk city at night, neon signs flickering, steam rising from grates, cinematic",
    "generationType": "video",
    "aspectRatio": "16:9",
    "vaultId": 42
  }'
```

Video jobs typically take longer to process than image jobs. Use the returned `statusUrl` to check progress, or wait for the asset to appear in your vault.

## Image-to-image

To use an existing image as the base for a new generation, provide its URL in the `imageInput` field. For models that accept multiple inputs, use `imageInputs` (up to 7 URLs):

**Single input:**

```bash theme={null}
curl -X POST https://www.promptbank.club/api/v1/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "fal-ai/recraft/v4.1/image-to-image",
    "prompt": "Transform into a watercolor painting, soft washes of color, visible brushwork, paper texture",
    "generationType": "image",
    "imageInput": "https://cdn.promptbank.club/uploads/my-photo.jpg",
    "aspectRatio": "1:1",
    "vaultId": 42
  }'
```

**Multiple inputs:**

```bash theme={null}
curl -X POST https://www.promptbank.club/api/v1/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "fal-ai/flux/dev/image-to-image",
    "prompt": "Merge these styles into a single cohesive landscape",
    "generationType": "image",
    "imageInputs": [
      "https://cdn.promptbank.club/uploads/style-a.jpg",
      "https://cdn.promptbank.club/uploads/style-b.jpg"
    ],
    "aspectRatio": "16:9"
  }'
```

To upload your own images for use as inputs, see the [Upload Images guide](/guides/upload-images).

## Batch generation

Set `batchCount` to generate multiple variations from the same prompt in one job. Accepted values are `1` through `4`:

```bash theme={null}
curl -X POST https://www.promptbank.club/api/v1/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "fal-ai/recraft/v4.1/text-to-image",
    "prompt": "Portrait of a botanist surrounded by exotic plants, natural light, film grain, 35mm",
    "generationType": "image",
    "aspectRatio": "4:3",
    "batchCount": 4,
    "vaultId": 42
  }'
```

All four images are saved to the specified vault when the job completes.

## Saving to a specific vault

Supply an integer `vaultId` in your request to direct the output to a particular vault. If you omit `vaultId`, the output is saved to your General vault — the system vault created automatically for every account:

```bash theme={null}
curl -X POST https://www.promptbank.club/api/v1/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelId": "fal-ai/recraft/v4.1/text-to-image",
    "prompt": "Minimalist product shot, white background, soft shadows",
    "generationType": "image",
    "vaultId": 99
  }'
```

You can retrieve the output later by listing prompts in that vault: `GET /api/v1/prompts?vaultId=99`.

## Tracking the generation

The `202 Accepted` response includes a `statusUrl` you can poll to check the state of your job:

```bash theme={null}
curl "https://www.promptbank.club/api/v1/generations/my-job-001/status" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Poll the `statusUrl` until the job reaches a terminal state, or simply wait for the generated asset to appear in your vault.

<Tip>
  The `clientJobId` is an **optional** identifier you supply when submitting the generation request. Providing your own value (for example, a UUID tied to a user action in your application) lets you correlate the job back to your own records, deduplicate retries, and look up the `statusUrl` by a stable key you control. If you omit `clientJobId`, one is generated automatically and returned in the `202` response.
</Tip>

## Next steps

* Need to upload reference images before generating? See the [Upload Images guide](/guides/upload-images).
* Learn how outputs are organized in [Vaults](/concepts/vaults).
