{
  "openapi": "3.0.0",
  "info": {
    "title": "Dreamina",
    "version": "1.0.0",
    "description": "API reference for Dreamina on Ace Data Cloud."
  },
  "servers": [
    {
      "url": "https://api.acedata.cloud",
      "description": "Ace Data Cloud API"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token from https://platform.acedata.cloud"
      }
    },
    "schemas": {
      "DreaminaTaskRequestPayload": {
        "type": "object",
        "additionalProperties": true,
        "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Dreaminataskrequestpayload.07Fb7A224250"
      },
      "DreaminaTaskResultPayload": {
        "type": "object",
        "additionalProperties": true,
        "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Dreaminataskresultpayload.D56682E3Aa21"
      },
      "DreaminaTaskRecord": {
        "type": "object",
        "required": [
          "id",
          "type",
          "created_at",
          "trace_id",
          "request"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Id.8D183733Eb9E"
          },
          "type": {
            "type": "string",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Type.129A6Cb7F94C"
          },
          "trace_id": {
            "type": "string",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Trace Id.1B52C4E601F8"
          },
          "request": {
            "$ref": "#/components/schemas/DreaminaTaskRequestPayload"
          },
          "response": {
            "$ref": "#/components/schemas/DreaminaTaskResultPayload"
          },
          "created_at": {
            "type": "number",
            "format": "double",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Created At.34224861Cf3E"
          },
          "started_at": {
            "type": "number",
            "format": "double",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Started At.1B771C4280Bb"
          },
          "finished_at": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Finished At.F0A46B7C36C8"
          },
          "elapsed": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "nullable": true,
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Elapsed.4D497Ce6760B"
          },
          "user_id": {
            "type": "string",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.User Id.Bc0Ea0207E2E"
          },
          "actor_user_id": {
            "type": "string",
            "nullable": true,
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Actor User Id.7Dda48764306"
          },
          "api_id": {
            "type": "string",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Api Id.3Ef76B36D8Bd"
          },
          "application_id": {
            "type": "string",
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Application Id.5734Fb679B98"
          },
          "credential_id": {
            "type": "string",
            "nullable": true,
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Credential Id.D60C2Cc2499A"
          },
          "authorization_id": {
            "type": "string",
            "nullable": true,
            "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Authorization Id.3107808C4A81"
          }
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/dreamina/videos": {
      "post": {
        "summary": "Dreamina Videos",
        "description": "Dreamina Videos",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image_url",
                  "audio_url"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "omnihuman-1.5"
                    ],
                    "default": "omnihuman-1.5",
                    "description": "Dreamina Videos Model"
                  },
                  "image_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Dreamina Videos Image Url"
                  },
                  "audio_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Dreamina Videos Audio Url"
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Dreamina Videos Prompt"
                  },
                  "mask_url": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "Dreamina Videos Mask Url"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Dreamina Videos Callback Url"
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Dreamina Videos Async"
                  }
                }
              },
              "example": {
                "model": "omnihuman-1.5",
                "image_url": "https://cdn.acedata.cloud/4hfydw.jpg",
                "audio_url": "https://cdn.acedata.cloud/assets/examples/fish/5ade0339-5f11-487e-aacc-06a908271706-8e3fcb0e5547.mp3"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dreamina Videos Response 200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": true,
                    "task_id": "0c0b4d3a-2f1e-4a6b-9c2d-2b3c4d5e6f70",
                    "trace_id": "a9063166-26ed-4451-85b5-54e896817c69",
                    "data": {
                      "task_id": "362b4fed67bd11f1ad1100163e57d510",
                      "status": "done",
                      "video_url": "https://cdn.acedata.cloud/634d760216.mp4",
                      "image_url": "https://cdn.acedata.cloud/4hfydw.jpg",
                      "audio_url": "https://cdn.acedata.cloud/6f7d62b18b.wav"
                    }
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Dreamina Videos Response 200 Success"
                    },
                    "task_id": {
                      "type": "string",
                      "description": "Dreamina Videos Response 200 Task Id"
                    },
                    "trace_id": {
                      "type": "string",
                      "description": "Dreamina Videos Response 200 Trace Id"
                    },
                    "data": {
                      "type": "object",
                      "description": "Dreamina Videos Response 200 Data",
                      "properties": {
                        "task_id": {
                          "type": "string",
                          "description": "Dreamina Videos Response 200 Data Task Id"
                        },
                        "status": {
                          "type": "string",
                          "description": "Dreamina Videos Response 200 Data Status"
                        },
                        "video_url": {
                          "type": "string",
                          "description": "Dreamina Videos Response 200 Data Video Url"
                        },
                        "image_url": {
                          "type": "string",
                          "description": "Dreamina Videos Response 200 Data Image Url"
                        },
                        "audio_url": {
                          "type": "string",
                          "description": "Dreamina Videos Response 200 Data Audio Url"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Dreamina Videos Response 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "bad_request",
                      "message": "image_url is required (a public URL of a portrait image)"
                    },
                    "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Dreamina Videos Response 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "authorization_missing",
                      "message": "Authorization header is missing."
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "403": {
            "description": "Dreamina Videos Response 403",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "forbidden",
                      "message": "volcengine access key is invalid or not authorized for omnihuman"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Dreamina Videos Response 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "too_many_requests",
                      "message": "too many requests, please try again later"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "Dreamina Videos Response 500",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "api_error",
                      "message": "internal server error, please contact admin"
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "operationId": "createDreaminaVideos"
      }
    },
    "/dreamina/tasks": {
      "post": {
        "summary": "Dreamina Tasks",
        "description": "Dreamina Tasks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "retrieve",
                      "retrieve_batch"
                    ],
                    "default": "retrieve",
                    "description": "Dreamina Tasks Action"
                  },
                  "id": {
                    "type": "string",
                    "description": "Dreamina Tasks Id"
                  },
                  "trace_id": {
                    "type": "string",
                    "description": "Dreamina Tasks Trace Id"
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Dreamina Tasks Ids"
                  }
                },
                "example": {
                  "action": "retrieve",
                  "id": "task-id"
                }
              },
              "example": {
                "action": "retrieve",
                "id": "362b4fed-67bd-11f1-ad11-00163e57d510"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dreamina Tasks Response 200",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DreaminaTaskRecord"
                    },
                    {
                      "type": "object",
                      "required": [
                        "items",
                        "count"
                      ],
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DreaminaTaskRecord"
                          },
                          "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Items.389A20659245"
                        },
                        "count": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.Count.E3C529D8163A"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "description": "Openapi.B35Fd4618Da14Aec9E405E361Ed26223.2.C06Deb71A0B1"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Dreamina Tasks Response 400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "bad_request",
                      "message": "id or trace_id is required to retrieve a task"
                    },
                    "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Dreamina Tasks Response 401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "invalid_token",
                      "message": "The specified token is invalid or wrong."
                    },
                    "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "429": {
            "description": "Dreamina Tasks Response 429",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "too_many_requests",
                      "message": "You have exceeded the rate limit."
                    },
                    "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "500": {
            "description": "Dreamina Tasks Response 500",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "api_error",
                      "message": "Internal server error."
                    },
                    "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
                  },
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "operationId": "queryDreaminaTasks"
      }
    }
  }
}
