The VisionStory AI Image Generation API creates or edits images from text prompts and optional reference media. The synchronous response returns an image URL that you can download or pass directly into an image-to-video workflow.
Beta. Any API key backed by an active Pro plan or above can call this endpoint. No separate capability allowlist is required.
AI image API endpoints
| Method | Path | What it does |
|---|---|---|
GET | /api/v1/image/models | List image models with sizes and per-image credit cost |
POST | /api/v1/image | Generate an image from a prompt (+ optional references) |
List image generation models
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" https://openapi.visionstory.ai/api/v1/image/models
Each model reports its aspect ratios, resolution choices and default, prompt-length limit, reference-image limit, and live pricing. credit_per_image is the price at the default resolution; credit_by_resolution gives the price for each supported resolution. Drive your integration from this endpoint rather than hardcoding capabilities or prices.
| Model | Resolution | Prompt limit | Reference images |
|---|---|---|---|
nano-banana-2 | 1K default; 1K or 2K | 5,000 characters | 4 |
nano-banana-pro | 1K default; 1K or 2K | 5,000 characters | 4 |
seedream-5.0-lite | 2K default; 2K or 4K | 3,000 characters | 14 |
seedream-5.0-pro | 1K default; 1K or 2K | 3,000 characters | 10 |
gpt-image-2.5-flare | 1K default; 1K or 2K | 5,000 characters | 6 |
gpt-image-2.5-sunburst | 1K default; 1K or 2K | 5,000 characters | 6 |
gpt-image-2 | 1K default; 1K or 2K | 5,000 characters | 6 |
All seven current models support 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9. Query GET /api/v1/image/models before every model-selection flow because availability, limits, defaults, and credit costs can change.
GPT Image is available through the API. Flare favors faster generation, Sunburst targets precise edits with longer processing, and GPT Image 2 is the previous-generation option. Quality is fixed per model; there is no public quality parameter. GPT Image reference images accept PNG, JPEG (including MPO), and WebP; BMP, TIFF, GIF, and HEIC are converted to PNG by the service. Unreadable references return code 37101.
Generate or edit an AI image
Send a model_id from the models endpoint and a prompt. You can add refs to guide style or subject, or to edit an image through prompt instructions without a mask. The accepted prompt length, resolution values, default resolution, and reference-image count all depend on the selected model.
curl -s -X POST -H "X-API-Key: $VISIONSTORY_API_KEY" -H "Content-Type: application/json" -d '{"model_id": "seedream-5.0-lite", "prompt": "A red panda barista in a cozy cafe, warm lighting", "aspect_ratio": "1:1", "resolution": "2K"}' https://openapi.visionstory.ai/api/v1/image
{
"data": {
"url": "https://cdn.visionstory.ai/example.png"
}
}
- Aspect ratio: use a value returned in
params.aspect_ratio.values; the current default is1:1. - Resolution: use
params.resolution.valuesandparams.resolution.default. In particular,seedream-5.0-litedoes not accept1K, whileseedream-5.0-prodoes not accept4K. - Prompt: stay within
params.prompt.max_lengthfor the selected model. - References: each entry uses
asset_id,url, orinline_data; stay within the selected model'sparams.refs.max. - Timeout: allow at least 180 seconds for GPT Image. The Python SDK, CLI, and local MCP use a minimum 180-second image request timeout and preserve a longer configured timeout. Do not automatically retry a timeout: the first request may still succeed and a repeat can incur another charge.
Use a generated image in a video
The returned url is a normal image URL — pass it straight into other endpoints, e.g. as first_frame or refs for AI Video:
{
"model_id": "seedance-2.0",
"prompt": "the scene gently comes alive, slow camera push-in",
"first_frame": {
"url": "https://cdn.visionstory.ai/example.png"
}
}
Billing, limits, and storage
- Not stored by default. The image is returned as a URL but not added to your asset library — upload it via
POST /api/v1/assetif you want a reusableasset_id. - Billing: charged only on success, using
credit_by_resolutionfor the selected resolution.credit_per_imageremains the default-resolution price. The current GPT Image examples show 2 credits for1Kand 3 for2K; read live prices before submitting. Other current models have the same price across their supported resolutions. - Validation: an unsupported resolution returns HTTP 400; exceeding the selected model's reference limit returns HTTP 422.
- Failures: moderation refusal returns HTTP 403 with code
37100; other upstream failures return HTTP 403 with code1. These failures happen before billing. - Concurrency: synchronous generation is capped at a few concurrent requests per key during beta; excess requests are rejected rather than queued.
Related VisionStory API guides
- AI Video — turn a generated image into video.
POST /api/v1/image— full request schema and error behavior.