Introduction

The adcreator.ai API lets you generate AI product photos and videos, manage credits, upload reference images, and list your generations — all programmatically. It is a standard REST API that returns JSON responses.

Base URL

https://adcreator.ai/api/platform

All endpoints require an API key. You can create and manage keys in your Settings.


Authentication

Authenticate every request by including your API key in the Authorization header as a Bearer token.

Header
Authorization: Bearer sk_live_...

Create API keys in Settings → API Keys. Keys are shown only once at creation — store them securely. Requests without a valid key receive a 401 response.


Credits

GET/api/platform/credits

Retrieve your current credit balance and lifetime usage stats.

Response

FieldTypeDescription
balancenumberCurrent available credits
lifetimePurchasednumberTotal credits ever purchased
lifetimeUsednumberTotal credits ever consumed
unlimitedbooleanWhether the account has unlimited credits
Example response
{
  "balance": 142,
  "lifetimePurchased": 500,
  "lifetimeUsed": 358,
  "unlimited": false
}
200 OK

Models

GET/api/platform/models

List all available image generation models and supported aspect ratios.

Response

FieldTypeDescription
models[].idstringModel identifier to pass to /generate
models[].displayNamestringHuman-readable model name
models[].creditsCostnumberCredits consumed per image
models[].estimatedSecondsnumberApproximate generation time
models[].supportsImageInputbooleanWhether the model accepts a reference image
models[].maxWidthnumberMaximum output width in pixels
models[].maxHeightnumberMaximum output height in pixels
aspectRatios[].idstringRatio identifier, e.g. "1:1"
aspectRatios[].labelstringDisplay label, e.g. "Square"
aspectRatios[].widthnumberOutput width in pixels
aspectRatios[].heightnumberOutput height in pixels
200 OK

Video Models

GET/api/platform/video-models

List all available video generation models, durations, and credit costs.

Response

FieldTypeDescription
models[].idstringVideo model identifier
models[].displayNamestringHuman-readable name
models[].durationsnumber[]Supported durations in seconds
models[].creditsobjectCredits cost per duration (keyed by seconds)
models[].supportsAudiobooleanWhether model can generate audio
models[].supportsNegativePromptbooleanSupports negative prompt guidance
models[].supportsCfgScalebooleanSupports CFG scale parameter
200 OK

Styles

GET/api/platform/styles

List all available style presets. Pass a style id as the stylePreset parameter when generating an image.

Response

FieldTypeDescription
styles[].idstringStyle preset identifier
styles[].displayNamestringHuman-readable style name
styles[].categorystringStyle category, e.g. "product", "lifestyle"
styles[].promptSuffixstringThe prompt text appended for this style
200 OK

Upload

POST/api/platform/upload

Upload a reference image to use as input for image generation. Supports multipart/form-data (with a file field) or raw binary with the MIME type as Content-Type. Max file size: 10 MB. Allowed types: PNG, JPEG, WebP.

Response (201 Created)

FieldTypeDescription
pathstringStorage path — pass as inputImagePath to /generate
publicUrlstringPublic URL of the uploaded image
curl — multipart upload
curl -X POST https://adcreator.ai/api/platform/upload \
  -H "Authorization: Bearer sk_live_..." \
  -F "file=@product.jpg"
Example response
{
  "path": "user_123/1709012345-a1b2c3.jpg",
  "publicUrl": "https://...supabase.co/storage/v1/.../product.jpg"
}
201 Created400 Bad Request

Generate Image

POST/api/platform/generate

Start an image generation job. Returns immediately with a 202 Accepted status. Poll GET /generations/:id for the result.

Request Body (JSON)

FieldTypeDescription
promptstringGeneration prompt (3–1000 characters). Required.
modelIdstringModel ID from /models. Required.
aspectRatiostringAspect ratio from /models, e.g. "1:1". Default: "1:1".
stylePresetstringStyle ID from /styles. Optional.
negativePromptstringNegative prompt (max 500 chars). Optional.
inputImagePathstringStorage path from /upload. Optional.
batchCountnumberNumber of images to generate (1–4). Default: 1.

Response (202 Accepted)

FieldTypeDescription
idstringGeneration ID for polling
statusstring"processing"
curl — generate an image
curl -X POST https://adcreator.ai/api/platform/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Luxury perfume bottle on marble surface, soft studio lighting",
    "modelId": "nano-banana-2",
    "aspectRatio": "1:1",
    "stylePreset": "studio-product"
  }'
Example response
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "processing"
}
202 Accepted400 Validation Error422 Generation Failed

List Generations

GET/api/platform/generations

Retrieve a paginated list of your image generations.

Query Parameters

FieldTypeDescription
limitnumberMax results to return (default: 50)
offsetnumberNumber of results to skip (default: 0)

Response

Returns an array of generation objects with id, status, prompt, model_id, image_url, created_at, and more.

200 OK

Get Generation

GET/api/platform/generations/:id

Retrieve a single generation by ID. Use this to poll for completion after starting a generation.

Response

FieldTypeDescription
generation.idstringGeneration UUID
generation.statusstring"processing", "completed", or "failed"
generation.promptstringThe prompt used
generation.image_urlstring | nullPublic URL of the generated image (null while processing)
generation.model_idstringModel used for generation
generation.created_atstringISO 8601 timestamp
curl — poll for completion
curl https://adcreator.ai/api/platform/generations/GEN_ID \
  -H "Authorization: Bearer sk_live_..."
200 OK404 Not Found

Delete Generation

DELETE/api/platform/generations/:id

Permanently delete a generation and its associated image.

Response

FieldTypeDescription
deletedbooleantrue on success
200 OK404 Not Found

Generate Video

POST/api/platform/videos

Start a video generation from an existing image generation. Returns 202 Accepted. Poll GET /videos/:id for the result.

Request Body (JSON)

FieldTypeDescription
sourceGenerationIdstring (UUID)ID of an existing image generation. Required.
promptstringVideo prompt (3–1000 characters). Required.
modelIdstringVideo model ID from /video-models. Required.
durationSecondsnumberDuration in seconds (2–15). Required.
generateAudiobooleanGenerate audio track. Optional.
negativePromptstringNegative prompt (max 2500 chars). Optional.
cfgScalenumberCFG scale 0–1. Optional.
movementAmplitudestring"auto", "small", "medium", or "large". Optional.
resolutionstring"720p" or "1080p". Optional.
bgmbooleanAdd background music. Optional.

Response (202 Accepted)

FieldTypeDescription
idstringVideo generation ID for polling
statusstring"processing"
curl — generate video from an image
curl -X POST https://adcreator.ai/api/platform/videos \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "sourceGenerationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "prompt": "Smooth camera orbit around the product",
    "modelId": "kling-v3-pro",
    "durationSeconds": 5
  }'
202 Accepted400 Validation Error422 Generation Failed

Get Video

GET/api/platform/videos/:id

Retrieve a single video generation by ID. Use this to poll for video completion.

Response

FieldTypeDescription
video.idstringVideo generation UUID
video.statusstring"processing", "completed", or "failed"
video.video_urlstring | nullPublic URL of the generated video (null while processing)
video.model_idstringVideo model used
video.duration_secondsnumberRequested duration
video.created_atstringISO 8601 timestamp
curl — poll video status
curl https://adcreator.ai/api/platform/videos/VIDEO_ID \
  -H "Authorization: Bearer sk_live_..."
200 OK404 Not Found