Image Generation
Generate or edit images from a text prompt, optionally guided by reference images. The endpoint is synchronous — the response carries the finished image URL.
Beta. This endpoint is in beta and may change. Available to any account with an active paid subscription — no separate allowlisting.
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) |
Discover models
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" https://openapi.visionstory.ai/api/v1/image/modelsEach model reports its aspect ratios, resolutions, reference-image limit, and price (credit_per_image at the default resolution, plus credit_by_resolution). Current models:
model_id |
Best for | Resolutions |
|---|---|---|
nano-banana-2 |
Balanced quality and speed, strong instruction-following edits | 1K (default), 2K |
nano-banana-pro |
Highest quality tier, detailed scenes | 1K (default), 2K |
seedream-5.0-lite |
Fast and economical; 4K costs the same as 2K | 2K (default), 4K |
seedream-5.0-pro |
Higher-fidelity Seedream tier | 1K (default), 2K |
gpt-image-2.5-flare |
OpenAI GPT Image 2.5, fast high-quality generation and edits | 1K (default), 2K |
gpt-image-2.5-sunburst |
OpenAI GPT Image 2.5, most capable for precise edits; slower than Flare | 1K (default), 2K |
gpt-image-2 |
OpenAI GPT Image 2, previous generation | 1K (default), 2K |
Reference-image limits differ too: 4 for nano-banana-*, 6 for gpt-image-*, 10 for seedream-5.0-pro, 14 for seedream-5.0-lite (params.refs.max).
Some models are priced per resolution. The gpt-image-* models cost more at 2K than at 1K; read credit_by_resolution from this endpoint. For the other models every resolution has the same price. The cost_credit in the generation response is always what was actually charged.
GPT Image models are slower — typically 20–60 seconds, occasionally up to 3 minutes, and a prompt rejected by content moderation can take about 45 seconds to come back. Set your client timeout to at least 3 minutes for these models.
Resolutions differ per model — seedream-5.0-lite has no 1K tier and seedream-5.0-pro has no 4K tier, so read params.resolution from this endpoint rather than hardcoding 1K. Omit resolution and each model uses its own default. The legacy nano-banana request ID remains accepted and routes to nano-banana-2 at the same live price.
Generate an image
Send a model_id (from the models endpoint) and a prompt. Optionally add refs (reference images) to guide style or subject, or to edit — editing works through instructions in the prompt plus reference images, no mask needed.
curl -s -X POST -H "X-API-Key: $VISIONSTORY_API_KEY" -H "Content-Type: application/json" -d '{"model_id": "nano-banana-2", "prompt": "A red panda barista in a cozy cafe, warm lighting", "aspect_ratio": "1:1", "resolution": "1K"}' https://openapi.visionstory.ai/api/v1/image{
"data": {
"url": "https://cdn.visionstory.ai/example.png"
}
}- Aspect ratio: one of
1:1(default) /2:3/3:2/3:4/4:3/4:5/5:4/9:16/16:9/21:9. - Resolution: per model — see the table above, or
params.resolutionfrom the models endpoint.gpt-image-*models support1Kand2Konly. - References: per model — 4 for
nano-banana-*, 6 forgpt-image-*, 10 forseedream-5.0-pro, 14 forseedream-5.0-lite; eachasset_id/url/inline_data. - Prompt length:
params.prompt.max_lengthper model (5000 characters fornano-banana-*, 3000 forseedream-*).
Chain into 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"
}
}Notes
- 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: credits per image at the resolution you request (see
credit_by_resolutionfrom the models endpoint), charged only on success. Thecost_creditin the response is the amount actually charged. - Concurrency: synchronous generation is capped at a few concurrent requests per key during beta; excess requests are rejected rather than queued.
Next steps
- AI Video — turn a generated image into video.
- API reference — full request schema and error codes.