image
API

Image Generation API

Generate images asynchronously with pricing preview, task polling, and optional reference assets.

What is Image Generation API?

Use the image generation API to preview cost, submit generation tasks, and retrieve results from the common task endpoint. Designed for task-based workflows rather than synchronous image responses.

Supported Models

Seedream 4.5

ByteDance's best image model

Model parameter support

Aspect ratio, resolution, and model-specific controls

Reference assets

Attach source images and refer to them in prompts

Quick Start

Bash
api.cheapaiapi.com/v1i
curl -X POST "https://api.cheapaiapi.com/v1i/task/generate-image" \
  -H "Authorization: Bearer sk_your_api_key" \
  -F 'prompt=A beautiful sunset over the ocean in watercolor style' \
  -F 'model_id=bytedance-seedream-4.5' \
  -F 'generations_count=1' \
  -F 'model_parameters={"aspect_ratio":"16:9","resolution":"2K"}'

Why CheapAI?

price_check

Price Before Generate

Estimate image cost before submitting the task.

schedule

Async Tasks

Poll the common task endpoint or use a webhook for completion.

image

Reference Assets

Upload source images and refer to them with prompt placeholders.

tune

Model Parameters

Use aspect ratio, resolution, and model-specific controls where available.

Async

Flow

Yes

Reference Images

Built In

Price Check

/v1/task/:id

Task Polling

Frequently Asked Questions

How do I know what a task will cost?expand_more

Call the image price endpoint first, then create the task once the returned credits are acceptable.

How do I get the final image URL?expand_more

Poll the common task endpoint and read metadata.result_images when the task status becomes done.

Can I use source images?expand_more

Yes. Upload reference assets and reference them in the prompt using the documented @img syntax.

Start Building Today

Get $2 in free credits. Create an API key, set spend controls if needed, and start testing the current task-based endpoints.

Get API Key arrow_forward