跳到主要内容
Alibaba检查中

Wan 2.7 / Image to Video

wan-2-7-image-to-video

图生视频输出: 视频输入: 文本 + 图像 + audio
正在加载价格…
官方原价 · 未验证

端点

所有模型共用一个异步任务 API,通过 slug 选择此模型。

提交
POST https://api.hermes-ai.net/api/v1/jobs

{
  "model": "wan-2-7-image-to-video",
  "input": {
    "firstImageUrl": "https://example.com/input.png",
    "resolution": "720P",
    "duration": "5"
  }
}

然后轮询 GET /api/v1/jobs/{id} 直到状态为终态。

身份验证

提交需要带 jobs:create 权限的 API Key,轮询需要 jobs:read。

请求头值说明
AuthorizationBearer <API key>也可以通过 x-api-key 发送密钥。
Content-Typeapplication/json
Idempotency-Key<unique string ≤128>必填。仅在重试完全相同的请求时复用。

请求体

字段类型必填说明
modelstring必填目录中的模型 slug。
inputobject必填模型输入 schema 中的字段。
expectedPriceMicrosinteger可选你向用户展示的价格。不一致时在扣费前返回 409 PRICE_CHANGED。

input 字段

未知字段会被拒绝并返回 INVALID_MODEL_INPUT。

字段类型必填默认值可选值与约束
prompt
string可选—

1–5000 chars

firstImageUrl
string必填—

Choose one of two: 1. first_frame=the first frame of the generated video. 2. first_frame+last_frame=start and end frames generate the video.

HTTPS image URL or media:<uuid>

lastImageUrl
string可选—

Choose one of two: 1. first_frame=the first frame of the generated video. 2. first_frame+last_frame=start and end frames generate the video.

HTTPS image URL or media:<uuid>

audioUrl
string可选—

audioUrl MP3 or WAV; maximum 15 MB.

HTTPS audio URL or media:<uuid>

negativePrompt
string可选—

0–500 chars

resolution
string必填"720P"

可选值: "720P", "1080P"

duration
string必填"5"

可选值: "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"

promptExtend
boolean可选true

Whether to enable prompt intelligent rewriting. After activation, use the large model to intelligently rewrite the input prompt. For shorter prompt generation, the effect is significantly improved, but it will increase the time consumption.

seed
integer可选—

Randomly select seeds with a value range of [0, 2147483647]. If not specified, the system will automatically generate random seeds. If you need to improve the reproducibility of the generated results, it is recommended to fix the seed value. Please note that due to the probabilistic nature of model generation, even with the same seed, it cannot be guaranteed that the results generated each time will be completely consistent

0–2147483647

响应

新任务返回 202,Idempotency-Key 重放命中时返回 200。GET /api/v1/jobs/{id} 返回相同结构(不含 replayed)。

字段类型说明
idstringHermes AI 任务 ID,用于轮询。
modelstring模型 slug。
statusstring参见任务状态。
errorCodestring | null任务失败或需要核对时设置。
priceMicrosinteger接收时锁定的报价,美元微单位。
currency"USD"
createdAt / updatedAtstringISO 8601 时间戳。
assets[]array{ id, type, url?, text? }。url 为同源 /api/v1/results/<uuid> 链接。
replayedboolean仅提交时返回。幂等重试命中时为 true。

任务状态

状态终态含义
queued否已接收,等待执行。
submitting否正在提交给模型提供方。
running否模型生成中。
succeeded是已完成,结果位于 assets。
failed是未产生结果,预留额度已释放。
reconciliation_required是结果正在核实。请保留任务 ID,不要自动重新提交。

错误

错误响应体为 { code, error },请根据 code 处理。

HTTP代码含义与处理方式
401AUTH_REQUIRED缺少或无效的 API Key 或会话。
403INSUFFICIENT_SCOPEAPI Key 缺少此端点所需的权限。
403PERMISSION_DENIED此凭据无权执行该操作。
429API_KEY_RATE_LIMITED已达到 API Key 的频率限制,请遵循 Retry-After。
429API_KEY_USAGE_EXCEEDEDAPI Key 已达到使用上限,请创建新密钥。
400INVALID_REQUEST请求体不是 JSON 对象,或缺少必需值。
400INVALID_IDEMPOTENCY_KEYIdempotency-Key 必须是 1–128 个可打印 ASCII 字符。
400INVALID_MODEL_INPUTinput 与模型 schema 不匹配(未知字段、缺少必填字段或值无效)。
400 / 413INPUT_TOO_LARGE请求体超过 256 KB。请先上传媒体并发送媒体引用。
404REQUEST_NOT_FOUNDNo chat request with this ID belongs to your account.
404MODEL_NOT_FOUND没有此 slug 对应的模型。
404JOB_NOT_FOUND你的账户中没有此 ID 的任务。
409IDEMPOTENCY_CONFLICT此 Idempotency-Key 已用于不同的输入。新请求请使用新密钥。
409PRICE_CHANGED价格与 expectedPriceMicros 不一致。请重新获取价格并确认。
409MODEL_PRICE_UNAVAILABLE此模型尚未配置价格,暂不可运行。
409PAYMENT_REVIEW_REQUIRED退款后余额不足。请联系支持或补足余额后再提交任务。
409INSUFFICIENT_CREDITS可用额度不足以支付此任务。
429RATE_LIMITED每分钟提交次数过多,请稍后重试。
429CONCURRENCY_LIMITED未完成任务过多,请等待任务完成。
503EXECUTION_UNAVAILABLE此模型当前未配置执行能力。
429UPSTREAM_RATE_LIMITEDThe model provider is rate limiting chat requests. Retry with backoff; nothing was charged.
502UPSTREAM_ERRORThe model provider failed the chat request. Nothing was charged; retry later.
503PLATFORM_BUDGET_EXCEEDED此模型暂时不可用,请稍后重试。
503EXECUTION_TEMPORARILY_UNAVAILABLE执行暂时不可用,请使用相同的 Idempotency-Key 重试。
503AUTH_UNAVAILABLE身份验证暂时不可用,请稍后重试。
503API_UNAVAILABLEAPI 暂时不可用,请稍后重试。

完整 API 指南 · OpenAPI 3.1