MManju api

Manju api 中转站开放接口对接文档

文档版本:v1.33
核对日期:2026-11-25
Base URL:https://manjuapi.com
范围:文本(标准格式)、图片(异步任务)、视频(异步任务)

每类能力只给出一种推荐接法:

能力 提交 取结果
文本 POST /v1/chat/completions 本次响应(JSON 或 SSE 流)
图片 POST /api/async/images/generations(文生图)
POST /api/async/images/image2image(参考图)
GET /api/async/tasks/{task_id}
视频 POST /v1/videos GET /v1/videos/{task_id}

已在使用其他路径的老客户端不受本文改版影响,无需为此迁移。

1. 鉴权与模型

所有请求携带:

http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

模型名区分空格和大小写,请按原样填写。图片分辨率用参数指定(见 3.1),不写在模型名里。用自己的 Key 查询可用模型,价格以实时 /api/pricing 为准:

bash
curl "https://manjuapi.com/v1/models" \
  -H "Authorization: Bearer $MANJU_API_KEY"

示例中的 https://cdn.example.com/... 是占位地址,请换成可直接下载的实际素材 URL。

2. 文本:标准 Chat Completions

2.1 模型示例

系列 公开模型 ID 示例
GPT gpt-6-astra、gpt-6-sol、gpt-6-luna
Gemini gemini-3.8-flash、gemini-3.1-pro-preview
Grok grok-4.7
Claude claude-opus-5-5、claude-fable-5-1
其他 deepseek-chat、deepseek-reasoner、qwen-plus、glm-5

2.2 请求

bash
curl "https://manjuapi.com/v1/chat/completions" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-sol",
    "messages": [
      {"role": "user", "content": "请用三句话介绍太阳能发电。"}
    ],
    "stream": false
  }'

请求与响应均为标准 OpenAI Chat Completions 格式,可直接使用 OpenAI SDK(base_url 设为 https://manjuapi.com/v1)。

temperature、max_tokens、tools 等可选参数按所选模型支持情况使用。

3. 图片:异步任务

图片统一走异步:提交后拿到任务号,再查询结果。

3.1 模型与尺寸

模型 ID 可选 aspect_ratio 可选 output_resolution 参考图上限
gemini-3.0-pro-image 1:1、16:9、9:16、4:3、3:4、3:2、2:3 1K、2K、4K —
gemini-nano-banana-2.1 1:1、16:9、9:16、4:3、3:4、3:2、2:3 1K、2K、4K —
gemini-3.1-flash-lite-image 1:1、16:9、9:16、4:3、3:4、3:2、2:3 不传(固定档) —
gpt-image-2 1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9 1K、2K、4K 16 张
gpt-image-2.5-flare
gpt-image-2.5-sunburst
1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9 1K、2K、4K 16 张
gpt-image-2.5-max(最高画质) 1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9 1K、2K、4K(同价) 10 张
gpt-image-2.6
gpt-image-2.6-flare
gpt-image-2.6-sunburst
1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9 1K、2K、4K 16 张
seedream-5.5 16:9、4:3、1:1、3:4、9:16 1K、1.5K、2K、3K 10 张
Midjourney-v8.2
Midjourney-v8.1
Midjourney-v8
Midjourney-Niji 8
Midjourney-Niji 7
1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9 不传(无分辨率) 5 张
grok-imagine-image-2.0 1:1、16:9、9:16、3:2、2:3 1K、2K 1 张(仅 3.3 的文件上传方式)
grok-imagine-image-pro 1:1、16:9、9:16、3:2、2:3 不传(固定档) —
muse-image 1:1、16:9、9:16、4:3、3:4、3:2、2:3、21:9 不传(尺寸随比例固定) 最多 8 张(1 张用 image,多张用 images 数组,示例见 3.3 末尾)

说明:

3.2 文生图

bash
curl "https://manjuapi.com/api/async/images/generations" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: image-order-0001" \
  -d '{
    "model": "gemini-3.0-pro-image",
    "prompt": "雨夜中的未来城市,电影灯光,无文字",
    "aspect_ratio": "16:9",
    "output_resolution": "2K",
    "n": 1
  }'

3.3 参考图生图 / 编辑

提交到 /api/async/images/image2image,参考图统一放在 reference_images(字符串数组),其余参数与文生图相同:

bash
curl "https://manjuapi.com/api/async/images/image2image" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: image-order-0002" \
  -d '{
    "model": "gemini-3.0-pro-image",
    "prompt": "保持第一张图的人物和第二张图的服装,改成雨夜城市背景",
    "reference_images": [
      "https://cdn.example.com/person.png",
      "https://cdn.example.com/clothes.png"
    ],
    "aspect_ratio": "16:9",
    "output_resolution": "2K",
    "n": 1
  }'

参考图 URL 须无需登录即可下载,并在任务期间保持有效;也可用完整的 data:image/png;base64,...。可用张数取决于模型。

grok-imagine-image-2.0 的参考图请改用文件上传:提交到 /api/async/images/edits,Content-Type 为 multipart/form-data,图片放在 image 字段,其余参数作为表单字段:

bash
curl "https://manjuapi.com/api/async/images/edits" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Idempotency-Key: image-order-0003" \
  -F "model=grok-imagine-image-2.0" \
  -F "prompt=改成水彩画风格" \
  -F "aspect_ratio=16:9" \
  -F "output_resolution=1K" \
  -F "n=1" \
  -F "image=@ref.png"

提交响应和查询方式与上文相同。

muse-image 多图参考示例(4 张参考图,提交到文生图同一个接口):

bash
curl "https://manjuapi.com/api/async/images/generations" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: image-order-0004" \
  -d '{
    "model": "muse-image",
    "prompt": "图1的女孩抱着图2的小猫,坐在图3的咖啡馆窗边,穿着图4的外套",
    "aspect_ratio": "16:9",
    "n": 1,
    "images": [
      "https://cdn.example.com/girl.jpg",
      "https://cdn.example.com/cat.jpg",
      "https://cdn.example.com/cafe.jpg",
      "https://cdn.example.com/coat.jpg"
    ]
  }'

注意:muse-image 的参考图放在 images(1 张也可以用 image),不要用 reference_images,也不要提交到 /api/async/images/image2image。

3.4 提交响应

提交成功返回 HTTP 202:

json
{
  "id": "image-example-task",
  "task_id": "image-example-task",
  "status": "queued",
  "progress": 0,
  "poll_url": "/api/async/tasks/image-example-task",
  "created_at": "2026-09-29T00:00:00Z",
  "expires_at": "2026-09-30T00:00:00Z"
}

Idempotency-Key(可选,≤128 字符):每个新业务请求用新值;网络异常需要重新提交同一请求时复用原值,不会重复生成。同一键配不同请求内容返回 409。请求体上限 50 MiB;不要设置 stream:true。

3.5 查询结果

用提交时的同一个 Key,每 3~5 秒查询一次:

bash
curl "https://manjuapi.com/api/async/tasks/$TASK_ID" \
  -H "Authorization: Bearer $MANJU_API_KEY"
status 处理
queued / running 继续查询
succeeded 读取 data[].url(或 data[].b64_json),停止查询
failed 读取 error,停止查询
unknown 保留任务号联系支持,不要自动重新提交

成功示例:

json
{
  "task_id": "image-example-task",
  "status": "succeeded",
  "progress": 100,
  "data": [
    {"url": "https://cdn.example.com/generated/image.png"}
  ]
}

任务不存在、已过期或不属于当前 Key 时返回 404。

3.6 动图(GIF)

只有 gpt-image-2.6 能出动图(测试中)。在文生图或参考图生图的请求里加一个字段 "output_format": "gif" 即可,其余参数、提交接口、查询方式都和静态图一样,价格也一样(按次,与静态图同价)。

文生动图(提交到 3.2 的接口):

bash
curl "https://manjuapi.com/api/async/images/generations" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6",
    "prompt": "海边的灯塔,海浪拍打礁石",
    "output_format": "gif",
    "n": 1
  }'

参考图生成动图(提交到 3.3 的接口,参考图放 reference_images):

bash
curl "https://manjuapi.com/api/async/images/image2image" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6",
    "prompt": "让图里的人物挥手微笑",
    "reference_images": ["https://cdn.example.com/girl.jpg"],
    "output_format": "gif",
    "n": 1
  }'

也可以用 OpenAI 标准同步接口(/v1/images/generations,或 /v1/images/edits 上传参考图),请求同样加 output_format,响应里直接返回结果链接:

bash
curl "https://manjuapi.com/v1/images/generations" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-image-2.6", "prompt": "一面红旗在风中飘扬", "output_format": "gif", "n": 1}'

3.7 Seedream 5.5(透明背景)

seedream-5.5(字节 Seedream 5.5)按次计费:1K ¥0.05,1.5K ¥0.075,2K ¥0.1,3K ¥0.15。文生图提交到 3.2,参考图生图提交到 3.3(reference_images,最多 10 张),查询方式见 3.5。它独有一个 background 参数:

文生图(透明背景):

bash
curl "https://manjuapi.com/api/async/images/generations" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5.5",
    "prompt": "一只卡通橙色小狐狸贴纸,抠图素材",
    "aspect_ratio": "1:1",
    "output_resolution": "2K",
    "background": "transparent",
    "n": 1
  }'

参考图生图(实心背景,3K):

bash
curl "https://manjuapi.com/api/async/images/image2image" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5.5",
    "prompt": "把这瓶香水放到雪山顶上,晨光",
    "reference_images": ["https://cdn.example.com/perfume.png"],
    "aspect_ratio": "16:9",
    "output_resolution": "3K",
    "background": "opaque",
    "n": 1
  }'

3.8 Midjourney-全系列(一次 4 张)

5 个模型:Midjourney-v8.2、Midjourney-v8.1、Midjourney-v8、Midjourney-Niji 8、Midjourney-Niji 7(Niji 为动漫风格)。按次计费 ¥0.48,每次返回 4 张独立图片。只选比例,没有分辨率档位(不要传 output_resolution)。文生图提交到 3.2,参考图生图提交到 3.3(reference_images,最多 5 张),查询方式见 3.5。出图较慢,通常 2–10 分钟,请耐心轮询。

文生图:

bash
curl "https://manjuapi.com/api/async/images/generations" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Midjourney-v8.2",
    "prompt": "a cozy cabin in a snowy forest at night, warm lights",
    "aspect_ratio": "16:9",
    "n": 1
  }'

参考图生图:

bash
curl "https://manjuapi.com/api/async/images/image2image" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Midjourney-Niji 8",
    "prompt": "this cat as a cute anime character in a garden",
    "reference_images": ["https://cdn.example.com/cat.jpg"],
    "aspect_ratio": "3:4",
    "n": 1
  }'

查询成功后,4 张图在 image_urls(字符串数组)和 result.data(对象数组)里,顺序一致:

json
{
  "status": "succeeded",
  "image_urls": ["https://.../1.png", "https://.../2.png", "https://.../3.png", "https://.../4.png"],
  "result": { "data": [{ "url": "https://.../1.png" }, { "url": "https://.../2.png" }, { "url": "https://.../3.png" }, { "url": "https://.../4.png" }] }
}

4. 视频:异步任务

4.1 模型与参数

duration、ratio、resolution 请只填下表中该模型列出的值。

模型 ID duration(秒) ratio resolution 图片输入
manju-2.0-mini 4~15 整数 16:9、9:16、1:1、4:3、3:4、21:9 720p、480p 首帧或参考图,最多 9 张
manju-2.0 933 15 16:9、9:16、1:1、4:3、3:4、21:9 720p、480p 首帧或参考图,最多 9 张
manju-2.0-fast 933 10、14、15 16:9、9:16、1:1 720p 首帧或参考图,最多 9 张
manju 2.5 10s / 15s / 20s / 25s / 29s / 30s 与模型名一致 16:9、9:16、1:1、4:3、3:4、21:9 720p;15s、30s 另可选 480p 参考图最多 30 张
Seedance-2.0 4~15 整数 16:9、9:16、1:1、4:3、3:4、21:9 480p、720p、1080p 首帧、首尾帧或参考图,参考图最多 10 张
Seedance-2.0-fast 4~15 整数 同上 480p、720p 同上
Seedance-2.5 4~30 整数 同上 480p、720p、1080p 同上
Wan 3.0 Prime 5~30 整数 16:9、9:16、4:3、3:4、1:1 480p、720p、1080p 首帧或参考图,最多 10 张(另可加 3 个参考音频)
grok-imagine-video 6、10、15 16:9、9:16 720p 首帧或参考图,最多 7 张
grok-imagine-video-1.5-fast 6、10、15 16:9、9:16 720p 首帧或参考图,最多 7 张
grok-imagine-video-6s 6 16:9、9:16 720p 首帧或参考图,最多 7 张
grok-imagine-video-1.5-preview 10、15 16:9、9:16 720p 必须 1 张首帧图
grok-imagine-video-1.5-lite 6、10、15 16:9、9:16 720p 首帧图 1 张(可不传)
Veo 3.1 Fast 1080p 8 16:9、9:16 1080p 首帧图
MiniMax H3 768p 10、15 16:9、9:16、1:1、4:3、3:4、21:9 768p 首帧或参考图,最多 6 张
MiniMax H3 2K 10、15 同上 2K 首帧或参考图,最多 6 张
Minimax H3 Max 15 同上 768p 必须 1 张首帧图
FLUX 3 Video 10、15、20 16:9、9:16、1:1 720p 首帧图 1 张(可不传)
Gemini Omni 1.2 Flash 3~15 整数 16:9、9:16 720p 首帧图 1 张,或多图参考最多 5 张
Kling 4.0 3~30 整数 16:9、9:16、1:1、21:9 720p、1080p 首帧或参考图,最多 10 张
kling-4.0-flash 4~10 整数 16:9、9:16、1:1、4:3、3:4 720p 首帧或参考图,最多 10 张
muse-video 5、6、10、25 16:9、9:16 720p 首帧图 1 张,或多图参考最多 8 张(reference_images,示例见 4.2)
seedance-2.5-flash 4~30 整数 16:9、9:16、1:1、4:3、3:4、21:9 480p、720p 首帧或参考图,最多 10 张(另可加 5 个参考音频)
tejia 2.5 flash 4~30 整数 16:9、9:16、1:1、4:3、3:4、21:9 480p、720p 首帧或参考图,最多 10 张(另可加 5 个参考音频)

说明:

4.2 提交

bash
curl "https://manjuapi.com/v1/videos" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "manju-2.0-mini",
    "prompt": "晨雾中的白鹭掠过稻田,镜头平稳跟随",
    "duration": 10,
    "ratio": "16:9",
    "resolution": "720p"
  }'
字段 说明
model 精确模型 ID
prompt 视频描述
duration 时长(秒),与模型允许值及时长后缀一致
ratio 画面比例,如 16:9、9:16
resolution 分辨率档位,如 480p、720p、1080p
image_url 可选,单张首帧图 URL
reference_images 可选,多张参考图 URL 数组(模型支持时)

图生视频在上例中加 image_url,多图参考则加 reference_images,二者选一:

json
{
  "model": "manju-2.0-mini",
  "prompt": "使用第一张图的人物、第二张图的场景,生成向前行走的镜头",
  "duration": 10,
  "ratio": "16:9",
  "resolution": "720p",
  "reference_images": [
    "https://cdn.example.com/character.jpg",
    "https://cdn.example.com/location.jpg"
  ]
}

Kling 4.0 多图参考示例(3 张参考图,5 秒 1080p):

bash
curl "https://manjuapi.com/v1/videos" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Kling 4.0",
    "prompt": "图1的女孩牵着图2的小狗,走进图3的咖啡馆,镜头缓慢跟随",
    "duration": 5,
    "ratio": "16:9",
    "resolution": "1080p",
    "reference_images": [
      "https://cdn.example.com/girl.jpg",
      "https://cdn.example.com/dog.jpg",
      "https://cdn.example.com/cafe.jpg"
    ]
  }'

首帧生视频把 reference_images 换成 "image_url": "https://cdn.example.com/first.jpg";纯文生视频两者都不传。

muse-video 多图参考示例(4 张参考图,10 秒 720p):

bash
curl "https://manjuapi.com/v1/videos" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "muse-video",
    "prompt": "图1的女孩抱着图2的小猫,走进图3的咖啡馆,身穿图4的外套,镜头缓慢跟随",
    "duration": 10,
    "ratio": "16:9",
    "resolution": "720p",
    "reference_images": [
      "https://cdn.example.com/girl.jpg",
      "https://cdn.example.com/cat.jpg",
      "https://cdn.example.com/cafe.jpg",
      "https://cdn.example.com/coat.jpg"
    ]
  }'

只要首帧时把 reference_images 换成 "image_url": "https://cdn.example.com/first.jpg"(只能 1 张);首帧和多图参考二选一。

seedance-2.5-flash 多素材参考示例(2 张参考图 + 1 个参考音频,5 秒 720p):

bash
curl "https://manjuapi.com/v1/videos" \
  -H "Authorization: Bearer $MANJU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.5-flash",
    "prompt": "图1的女孩牵着图2的小狗走过街角,背景音乐跟随参考音频的节奏",
    "duration": 5,
    "ratio": "16:9",
    "resolution": "720p",
    "reference_images": [
      "https://cdn.example.com/girl.jpg",
      "https://cdn.example.com/dog.jpg"
    ],
    "reference_audios": [
      "https://cdn.example.com/bgm.mp3"
    ]
  }'

只要首帧时把 reference_images 换成 "first_frame_image": "https://cdn.example.com/first.jpg";不需要音频就去掉 reference_audios;纯文生视频都不传。

tejia 2.5 flash 多素材参考示例(2 张参考图 + 1 个参考音频,5 秒 480p,扣 ¥0.80):

bash
curl "https://manjuapi.com/v1/videos"   -H "Authorization: Bearer $MANJU_API_KEY"   -H "Content-Type: application/json"   -d '{
    "model": "tejia 2.5 flash",
    "prompt": "图1的女孩牵着图2的小狗走过街角,背景音乐跟随参考音频的节奏",
    "duration": 5,
    "ratio": "16:9",
    "resolution": "480p",
    "reference_images": [
      "https://cdn.example.com/girl.jpg",
      "https://cdn.example.com/dog.jpg"
    ],
    "reference_audios": [
      "https://cdn.example.com/bgm.mp3"
    ]
  }'

首帧、纯文生的写法同上一个示例。

4.3 提交响应

返回任务对象(HTTP 200),保存 task_id:

json
{
  "object": "task",
  "id": "video-example-task",
  "task_id": "video-example-task",
  "status": "running",
  "progress": 0,
  "poll_url": "/v1/videos/video-example-task"
}

4.4 查询结果

bash
curl "https://manjuapi.com/v1/videos/$TASK_ID" \
  -H "Authorization: Bearer $MANJU_API_KEY"

看顶层 status:

status 处理
running 3~5 秒后继续查询
succeeded 读取视频地址,停止查询
failed 读取 error.message,停止查询
billing_review 保留任务号联系支持,不要自动重新提交

成功示例:

json
{
  "task_id": "video-example-task",
  "status": "succeeded",
  "progress": 100,
  "error": null,
  "final_url": "https://cdn.example.com/generated/video.mp4",
  "data": {
    "video_url": "https://cdn.example.com/generated/video.mp4",
    "video_urls": ["https://cdn.example.com/generated/video.mp4"]
  }
}

视频地址按顺序取第一个非空值:data.video_urls[0] → data.video_url → final_url。响应中的 result_url 是查询路径,不是下载地址。

5. 错误处理

状态码 处理
400 / 422 参数有误,查看 error.message,核对模型、素材、时长、比例、分辨率
401 Key 缺失或无效
403 当前 Key 无该模型权限
404 路径或任务号错误,或非提交时的 Key
409 同一 Idempotency-Key 对应了不同请求内容
413 请求体过大
429 限流或排队已满,退避后重试
5xx / 超时 已拿到任务号就继续查询原任务;图片未拿到任务号时用原 Idempotency-Key 重试提交;视频提交结果不明时先核对账单/任务记录,不要盲目重复提交

要点:

  1. 查询返回 HTTP 200 不等于生成成功,以任务 status 为准。
  2. 已拿到任务号后,网络异常只重试查询,不要重新提交生成。
  3. 结果地址不永久保存,成功后请及时下载到自己的存储;下载失败重试下载即可。