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

# Product image API

## Before you start

Sign in to LuluLab and get a luk- API key from My Keys. Store it on your server. All examples call [https://customer.lululab.ai](https://customer.lululab.ai) and send the raw key in the Authorization header. [Get an API key](https://www.lululab.ai/keys)

Generation is asynchronous: POST /tasks returns a job id, then GET /tasks/\{id} provides status and output. You can call POST /billing/estimates before submitting to estimate credits.

This also has two steps. ProductImagePromptV1 creates a plan from product photos and verified facts. Read imagePrompts.cards from the returned output; some results add another output wrapper. Each card contains a prompt, title, and overlay suggestion. Submit an ImageGenV2 job for each card.

Use this flow for ecommerce detail images, social product cards, or a sequence of marketing images. Upload a clear product photo and provide the name, verified selling points, target country, and audience. The first step returns a text plan; the second step produces images.

### Step 1 fields and values

| Field / type | Required | Values and description |
| - | - | - |
| `input.productBrief.productName` (`string`) | Yes | Product name. |
| `input.productBrief.sellingPoints` (`string[]`) | Yes | Array of verified selling points. |
| `input.productBrief.targetCountry` (`string`) | Yes | Target country or region. |
| `input.productBrief.targetAudience` (`string`) | No | Target audience. |
| `input.productBrief.productImages` (`array<MediaReference>`) | Yes | At least one product image; use the uploaded location as url. |
| `input.creativeRequirement` (`string`) | No | Additional creative direction. |
| `input.userConfig.creativeMode` (`string`) | Yes | original · The first-batch planning mode is original. |
| `input.userConfig.cardsPerSet` (`integer`) | Yes | 1–10 · Number of cards in the set. |
| `input.userConfig.aspectRatio` (`string`) | Yes | 9:16 · 3:4 · 4:5 · 1:1 · 16:9 · Target ratio of the image plan. |
| `input.userConfig.targetLanguage` (`string`) | Yes | Target copy language, e.g. en-US. |
| `input.userConfig.storyStyle` (`string`) | Yes | storyDrivenCarousel · Current carousel story structure. |
| `input.userConfig.imageStyle` (`string`) | Yes | storyDrivenCarousel · Current carousel image structure. |
| `input.creatorBrief.creatorMode` (`string`) | Yes | none · provided · none for no creator; provided when creator reference images are supplied. |
| `input.creatorBrief.creatorImages` (`array<MediaReference>`) | No | Creator reference images when creatorMode is provided. |

### Step 1: plan the images

```bash Product image planning request theme={null}
curl -X POST https://customer.lululab.ai/tasks \
  -H "Authorization: $LULULAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "ProductImagePromptV1",
    "input": {
      "productBrief": {
        "productName": "Ceramic cup",
        "sellingPoints": ["Handmade finish"],
        "targetCountry": "United States",
        "targetAudience": "Coffee lovers",
        "productImages": [{ "url": "PRODUCT_IMAGE_URL", "mimeType": "image/jpeg" }]
      },
      "creativeRequirement": "Use only verified product facts.",
      "userConfig": {
        "creativeMode": "original",
        "cardsPerSet": 3,
        "aspectRatio": "9:16",
        "targetLanguage": "en-US",
        "storyStyle": "storyDrivenCarousel",
        "imageStyle": "storyDrivenCarousel"
      },
      "creatorBrief": { "creatorMode": "none", "creatorImages": [] }
    }
  }'
```

Read output.imagePrompts.cards after planning succeeds. Each card includes prompt, title, and textOverlay. Unwrap an extra output object if present.

```json Image plan response (key fields) theme={null}
{
  "status": "Succeeded",
  "output": {
    "imagePrompts": {
      "cards": [{
        "title": "Product hero",
        "prompt": "ONE_CARD_IMAGE_PROMPT",
        "textOverlay": "Handmade finish"
      }]
    }
  }
}
```

### Step 2 fields

Generate each card with a separate ImageGenV2 task. Set input.prompt to that card’s prompt; other fields are the same as the image generation API.

| Field / type | Required | Values and description |
| - | - | - |
| `input.model` (`string`) | Yes | gpt-image-2-5-sunburst · gpt-image-2-5-flare · Image model ID; see supported combinations below. |
| `input.prompt` (`string`) | Yes | 1–20,000 characters · Describe subject, composition, setting, and style. The site limits prompts to 20,000 characters. |
| `input.aspectRatio` (`string`) | Yes | 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 5:4 · 4:5 · 2:1 · 1:2 · 21:9 · 9:21 · Target aspect ratio supported by the selected model. |
| `input.resolution` (`string`) | Yes | 1K · 2K · 4K · Target resolution; combine with a ratio supported by the model. |
| `input.referenceImages` (`array<MediaReference>`) | No | Optional reference images. Omit for text-to-image; each item includes url and mimeType. |

### Step 2: generate each image

Replace PASTE\_ONE\_CARD\_PROMPT\_FROM\_PLAN with a card prompt. Submit one image job per card.

```bash Product image generation request theme={null}
curl -X POST https://customer.lululab.ai/tasks \
  -H "Authorization: $LULULAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflowId": "ImageGenV2",
    "input": {
      "model": "gpt-image-2-5-flare",
      "prompt": "PASTE_ONE_CARD_PROMPT_FROM_PLAN",
      "aspectRatio": "9:16",
      "resolution": "1K",
      "referenceImages": [{ "url": "PRODUCT_IMAGE_URL", "mimeType": "image/jpeg" }]
    },
    "attributes": { "saveGeneratedAssets": true, "creationSource": "api" }
  }'
```

> [!NOTE]
>
> Submit a separate generation job for each card and keep every job id. You can use the title and overlay suggestions in your own layout workflow.

* [Upload reference assets](https://docs.lululab.ai/uploads.md)
* [Get task results and troubleshoot](https://docs.lululab.ai/task-results.md)
* [API reference](https://docs.lululab.ai/reference.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.