アクセスを申し込む
デベロッパー コンソールにサインインし、使用例を説明してください。

開発者向けドキュメント · 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.
FusionAI アカウントでサインインします。 アクセスが承認されたら、独自の API キーを作成します。
デベロッパー コンソールにサインインし、使用例を説明してください。
承認後、 で始まるキーを作成します sk-fusion-.
リクエスト ヘッダーでベアラー トークンを送信します。
Prefer a ready-to-run client? Explore FusionAI Skills: image generation, reference editing and tested product-photo workflows.
| 輸送 | HTTPS のみ |
|---|---|
| 認証 | Authorization: Bearer $FUSIONAI_API_KEY |
| JSON リクエスト | Content-Type: application/json |
| ファイルのアップロード | multipart/form-data、推奨される最大リクエスト サイズは 100 MB です。 |
| タイムアウト | 画像の生成には数分かかる場合があります。 10分のクライアント タイムアウトをお勧めします。 |
| トレースをリクエストします | というもの X-Request-Id レスポンスヘッダーはリクエストの識別や問題のトラブルシューティングに役立ちます。 |
現在 公開 API カタログに掲載されているモデル。 可用性は、Web サイト ワークスペースとは無関係です。
gpt-image-2画像の生成と編集
gemini-3-pro-image画像の生成と編集
gpt-image-2.5-flare画像の生成と編集
gemini-3.1-flash-image画像の生成と編集
gpt-image-2.5-sunburst画像の生成と編集
gemini-3.1-flash-lite-image画像の生成と編集
midjourney画像生成
/v1/modelscurl "https://www.fusionai.tv/v1/models" \
-H "Authorization: Bearer $FUSIONAI_API_KEY"応答例
{
"object": "list",
"data": [
{
"id": "gpt-image-2",
"object": "model",
"display_name": "GPT Image 2",
"protocol": "openai-images",
"capabilities": { "resolutions": ["1K", "2K", "4K"] }
}
]
}すべてのモデル インターフェイスは、同じ API キー認証を使用します。
Authorization: Bearer sk-fusion-xxxxxxxxxxxxxxxxxxxxxxxxキーはデベロッパー アカウントにバインドされています。 無効なキー、無効なアカウント、または承認されていないアカウントが返されます 401 invalid_api_key。 テスト、本番環境、さまざまなワークロード用に別のキーを保持します。 既存のアカウント制限は 5 つのアクティブ キーです。
GPT Image 2、GPT Image 2.5 Flare、および GPT Image 2.5 Sunburst の JSON リクエストを使用します。
/v1/images/generations| フィールド | タイプ | 必須 | デスクリプション |
|---|---|---|---|
model | ストリング | はい | gpt-image-2、gpt-image-2.5-flare 又は gpt-image-2.5-sunburst |
prompt | ストリング | はい | 画像の説明または編集手順 |
n | 整数 | いいえ | 現在推奨されている: 1 |
size | ストリング | いいえ | auto 又は WIDTHxHEIGHT、たとえば 2048x2048 |
quality | ストリング | いいえ | auto、low、medium、high; GPT Image 2.5 もサポートしています xhigh (非常に高い)、 max (最大) |
resolution | ストリング | 推奨 | 課金とプロバイダ キーのルーティングの解決方法: 1K、2K、4K。 省略された場合は、 から推測してください size; auto1Kを使用 |
output_format | ストリング | いいえ | 固定値: png |
response_format | ストリング | いいえ | b64_json 又は 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..." }]
}1 つ以上の参照画像とオプションのマスクをアップロードします。
/v1/images/editsマルチパート/フォーム データ| フィールド | タイプ | 必須 | デスクリプション |
|---|---|---|---|
model | ストリング | はい | gpt-image-2、gpt-image-2.5-flare 又は gpt-image-2.5-sunburst |
prompt | ストリング | はい | 編集指示 |
image[] | ファイル | はい | 参照画像; 複数のファイルに対してフィールドを繰り返します。 4 つまでが推奨されます。 |
mask | ファイル | いいえ | PNGマスク; 透明なリージョンは、編集する領域をマークします。 |
size | ストリング | いいえ | auto またはカスタム幅と高さ |
resolution | ストリング | 推奨 | 1K、2K 又は 4K、請求およびキー ルーティングに使用されます |
quality | ストリング | いいえ | auto、low、medium、high; GPT Image 2.5 もサポートしています xhigh (非常に高い)、 max (最大) |
response_format | ストリング | いいえ | b64_json 又は 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"画像 API JSON 形式の画像を使用して、画像へのテキストと画像の編集、およびアクセス可能な画像 URL による参照編集を使用します。
/v1/images/generationsアプリケーション/JSON| フィールド | タイプ | 必須 | デスクリプション |
|---|---|---|---|
model | ストリング | はい | 固定値: grok-imagine-image-quality |
prompt | ストリング | はい | 主題、設定、構図、照明、スタイルを説明してください。 |
n | 整数 | いいえ | からの出力カウント 1 に 10 |
aspect_ratio | ストリング | いいえ | 1:1、16:9、9:16、4:3、3:4 |
resolution | ストリング | いいえ | 1k 又は 2k |
response_format | ストリング | いいえ | url 又は 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/editsアプリケーション/JSON参照画像を に配置します images 配列。 画像にアクセスできる HTTPS URL が必要です。 4 つまでが推奨されます。
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 応答の例
{
"created": 1786400000,
"data": [{ "url": "https://example.com/generated-image.png" }]
}プロンプトを送信し、タスクのステータスをポーリングします。 タスクが成功するたびに、4 つの候補画像が返されます。
/v1/midjourney/imagineアプリケーション/JSON| フィールド | タイプ | 必須 | デスクリプション |
|---|---|---|---|
model | ストリング | いいえ | 固定値: midjourney; 省略すると自動的に使用されます |
prompt | ストリング | はい | 画像の説明、6,000 文字まで。 既存の --ar によってオーバーライドされます aspect_ratio. |
aspect_ratio | ストリング | いいえ | 1:1、16:9、9:16、4:3、3:4、3:2、2:3; デフォルト: 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"
}'提出応答 (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}3–5 秒ごとにポーリングします。 status かもしれません queued、processing、succeeded 又は failed。 タスクが失敗した場合は、予約料金が払い戻されます。
curl "https://www.fusionai.tv/v1/midjourney/tasks/req_7f2b1d6f03c84d679bfe2a8c" \
-H "Authorization: Bearer $FUSIONAI_API_KEY"成功した応答
{
"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" }
]
}ネイティブを使用します generateContent リクエスト形式。 テキストと参照は で提供されます parts。
/v1beta/models/{model}:generateContent| フィールド | タイプ | 必須 | デスクリプション |
|---|---|---|---|
model | パス | はい | コンソール カタログからの Gemini モデル ID |
contents | アレイ | はい | 会話の内容。通常は user 役割 |
parts[].text | ストリング | はい | 生成または編集の指示 |
parts[].inlineData | 対象 | いいえ | 参照画像 mimeType そして生のベース64 data |
generationConfig.responseModalities | アレイ | はい | 画像生成には、 を使用します ["IMAGE"] |
generationConfig.imageConfig.aspectRatio | ストリング | いいえ | 1:1、2:3、3:2、3:4、4:3、4:5、5:4、9:16、16:9、21:9 |
generationConfig.imageConfig.imageSize | ストリング | いいえ | 選択したモデルでサポートされているサイズを使用します。 512、1K、2K 又は 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"
}]
}リクエストは、その設定と、プラットフォームで設定された CNY 価格を使用して請求されます。
One API key, a published video catalog and account-specific per-second pricing.
/v1/videos| Parameter | タイプ | デスクリプション |
|---|---|---|
model | ストリング | Required. Use a published video model ID from /v1/models; do not assume every workbench model is available. |
prompt | ストリング | Required. Describe the subject, action, setting and camera movement. Follow the returned prompt limits. |
mode | ストリング | text_to_video (default), image_to_video, first_last_frame or reference_images. Check capabilities.operations for supported modes. |
seconds | 整数 | Output duration. Use durationsByQuality[quality] or durations for the selected operation; defaults to defaultDuration. |
quality | ストリング | Use an exact value from the selected operation qualities; defaults to defaultQuality. |
aspect_ratio | ストリング | 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.
2xx 以外の応答では、JSON エラー オブジェクトが返されます。
| http | タイプ | 意味 | 推奨 |
|---|---|---|---|
| 401 | invalid_api_key | 無効または無効なキー、または利用できないアカウント | 承認ヘッダーとアカウントのステータスを確認してください |
| 402 | insufficient_balance | 口座残高が不足しています | 再試行する前に資金を追加してください |
| 403 | model_not_allowed | モデルが公開されていないか、プロトコルが一致していません | モデル カタログを再度照会します |
| 403 | model_not_priced | この仕様には、価格が設定されていません | 仕様を変更するか、管理者に連絡してください |
| 405 | method_not_allowed | HTTP メソッドはサポートされていません | 文書化された HTTP メソッドを使用します |
| 502 | upstream_unavailable | モデル サービスは一時的に利用できません | 指数関数的バックオフで再試行してください |
| 503 | provider_not_configured | プロバイダー構成は利用できません | プラットフォーム管理者に連絡してください |
エラー応答の例
{
"error": {
"code": 402,
"type": "insufficient_balance",
"status": "INSUFFICIENT_BALANCE",
"message": "Insufficient account balance"
}
}