Generate an image from a text prompt, optionally guided by reference images (asset_id / url / inline_data; the per-model limit is params.refs.max in GET /api/v1/image/models). Editing works through instructions in the prompt plus reference images — no mask needed. Synchronous: the response contains the image URL directly, and you can pass that URL straight into other endpoints (video refs, first_frame/end_frame). GPT Image models are slower (often 20–60 seconds) — set a client timeout of at least 3 minutes. It is not added to your asset library — use POST /api/v1/asset if you want to keep it there. Credits are charged per image, only on success; some models are priced per resolution (credit_by_resolution). Per-key concurrency is limited during beta; requests beyond the limit are rejected, not queued.
Headers
X-API-KeystringrequiredYour VisionStory API key (sk-vs-...), kept server-side. Create or manage keys in API keys (Pro plan and up).
Request body
application/jsonrequiredaspect_ratiostring | nullnullableAspect ratio such as 1:1 / 16:9 / 9:16; defaults to 1:1
model_idstringrequiredModel id, check GET /api/v1/image/models
promptstringrequiredText prompt; also carries edit instructions when refs are given
refsMediaRef[] | nullnullableReference images (asset_id / url / inline_data). The limit differs per model — read params.refs.max from GET /api/v1/image/models (4 for nano-banana-*, 6 for gpt-image-*, 10 for seedream-5.0-pro, 14 for seedream-5.0-lite).
asset_idstring | nullnullableAsset ID from POST /api/v1/asset; use for materials reused across requests.
inline_dataInlineDataModel | nullnullableInline base64 media data for one-off use; not added to your asset library. Images: image/jpeg, image/jpg, image/png, image/webp, image/bmp, image/tiff, image/gif; audio: audio/wav, audio/x-wav, audio/wave, audio/mpeg, audio/mp3; video: video/mp4, video/quicktime, video/mov.
datastringrequiredThe file's raw bytes encoded as a base64 string (no data: URI prefix).
mime_typestringrequiredMIME type of the inline data; the gateway uses it to tell image / audio / video apart. The accepted set depends on the endpoint — see the field carrying this object. Talking video accepts audio ['audio/avi', 'audio/mpeg', 'audio/mp3', 'audio/mp4', 'audio/m4a', 'audio/wav'] and images ['image/jpeg', 'image/jpg', 'image/png', 'image/webp', 'image/heic'].
urlstring | nullnullablePublicly accessible media URL for one-off use; not added to your asset library.
resolutionstring | nullnullableOutput resolution tier. Supported tiers and the default differ per model — read params.resolution from GET /api/v1/image/models. Some models are priced per tier (credit_by_resolution).
Responses
200Successful Response
application/json
dataCreateImageResponse | nullrequirednullableThe endpoint-specific payload. See this endpoint's response schema for its fields; null only when the operation returns no payload.
cost_creditintegerCredits charged for this image
heightintegerPixel height
model_idstringModel id used
urlstringrequiredCDN URL of the generated PNG; pass it directly as a ref or first/last frame elsewhere
widthintegerPixel width
messagestringHuman-readable status message; "success" on a successful call.
server_timestring · date-timerequiredServer-side timestamp when the response was produced, in ISO 8601 format (UTC).
defaultError response. All failures share one envelope: an error object with a numeric code, a human-readable message, an optional details string, and an optional hint giving an actionable next step (useful for AI agents).
application/json
errorErrorDetailrequiredcodeintegerrequiredMachine-readable error code. Mirrors the HTTP status for transport-level failures (e.g. 401, 404, 422, 500) and may carry a business-specific code otherwise.
detailsstring | nullnullableOptional structured detail about the failure, e.g. a JSON string of per-field validation errors on a 422. Absent when there is nothing extra to report.
hintstring | nullnullableActionable next step for resolving the error, written for both humans and AI agents (e.g. how to fix the request, or where to obtain an API key). May be absent.
messagestringrequiredHuman-readable explanation of what went wrong. Safe to log or surface to end users; not localized.