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

ParameterTypeRequiredDefaultDescription
promptstringYes--A description of the image to generate.
modelstringYes--"fast" or "pro".
aspect_ratiostringYes--Aspect ratio of the output (e.g. "1:1", "16:9", "9:16").
quantitynumberNo1Number of images to generate (1--8).
resolutionstringNo"1k"Output resolution: "1k", "2k", or "4k".

Credit Costs

Credits are charged per image and multiplied by quantity.

Model1K2K4K
Fast122
Pro224

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

ParameterTypeRequiredDefaultDescription
product_idstringYes--UUID of the product in your account.
style_idstringYes--Style template ID to apply.
modelstringYes--"fast" or "pro".
aspect_ratiostringYes--Aspect ratio of the output (e.g. "1:1", "16:9", "9:16").
quantitynumberNo1Number of images to generate (1--8).
resolutionstringNo"1k"Output resolution: "1k", "2k", or "4k".
additional_promptstringNo--Extra style guidance appended to the template prompt.

Example Request

cURL
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

ParameterTypeRequiredDefaultDescription
promptstringYes--A description of the desired edit.
modelstringYes--"fast" or "pro".
aspect_ratiostringYes--Aspect ratio of the output (e.g. "1:1", "16:9", "9:16").
reference_image_urlsstring[]Yes--Array of URLs for reference images to use in the edit.
quantitynumberNo1Number of output images to generate (1--8).
resolutionstringNo"1k"Output resolution: "1k", "2k", or "4k".

Example Request

cURL
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):

JSON
{
  "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:

text
GET /generations/{generation_id}

When processing is complete, the response includes a result_url field with a link to the generated image:

JSON
{
  "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 CodeDescription
400Invalid request body or parameters.
401Missing or invalid API key.
402Insufficient credits for the requested generation.
404Product or style not found.
429Rate limit exceeded.
500Internal server error.