Apply for access
Sign in to the developer console and describe your use case.

DEVELOPER DOCUMENTATION · V1.0
https://www.fusionai.tvUse GET /v1/models for currently published API models, supported video operations and account pricing. Only models explicitly published for the API can be called.
Sign in with your FusionAI account. After your access is approved, create your own API key.
Sign in to the developer console and describe your use case.
After approval, create a key starting with sk-fusion-.
Send a Bearer token in the request header.
Prefer a ready-to-run client? Explore FusionAI Skills: image generation, reference editing and tested product-photo workflows.
| Transport | HTTPS only |
|---|---|
| Authentication | Authorization: Bearer $FUSIONAI_API_KEY |
| JSON requests | Content-Type: application/json |
| File uploads | multipart/form-data, with a recommended maximum request size of 100 MB |
| Timeout | Image generation may take several minutes. A 10-minute client timeout is recommended. |
| Request tracing | The X-Request-Id response header helps identify requests and troubleshoot issues. |
Models currently published in the Open API catalog. Availability is independent of the website workspace.
gpt-image-2Image generation and editing
gemini-3-pro-imageImage generation and editing
gpt-image-2.5-flareImage generation and editing
gemini-3.1-flash-imageImage generation and editing
gpt-image-2.5-sunburstImage generation and editing
gemini-3.1-flash-lite-imageImage generation and editing
midjourneyImage generation
/v1/modelscurl "https://www.fusionai.tv/v1/models" \
-H "Authorization: Bearer $FUSIONAI_API_KEY"Response example
{
"object": "list",
"data": [
{
"id": "gpt-image-2",
"object": "model",
"display_name": "GPT Image 2",
"protocol": "openai-images",
"capabilities": { "resolutions": ["1K", "2K", "4K"] }
}
]
}All model interfaces use the same API key authentication.
Authorization: Bearer sk-fusion-xxxxxxxxxxxxxxxxxxxxxxxxKeys are bound to a developer account. A disabled key, disabled account or unapproved account returns 401 invalid_api_key. Keep separate keys for testing, production and different workloads; the existing account limit is five active keys.
Use JSON requests for GPT Image 2, GPT Image 2.5 Flare and GPT Image 2.5 Sunburst.
/v1/images/generations| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | gpt-image-2、gpt-image-2.5-flare or gpt-image-2.5-sunburst |
prompt | string | Yes | Image description or editing instruction |
n | integer | No | Currently recommended: 1 |
size | string | No | auto or WIDTHxHEIGHT, for example 2048x2048 |
quality | string | No | auto、low、medium、high; GPT Image 2.5 also supports xhigh (extra high), max (maximum) |
resolution | string | Recommended | Billing and provider-key routing resolution: 1K、2K、4K. When omitted, infer it from size; autouses 1K |
output_format | string | No | Fixed value: png |
response_format | string | No | b64_json or url |
curl "https://www.fusionai.tv/v1/images/generations" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A premium skincare bottle on white marble, studio lighting",
"n": 1,
"size": "2048x2048",
"resolution": "2K",
"quality": "high",
"output_format": "png",
"response_format": "b64_json"
}'const response = await fetch('https://www.fusionai.tv/v1/images/generations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.FUSIONAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ model: 'gpt-image-2', prompt: 'A product poster', size: '1024x1024', resolution: '1K', response_format: 'b64_json' })
});
if (!response.ok) throw new Error(await response.text());
const result = await response.json();
console.log(result.data[0].b64_json);{
"created": 1786400000,
"data": [{ "b64_json": "iVBORw0KGgoAAA..." }]
}Upload one or more reference images and an optional mask.
/v1/images/editsmultipart/form-data| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | gpt-image-2、gpt-image-2.5-flare or gpt-image-2.5-sunburst |
prompt | string | Yes | Editing instruction |
image[] | file | Yes | Reference images; repeat the field for multiple files. Up to four is recommended. |
mask | file | No | PNG mask; transparent regions mark the area to edit. |
size | string | No | auto or custom width and height |
resolution | string | Recommended | 1K、2K or 4K, used for billing and key routing |
quality | string | No | auto、low、medium、high; GPT Image 2.5 also supports xhigh (extra high), max (maximum) |
response_format | string | No | b64_json or url |
curl "https://www.fusionai.tv/v1/images/edits" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-F "model=gpt-image-2" \
-F "prompt=Replace the background with a minimal luxury showroom" \
-F "image[]=@product.png" \
-F "mask=@mask.png" \
-F "size=2048x2048" \
-F "resolution=2K" \
-F "quality=high" \
-F "response_format=b64_json"Use the Images API JSON format for text-to-image and reference editing with accessible image URLs.
/v1/images/generationsapplication/json| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed value: grok-imagine-image-quality |
prompt | string | Yes | Describe the subject, setting, composition, lighting and style. |
n | integer | No | Output count from 1 to 10 |
aspect_ratio | string | No | 1:1、16:9、9:16、4:3、3:4 |
resolution | string | No | 1k or 2k |
response_format | string | No | url or b64_json |
curl "https://www.fusionai.tv/v1/images/generations" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-quality",
"prompt": "A luxury perfume campaign, dramatic studio light",
"n": 1,
"aspect_ratio": "4:3",
"resolution": "2k",
"response_format": "url"
}'/v1/images/editsapplication/jsonPlace reference images in the images array. Images must be accessible HTTPS URLs. Up to four is recommended.
curl "https://www.fusionai.tv/v1/images/edits" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-quality",
"prompt": "Keep the product unchanged and replace the background with a luxury showroom",
"images": [
{ "type": "image_url", "url": "https://example.com/product.png" }
],
"n": 1,
"resolution": "2k",
"response_format": "url"
}'URL response example
{
"created": 1786400000,
"data": [{ "url": "https://example.com/generated-image.png" }]
}Submit a prompt and poll the task status. Each successful task returns four candidate images.
/v1/midjourney/imagineapplication/json| Field | Type | Required | Description |
|---|---|---|---|
model | string | No | Fixed value: midjourney; used automatically when omitted |
prompt | string | Yes | Image description, up to 6,000 characters. An existing --ar is overridden by aspect_ratio. |
aspect_ratio | string | No | 1:1、16:9、9:16、4:3、3:4、3:2、2:3; default: 1:1 |
curl "https://www.fusionai.tv/v1/midjourney/imagine" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "midjourney",
"prompt": "A futuristic fashion campaign in Shanghai, cinematic lighting",
"aspect_ratio": "3:2"
}'Submission response (HTTP 202)
{
"id": "req_7f2b1d6f03c84d679bfe2a8c",
"object": "image.generation.task",
"model": "midjourney",
"status": "queued",
"progress": 0,
"created_at": "2026-09-17T06:30:00.000Z"
}/v1/midjourney/tasks/{task_id}Poll every 3–5 seconds. status may be queued、processing、succeeded or failed. The reserved charge is refunded if the task fails.
curl "https://www.fusionai.tv/v1/midjourney/tasks/req_7f2b1d6f03c84d679bfe2a8c" \
-H "Authorization: Bearer $FUSIONAI_API_KEY"Successful response
{
"id": "req_7f2b1d6f03c84d679bfe2a8c",
"object": "image.generation.task",
"model": "midjourney",
"status": "succeeded",
"progress": 100,
"data": [
{ "url": "https://example.com/candidate-1.png" },
{ "url": "https://example.com/candidate-2.png" },
{ "url": "https://example.com/candidate-3.png" },
{ "url": "https://example.com/candidate-4.png" }
]
}Use the native generateContent request format. Text and references are supplied in parts。
/v1beta/models/{model}:generateContent| Field | Type | Required | Description |
|---|---|---|---|
model | path | Yes | A Gemini model ID from the console catalog |
contents | array | Yes | Conversation contents, normally with a user role |
parts[].text | string | Yes | Generation or editing instruction |
parts[].inlineData | object | No | Reference image with mimeType and raw Base64 data |
generationConfig.responseModalities | array | Yes | For image generation, use ["IMAGE"] |
generationConfig.imageConfig.aspectRatio | string | No | 1:1、2:3、3:2、3:4、4:3、4:5、5:4、9:16、16:9、21:9 |
generationConfig.imageConfig.imageSize | string | No | Use a size supported by the selected model: 512、1K、2K or 4K |
curl "https://www.fusionai.tv/v1beta/models/gemini-3.1-flash-image:generateContent" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role":"user","parts":[{"text":"Generate a cinematic product poster"}]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio":"16:9","imageSize":"1K"}
}
}'{
"contents": [{
"role": "user",
"parts": [
{ "text": "Keep the product unchanged and replace the background" },
{ "inlineData": { "mimeType": "image/png", "data": "BASE64_WITHOUT_DATA_URL_PREFIX" } }
]
}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": { "aspectRatio": "1:1", "imageSize": "2K" }
}
}{
"candidates": [{
"content": {
"role": "model",
"parts": [{ "inlineData": { "mimeType": "image/png", "data": "iVBORw0KGgoAAA..." } }]
},
"finishReason": "STOP"
}]
}Requests are billed using their settings and the CNY prices configured in the platform.
One API key, a published video catalog and account-specific per-second pricing.
/v1/videos| Parameter | Type | Description |
|---|---|---|
model | string | Required. Use a published video model ID from /v1/models; do not assume every workbench model is available. |
prompt | string | Required. Describe the subject, action, setting and camera movement. Follow the returned prompt limits. |
mode | string | text_to_video (default), image_to_video, first_last_frame or reference_images. Check capabilities.operations for supported modes. |
seconds | integer | Output duration. Use durationsByQuality[quality] or durations for the selected operation; defaults to defaultDuration. |
quality | string | Use an exact value from the selected operation qualities; defaults to defaultQuality. |
aspect_ratio | string | An enabled aspect ratio; defaults to defaultRatio. |
audio | boolean | Default false. true requires supportsAudio and uses the separate quality:audio price. |
reference_images | string[] | Public HTTPS image URLs in order. Text: none; image: at least one; first/last: exactly two, first then last. Other limits follow the selected operation. Local files and Base64 are not accepted. |
First call GET /v1/models. Replace PUBLISHED_VIDEO_MODEL_ID with a returned model whose protocol is video-async. Leaving optional parameters out uses that model’s defaults.
curl "https://www.fusionai.tv/v1/videos" \
-H "Authorization: Bearer $FUSIONAI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: product-video-001" \
-d '{"model":"PUBLISHED_VIDEO_MODEL_ID","prompt":"A slow camera orbit around a ceramic cup in warm studio light","mode":"text_to_video"}'Use a unique Idempotency-Key for each new video. Retrying the same key with the same normalized parameters returns the existing task without another charge. Changed parameters return 409. If a request times out or needs_attention is true, reuse the key and contact support with the task ID; do not create a new paid request.
{
"id": "vid_TASK_ID",
"object": "video.generation.task",
"model": "PUBLISHED_VIDEO_MODEL_ID",
"status": "processing",
"created_at": "2026-11-24T00:00:00.000Z"
}/v1/videos/{task_id}curl "https://www.fusionai.tv/v1/videos/vid_TASK_ID" \
-H "Authorization: Bearer $FUSIONAI_API_KEY"Poll about every 10 seconds. Pending tasks return HTTP 202 (queued or processing); terminal tasks return HTTP 200 (completed or failed). Tasks can only be queried by their owning API account. Model unpublishing does not prevent retrieval of an existing task.
{
"id": "vid_TASK_ID",
"object": "video.generation.task",
"model": "PUBLISHED_VIDEO_MODEL_ID",
"status": "completed",
"data": [
{
"url": "https://fusionaitv.oss-cn-hongkong.aliyuncs.com/open-api/example/video.mp4"
}
]
}The selected quality:silent or quality:audio unit price × output seconds is reserved from the separate API wallet on submission, with the account discount or model-specific rate applied. Confirmed generation failures are refunded once. Status checks do not charge generation fees. Transient query or storage failures remain processing and are retried; they do not trigger a new generation. Completed videos are stored in FusionAI international OSS before the result URL is returned.
Non-2xx responses return a JSON error object.
| HTTP | type | Meaning | Recommended |
|---|---|---|---|
| 401 | invalid_api_key | Invalid or disabled key, or unavailable account | Check the Authorization header and account status |
| 402 | insufficient_balance | Insufficient account balance | Add funds before retrying |
| 403 | model_not_allowed | Model is unpublished or the protocol does not match | Query the model catalog again |
| 403 | model_not_priced | This specification has no configured price | Change the specification or contact an administrator |
| 405 | method_not_allowed | HTTP method not supported | Use the documented HTTP method |
| 502 | upstream_unavailable | Model service temporarily unavailable | Retry with exponential backoff |
| 503 | provider_not_configured | Provider configuration unavailable | Contact the platform administrator |
Error response example
{
"error": {
"code": 402,
"type": "insufficient_balance",
"status": "INSUFFICIENT_BALANCE",
"message": "Insufficient account balance"
}
}