Image Generation
Generate AI images from text prompts, product photography, and image edits.
POST /images/text-to-image
Generate one or more images from a text prompt.
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | -- | A description of the image to generate. |
model | string | Yes | -- | "fast" or "pro". |
aspect_ratio | string | Yes | -- | Aspect ratio of the output (e.g. "1:1", "16:9", "9:16"). |
quantity | number | No | 1 | Number of images to generate (1--8). |
resolution | string | No | "1k" | Output resolution: "1k", "2k", or "4k". |
Credit Costs
Credits are charged per image and multiplied by quantity.
| Model | 1K | 2K | 4K |
|---|---|---|---|
| Fast | 1 | 2 | 2 |
| Pro | 2 | 2 | 4 |
For example, generating 4 images with the Pro model at 4K resolution costs 4 x 4 = 16 credits.
Examples
curl -X POST https://www.adsumo.ai/api/v1/images/text-to-image \
-H "Authorization: Bearer adsumo_sk_..." \
-H "Content-Type: application/json" \
-d '{
"prompt": "A minimalist product shot of white sneakers on a marble surface, soft studio lighting",
"model": "pro",
"aspect_ratio": "1:1",
"quantity": 2,
"resolution": "2k"
}'POST /images/product-shots
Generate styled product photography using an existing product and a style template.
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
product_id | string | Yes | -- | UUID of the product in your account. |
style_id | string | Yes | -- | Style template ID to apply. |
model | string | Yes | -- | "fast" or "pro". |
aspect_ratio | string | Yes | -- | Aspect ratio of the output (e.g. "1:1", "16:9", "9:16"). |
quantity | number | No | 1 | Number of images to generate (1--8). |
resolution | string | No | "1k" | Output resolution: "1k", "2k", or "4k". |
additional_prompt | string | No | -- | Extra style guidance appended to the template prompt. |
Example Request
curl -X POST https://www.adsumo.ai/api/v1/images/product-shots \
-H "Authorization: Bearer adsumo_sk_..." \
-H "Content-Type: application/json" \
-d '{
"product_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"style_id": "lifestyle-outdoor",
"model": "pro",
"aspect_ratio": "16:9",
"quantity": 4,
"resolution": "2k",
"additional_prompt": "Golden hour lighting, beach setting"
}'Credit costs follow the same table as text-to-image, multiplied by quantity.
POST /images/edit
Edit or transform images using AI with one or more reference images.
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | -- | A description of the desired edit. |
model | string | Yes | -- | "fast" or "pro". |
aspect_ratio | string | Yes | -- | Aspect ratio of the output (e.g. "1:1", "16:9", "9:16"). |
reference_image_urls | string[] | Yes | -- | Array of URLs for reference images to use in the edit. |
quantity | number | No | 1 | Number of output images to generate (1--8). |
resolution | string | No | "1k" | Output resolution: "1k", "2k", or "4k". |
Example Request
curl -X POST https://www.adsumo.ai/api/v1/images/edit \
-H "Authorization: Bearer adsumo_sk_..." \
-H "Content-Type: application/json" \
-d '{
"prompt": "Remove the background and place the product on a clean white surface",
"model": "fast",
"aspect_ratio": "1:1",
"reference_image_urls": [
"https://example.com/images/product-photo.png"
],
"quantity": 1,
"resolution": "1k"
}'Credit costs follow the same table as text-to-image, multiplied by quantity.
Response Format
All three endpoints return the same response structure on success (HTTP 202):
{
"generation_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"type": "text-to-image",
"status": "processing"
}The type field reflects the endpoint called ("text-to-image", "product-shots", or "edit").
Polling for Results
Image generation is asynchronous. After submitting a request, poll the generation status endpoint:
GET /generations/{generation_id}When processing is complete, the response includes a result_url field with a link to the generated image:
{
"generation_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"type": "text-to-image",
"status": "completed",
"result_url": "https://cdn.adsumo.ai/generations/f47ac10b.png",
"created_at": "2026-03-17T12:00:00Z",
"completed_at": "2026-03-17T12:00:12Z"
}If the generation fails, status will be "failed" and an error field will describe the issue.
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid request body or parameters. |
| 401 | Missing or invalid API key. |
| 402 | Insufficient credits for the requested generation. |
| 404 | Product or style not found. |
| 429 | Rate limit exceeded. |
| 500 | Internal server error. |