OOMOL Fusion API

圖像與影片 API

為你的應用程式接入圖片生成、圖片編輯和影片生成。使用 OOMOL 憑證,透過熟悉的 SDK 或 HTTP API 呼叫已支援的模型。

將圖像與影片能力接入你的產品

生成圖片

將文字描述變成商品配圖、插畫和創意素材。

編輯圖片

使用參考圖修改場景、調整構圖,或探索新的畫面風格。

生成影片

透過文字或已支援的參考素材建立影片,再查詢任務取得結果。

依任務選擇 API

透過 OOMOL Fusion API 接入以下廠商的部分介面。各廠商支援的模型和參數範圍不同。

OpenAI Images

圖片生成與編輯

/v1/provider/openai/v1

Seedream

圖片生成、參考圖與 SSE 輸出

/v1/provider/seedream/api/v3

Seedance

影片生成與任務查詢

/v1/provider/seedance/api/v3

Wanx

影片生成與任務查詢

/v1/provider/wanx/api/v1

Kling

影片生成與任務查詢

/v1/provider/kling/

MiniMax

影片生成與任務查詢

/v1/provider/minimax/

支援範圍以具體模型和操作為準。上傳、取消、串流輸出等能力因廠商而異,接入前請確認可用範圍與限制。

查看價格

選擇模型,查看接入範例

使用對應廠商的 SDK 或 HTTP API。每個範例都包含用戶端設定和生成請求。

  1. 設定用戶端

    使用對應廠商的 Base URL 和 OOMOL Token。依接入要求設定逾時,並關閉建立請求的自動重試,避免重複生成。

  2. 呼叫支援的模型

    沿用已支援的請求參數和回應格式。影片任務透過對應廠商的任務查詢介面取得結果。

範例已設定 https://fusion-api.oomol.com 服務位址。將 FUSION_API_TOKEN 設為你的 OOMOL Token,並安裝範例標註版本的套件。使用前請確認 API 入口已開放。

選擇模型,查看接入範例
OpenAI Images · TypeScriptopenai@7.23.0
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.FUSION_API_TOKEN,
  baseURL: "https://fusion-api.oomol.com/v1/provider/openai/v1",
  maxRetries: 0,
  timeout: 1_080_000,
});

const result = await client.images.generate({
  model: "gpt-image-2",
  prompt: "A ceramic mug on a wooden table",
  size: "1536x864",
  quality: "medium",
});
console.log(result);

Base URL: https://fusion-api.oomol.com/v1/provider/openai/v1

Seedream · TypeScript@volcengine/ark-runtime@1.0.11
import { ArkRuntimeClient } from "@volcengine/ark-runtime";

const client = new ArkRuntimeClient({
  apiKey: process.env.FUSION_API_TOKEN,
  baseURL: "https://fusion-api.oomol.com/v1/provider/seedream/api/v3",
  retryTimes: 0,
  timeout: 125_000,
});

const result = await client.generateImages({
  model: "doubao-seedream-5-0-260128",
  prompt: "A ceramic mug on a wooden table",
  size: "2K",
  response_format: "url",
});
console.log(result);

Base URL: https://fusion-api.oomol.com/v1/provider/seedream/api/v3

Seedance · TypeScript@volcengine/ark-runtime@1.0.11
import { ArkRuntimeClient } from "@volcengine/ark-runtime";

const client = new ArkRuntimeClient({
  apiKey: process.env.FUSION_API_TOKEN,
  baseURL: "https://fusion-api.oomol.com/v1/provider/seedance/api/v3",
  retryTimes: 0,
  timeout: 125_000,
});

const task = await client.createContentGenerationTask({
  model: "doubao-seedance-2-0-260128",
  content: [{ type: "text", text: "A boat on the ocean" }],
  duration: 5,
  resolution: "720p",
});
const status = await client.getContentGenerationTask(task.id);
console.log(task.id, status);

Base URL: https://fusion-api.oomol.com/v1/provider/seedance/api/v3

範例建立影片任務後僅查詢一次。請儲存任務 ID,繼續查詢直到任務進入終態;不要透過重複建立請求來檢查進度。

Wanx · TypeScriptdashscope-sdk-official@1.26.0
import { Configuration, VideoSynthesis } from "dashscope-sdk-official";

const client = new VideoSynthesis(new Configuration({
  apiKey: process.env.FUSION_API_TOKEN,
  basePath: "https://fusion-api.oomol.com/v1/provider/wanx/api/v1",
}));

const task = await client.asyncCall({
  model: "wan3.0-video",
  prompt: "A boat on the ocean",
  resolution: "1080P",
  duration: 5,
});
const status = await client.fetch(task.output.task_id);
console.log(task.output.task_id, status);

Base URL: https://fusion-api.oomol.com/v1/provider/wanx/api/v1

範例建立影片任務後僅查詢一次。請儲存任務 ID,繼續查詢直到任務進入終態;不要透過重複建立請求來檢查進度。

Kling · TypeScriptHTTP · ky@1.11.0
import ky from "ky";

const client = ky.create({
  prefixUrl: "https://fusion-api.oomol.com/v1/provider/kling/",
  headers: { Authorization: `Bearer ${process.env.FUSION_API_TOKEN}` },
  retry: 0,
  redirect: "error",
  timeout: 30_000,
});

const task = await client.post("text-to-video/kling-3.0-turbo", {
  json: {
    prompt: "A boat on the ocean",
    settings: { duration: 5, resolution: "720p", aspect_ratio: "16:9" },
  },
}).json<{ data: { id: string } }>();
const status = await client.get("tasks", {
  searchParams: { task_ids: task.data.id },
}).json();
console.log(task.data.id, status);

Base URL: https://fusion-api.oomol.com/v1/provider/kling/

範例建立影片任務後僅查詢一次。請儲存任務 ID,繼續查詢直到任務進入終態;不要透過重複建立請求來檢查進度。

MiniMax · TypeScriptHTTP · ky@1.11.0
import ky from "ky";

const client = ky.create({
  prefixUrl: "https://fusion-api.oomol.com/v1/provider/minimax/",
  headers: { Authorization: `Bearer ${process.env.FUSION_API_TOKEN}` },
  retry: 0,
  redirect: "error",
  timeout: 30_000,
});

const task = await client.post("v2/video_generation", {
  json: {
    model: "MiniMax-H3",
    content: [{ type: "text", text: "A boat on the ocean" }],
    duration: 5,
    resolution: "768P",
    ratio: "16:9",
  },
}).json<{ task_id: string }>();
const status = await client.get(
  `v2/query/video_generation/${encodeURIComponent(task.task_id)}`,
).json();
console.log(task.task_id, status);

Base URL: https://fusion-api.oomol.com/v1/provider/minimax/

範例建立影片任務後僅查詢一次。請儲存任務 ID,繼續查詢直到任務進入終態;不要透過重複建立請求來檢查進度。

透過 AI Agent 使用?

瀏覽已整合的工具,在 Agent 和工作流程中呼叫已封裝的服務操作。

瀏覽整合工具