Назад
docs/images

Image Generation

Create production-ready images from text prompts with one authenticated API call.

Overview

Image generation fits visual content workflows such as product concepts, campaign assets, and illustrations. Try it interactively in the Image Studio, or choose media units in photo packages.

Quick start

Use the same sk-ag-* API key accepted by the other API endpoints.

bash
curl https://api.aggregate.ai/v1/images/generations \
  -H "Authorization: Bearer sk-ag-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "image-standard",
    "prompt": "A sunlit glass greenhouse on Mars, botanical photography",
    "n": 1,
    "size": "1024x1024"
  }'

Request body

NameTypeRequiredDefaultDescription
modelstringyesImage model ID from the model catalog.
promptstringyesText description of the image.
nintegerno1Number of images. Values greater than 1 use an internal batch.
sizestringnomodel defaultRequested image dimensions, for example 1024x1024.
negative_promptstringnononeContent or visual qualities to avoid.
seedintegernorandomSeed for reproducible generation when supported by the model.

Response body

json
{
  "data": [{ "url": "https://.../image.png" }],
  "created": 1760000000
}

When an internal batch does not finish within the 60-second block-poll window, the endpoint returns 202 with { batch_id, status: "in_progress" }. Poll GET /v1/batches/{id} for the result.

Errors

400Invalid generation request or unsupported model.
402Insufficient units.
422Validation error in the request body.
500Upstream generation failure.

Pricing

Each generation consumes fixed media units determined by the selected model and media package. See photo package pricing.

Models

Use an image model whose public catalog modality is image. The available IDs and provider metadata are listed in Models (the catalog shape is normalized by frontend/src/lib/public-models.ts:13-18).

Endpoint schema: services/api-proxy/app/routers/images.py:69-83. Billing and media-package lookup: services/api-proxy/app/routers/images.py:99-159.

Image Generation | AggreGate AI Docs