Storymo-image-2

Storymo-image-2(稳定渠道) 图片生成

Markdown
POSThttps://api.storymo.art/v1/images

模型 ID:Storymo-image-2

使用文本或参考图片生成图片。提交后返回 task_id,使用任务查询接口获取结果。

请求地址

POST /v1/images

API 服务域名:https://api.storymo.art。

请求头

名称必填值
Authorization是Bearer YOUR_API_KEY
Content-Type是application/json
Idempotency-Key是每次新任务使用独立值,例如 order-20261031-001;网络重试保持原值和参数

请求参数

参数类型必填本模型填写方式
modelstring是固定填写 Storymo-image-2
promptstring是1–20000 字符的生成描述,不可为空
aspect_ratiostring否1:1、16:9、9:16、4:3、3:4、3:2、2:3。省略时平台默认 1:1,建议显式填写
resolutionstring否1K、2K、4K。省略时平台默认 2K
referencesarray否默认 []。参考素材格式见下方
max_creditsnumber否本次预计积分上限;超过上限返回 budget_exceeded
ninteger否默认 1,目前仅支持 1

请求 JSON

{
  "model": "Storymo-image-2",
  "prompt": "一只橘猫坐在窗边,柔和的晨光,细腻的毛发",
  "aspect_ratio": "1:1",
  "resolution": "2K"
}

参考素材

支持参考图片。

  • 图片:可使用;数量以参数校验结果为准。
  • 视频:不支持。
  • 音频:不支持。

references 每项必须包含 type,并在 url 与 file_id 中选择一种。file_id 来自文件上传接口;url 为可公开下载的 HTTPS 文件地址。参考数组总数最多 50,仍受本模型每类上限约束。

[
  {
    "type": "image",
    "file_id": "上传返回的file_id"
  }
]

只需参考图片时,将 references 添加到上面的请求 JSON,prompt 正常描述即可。

报价

POST /v1/images/quote

使用相同请求参数获取本次预计积分;报价无需 Idempotency-Key,不扣费。以 data.credits 为预计值,实际以任务记录为准。

提交响应

HTTP 202。

{
  "code": "ok",
  "message": "success",
  "data": {
    "task_id": "task_example",
    "taskId": "task_example",
    "type": "image",
    "status": "queued",
    "credits": 20
  },
  "requestId": "req_example"
}

credits 为本次任务积分,上面的 20 仅为响应结构示例。taskId 是兼容字段,新接入使用 task_id。status=queued 表示排队,不能直接下载。

查询与下载

GET /v1/images/{task_id}

携带相同 Authorization,每 3–5 秒查询一次。status 为 succeeded 时读取 data.outputs[0].url 下载图片;failed 或 canceled 时停止查询。

{
  "code": "ok",
  "message": "success",
  "data": {
    "task_id": "task_example",
    "type": "image",
    "status": "succeeded",
    "progress": 100,
    "outputs": [
      {
        "type": "image",
        "url": "https://cdn.example.com/result.png"
      }
    ],
    "error": null,
    "credits": 20,
    "created_at": "2026-10-31T04:00:00.000Z",
    "completed_at": "2026-10-31T04:01:00.000Z"
  },
  "requestId": "req_example"
}

下载地址可能过期;重新查询任务可获取链接。下载文件时不要发送 API Key。

错误处理

400:参数、素材类型或数量不支持。401:API Key 无效。402:积分不足。403:会员权限不足。409:幂等冲突或提交尚未确定。500/503:服务异常。错误响应包含 code、message、data 和 requestId。超时后使用相同幂等键重试提交,收到 task_id 后只需查询任务。

curl --request POST "https://api.storymo.art/v1/images" \
  --header "Authorization: Bearer $DRAMAGEN_API_KEY" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: order-cd90d82e-001' \
  --data '{
  "model": "Storymo-image-2",
  "prompt": "一只橘猫坐在窗边,柔和的晨光,细腻的毛发",
  "aspect_ratio": "1:1",
  "resolution": "2K"
}'
响应示例
{
  "code": "ok",
  "message": "success",
  "data": {
    "task_id": "task_example",
    "taskId": "task_example",
    "type": "image",
    "status": "queued",
    "credits": 20
  },
  "requestId": "req_example"
}