AI绘画API
    AI绘画API
    • 使用前准备
    • 图片处理
      • 无损放大
        POST
      • 自动抠图
        POST
    • 人像处理
      • 人物换风格
        POST
      • 单人换脸
        POST
    • 线稿互转
      • 图片转线稿
        POST
    • Flux模型生图
      • 文生图
        POST
      • 图生图
        POST
    • MDJ模型生图
      • 文生图
        POST
      • 操作图片
        POST
      • 混合图片
        POST
      • 局部重绘
        POST
      • 图生文
        POST
    • 生成视频
      • 文生视频
        POST
      • 图生视频
        POST
    • 查询单个任务
      GET
    • 查询多个任务
      POST
    • 出图后续操作
      POST

      查询单个任务

      开发中
      GET
      /api/v2/task/id/{id}
      查询单个任务的结果,不同类型的任务返回的结果,除了核心的id、status、action、cost外,其它属性会有不同。
      注意:
      1、“progress”值为估算值,不准确。
      2、此接口仅作为任务长时间没有回调的辅助接口,及如果单个任务超过5分钟都没有回调,那么可以单独请求一下此接口,看一下进度。
      3、此接口不支持长时间、高频度的调用。
      4、强烈建议给每个任务都配置 notifyHook 地址,减少对此接口的依赖,因为会更实时,用户体验也更好。

      请求参数

      Path 参数
      id
      string 
      任务ID
      必需
      示例值:
      123
      Header 参数
      Authorization
      string 
      管理后台获取的密钥
      必需
      示例值:
      Bearer 1333_zrT4KITp20HcxxxxxxxxxxRD2C513FK40Pvq

      示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      curl --location --request GET 'https://api.aihuihua.com/api/v2/task/id/123' \
      --header 'Authorization: Bearer 1333_zrT4KITp20HcxxxxxxxxxxRD2C513FK40Pvq'

      返回响应

      🟢200成功
      application/json
      Body
      id
      string 
      任务ID
      必需
      action
      string 
      必需
      执行的核心动作是什么,如:VIDEO(生成视频)
      status
      string 
      当前状态
      必需
      cost
      string 
      必需
      最终的开销,单位是分
      示例
      {
          "id": "123",
          "action": "DESCRIBE",
          "status": "SUCCESS",
          "cost": 30,
          "promptEn": "1️⃣ White haired anime boy...",
          "description": "Submit success",
          "submitTime": 1712205491372,
          "startTime": 1712205494313,
          "finishTime": 1712205499534,
          "progress": "100%",
          "imageUrl": "https://xxx.jpg",
          "cnTempImgUrl": "http://xxxxxx.com/xxx/xxx/e6278fb4db0a44c79b3f80d0d977350.png",
          "buttons": [
              {
                  "customId": "FL::Job::PicReader::1",
                  "emoji": "1️⃣"
              },
              {
                  "customId": "FL::Job::PicReader::2",
                  "emoji": "2️⃣"
              }
          ]
      }
      上一页
      图生视频
      下一页
      查询多个任务
      Built with