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 和工作流中调用已封装的服务操作。

浏览集成工具