# 提交 Seed3D 图生 3D 任务

> 通用

提交异步图生 3D 任务。请求体中通过 `input.content` 传入单张图片，通过 `input.content` 中 `type: text` 的文本参数指定输出文件格式和面数级别。

**图片要求**：
- 仅支持 1 张图片
- 支持公网 URL 或 Base64 Data URL（`data:image/<格式>;base64,<编码>`）
- 图片尺寸需在 [300, 6000] px 范围内
- 建议使用清晰的真实物体照片，纯色图片或简单几何图形可能生成失败

## 请求地址

`POST https://api.modelverse.cn/v1/tasks/submit`

## 请求体

## 响应

- **200** — 任务提交成功。
- **400** — ModelVerse 本地请求校验失败（图片数量不为 1、参数值不在允许范围等），不会创建任务，也不会计费。
- **500** — 任务提交失败。图片小于 300px、图片格式不支持、图片 URL 无法访问、图片内容无法解析或服务暂时异常等情形，均可能返回 HTTP 500。
提交失败时不会返回 task_id；如未成功创建并完成任务，则不计费。

- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "doubao-seed3d-2-0-260328 3D 模型生成接口文档",
    "version": "1.0.0",
    "description": "这是 ModelVerse 上 `doubao-seed3d-2-0-260328` 的图生 3D 接口文档，说明如何提交任务、查询状态、取消排队任务。\n接口路径包括 `POST /v1/tasks/submit`、`GET /v1/tasks/status`、`GET /v1/tasks/cancel`。\n\n模型接受单张图片（公网 URL 或 Base64 Data URL），输出 3D 模型文件（zip 压缩包）。\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "中国大陆"
    },
    {
      "url": "https://api.umodelverse.ai",
      "description": "海外"
    },
    {
      "url": "https://api-us-ca.umodelverse.ai",
      "description": "美国洛杉矶"
    },
    {
      "url": "https://api-sg.umodelverse.ai",
      "description": "新加坡"
    },
    {
      "url": "https://api-ge-fra.umodelverse.ai",
      "description": "法兰克福"
    }
  ],
  "tags": [
    {
      "name": "Doubao Seed3D 2.0",
      "description": "豆包 Seed3D 图生 3D 异步任务。"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "Doubao Seed3D 2.0"
        ],
        "operationId": "submitDoubaoSeed3DTask",
        "summary": "提交 Seed3D 图生 3D 任务",
        "description": "提交异步图生 3D 任务。请求体中通过 `input.content` 传入单张图片，通过 `input.content` 中 `type: text` 的文本参数指定输出文件格式和面数级别。\n\n**图片要求**：\n- 仅支持 1 张图片\n- 支持公网 URL 或 Base64 Data URL（`data:image/<格式>;base64,<编码>`）\n- 图片尺寸需在 [300, 6000] px 范围内\n- 建议使用清晰的真实物体照片，纯色图片或简单几何图形可能生成失败\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Seed3DSubmitRequest"
              },
              "examples": {
                "urlImage": {
                  "summary": "URL 图片提交（默认参数）",
                  "value": {
                    "model": "doubao-seed3d-2-0-260328",
                    "input": {
                      "content": [
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/bird.jpg"
                          }
                        }
                      ]
                    }
                  }
                },
                "base64Image": {
                  "summary": "Base64 图片提交",
                  "value": {
                    "model": "doubao-seed3d-2-0-260328",
                    "input": {
                      "content": [
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
                          }
                        }
                      ]
                    }
                  }
                },
                "textParams": {
                  "summary": "指定输出格式与面数级别",
                  "value": {
                    "model": "doubao-seed3d-2-0-260328",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "--subdivisionlevel high --fileformat obj"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/bird.jpg"
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务提交成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "已提交任务",
                    "value": {
                      "output": {
                        "task_id": "cgt-2025******-****"
                      },
                      "request_id": "xxx"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "ModelVerse 本地请求校验失败（图片数量不为 1、参数值不在允许范围等），不会创建任务，也不会计费。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "任务提交失败。图片小于 300px、图片格式不支持、图片 URL 无法访问、图片内容无法解析或服务暂时异常等情形，均可能返回 HTTP 500。\n提交失败时不会返回 task_id；如未成功创建并完成任务，则不计费。\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "Doubao Seed3D 2.0"
        ],
        "operationId": "getDoubaoSeed3DTaskStatus",
        "summary": "查询 Seed3D 任务状态",
        "description": "查询异步任务状态。任务成功后，`output.urls` 中返回 3D 模型文件的 zip 下载地址。\n\n- zip 文件 URL 带有时效签名，有效期约 24 小时，请及时下载转存。\n- 任务记录保留 7 天，过期后无法查询。\n",
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "由 `/v1/tasks/submit` 返回的 `output.task_id`。",
            "schema": {
              "type": "string"
            },
            "example": "cgt-2025******-****"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DStatusResponse"
                },
                "examples": {
                  "running": {
                    "summary": "运行中任务",
                    "value": {
                      "output": {
                        "task_id": "cgt-2025******-****",
                        "task_status": "Running",
                        "submit_time": 1795162540
                      },
                      "usage": {
                        "prompt_tokens": 0,
                        "completion_tokens": 0,
                        "total_tokens": 0
                      },
                      "request_id": ""
                    }
                  },
                  "success": {
                    "summary": "成功任务",
                    "value": {
                      "output": {
                        "task_id": "cgt-2025******-****",
                        "task_status": "Success",
                        "urls": [
                          "https://ark-content-generation-cn-beijing.tos-cn-beijing.volces.com/doubao-seed3d-2-0/xxx.zip?X-Tos-Signature=xxx"
                        ],
                        "submit_time": 1795162540,
                        "finish_time": 1795163260
                      },
                      "usage": {
                        "prompt_tokens": 0,
                        "completion_tokens": 30000,
                        "total_tokens": 30000
                      },
                      "request_id": ""
                    }
                  },
                  "failure": {
                    "summary": "失败任务（不计费）",
                    "value": {
                      "output": {
                        "task_id": "cgt-2025******-****",
                        "task_status": "Failure",
                        "submit_time": 1795161405,
                        "finish_time": 1795161465,
                        "error_message": "code: InvalidParameter, message: 当前图片不可用，请更换其他图片"
                      },
                      "usage": {
                        "prompt_tokens": 0,
                        "completion_tokens": 0,
                        "total_tokens": 0
                      },
                      "request_id": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "任务标识无效或无权访问该任务。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/cancel": {
      "get": {
        "tags": [
          "Doubao Seed3D 2.0"
        ],
        "operationId": "cancelDoubaoSeed3DTask",
        "summary": "取消 Seed3D 排队任务",
        "description": "此接口仅用于取消排队中的任务，不提供删除功能。系统根据 ModelVerse 本地任务状态处理：\n\n| 当前状态 | 行为 | 说明 |\n|---|---|---|\n| Pending | 允许取消 | 调用上游取消排队任务，取消成功，不计费 |\n| Running | 拒绝操作 | 返回 409 错误，运行中任务不可取消 |\n| Success / Failure / Expired | 拒绝操作 | 返回 409 错误，不删除任务，状态保持不变 |\n| Cancelled | 幂等返回成功 | 不重复调用上游 |\n\n**注意**：成功任务不会通过此接口删除，任务记录保留 7 天。\n",
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "要取消的排队任务 ID。",
            "schema": {
              "type": "string"
            },
            "example": "cgt-2025******-****"
          }
        ],
        "responses": {
          "200": {
            "description": "取消成功，或任务此前已取消。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DCancelResponse"
                },
                "examples": {
                  "cancelled": {
                    "summary": "取消成功",
                    "value": {
                      "id": "cgt-2025******-****",
                      "deleted": true,
                      "object": "video.deleted"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "任务不是 Pending 状态，不可取消；运行中或已结束的任务不会被删除。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seed3DErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "请在请求头中携带 `Authorization: Bearer {your_api_key}`。"
      }
    },
    "schemas": {
      "Seed3DSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "doubao-seed3d-2-0-260328",
            "description": "模型 ID，固定为 `doubao-seed3d-2-0-260328`。"
          },
          "input": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "content"
            ],
            "properties": {
              "content": {
                "type": "array",
                "minItems": 1,
                "description": "输入内容数组。必须包含 1 张图片（`type: image_url`），可选传入文本参数（`type: text`）。\n\n**图片**（必选）：通过 `type: image_url` 传入 1 张图片。\n\n**文本参数**（可选）：通过 `type: text` 指定输出文件格式和面数级别（弱校验方式），例如 `--subdivisionlevel medium --fileformat obj`。仅支持 `subdivisionlevel` 和 `fileformat` 参数，不支持自然语言提示词。\n",
                "items": {
                  "$ref": "#/components/schemas/Seed3DContentItem"
                }
              }
            }
          }
        }
      },
      "Seed3DContentItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image_url",
              "text"
            ],
            "description": "内容类型：\n- `image_url`：图片输入（必选，必须恰好 1 张）\n- `text`：文本参数（可选），用于指定输出文件格式和面数级别\n"
          },
          "image_url": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "url"
            ],
            "description": "当 `type` 为 `image_url` 时必传。",
            "properties": {
              "url": {
                "type": "string",
                "description": "图片地址。支持两种格式：\n- 公网 URL：`https://example.com/image.jpg`\n- Base64 Data URL：`data:image/jpeg;base64,<Base64 编码>`\n\n图片尺寸需在 [300, 6000] px 范围内。建议使用清晰的真实物体照片。\n"
              }
            }
          },
          "text": {
            "type": "string",
            "description": "当 `type` 为 `text` 时必传。用于指定输出文件格式和面数级别。\n\n支持以下参数，多个参数之间用空格分隔：\n\n- `--fileformat`：输出文件格式，可选 `glb`、`obj`、`usd`、`usdz`，默认 `glb`\n- `--subdivisionlevel`：多边形面数级别，可选 `high`、`medium`、`low`，默认 `medium`\n  - `high`：约 100 万面\n  - `medium`：约 50 万面\n  - `low`：约 10 万面\n\n示例：`--subdivisionlevel medium --fileformat obj`\n\n不支持自然语言提示词。参数填写错误时该参数将被忽略（弱校验）。\n"
          }
        }
      },
      "Seed3DSubmitResponse": {
        "type": "object",
        "properties": {
          "output": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "任务 ID，用于后续查询和取消。"
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "请求追踪 ID。"
          }
        }
      },
      "Seed3DStatusResponse": {
        "type": "object",
        "properties": {
          "output": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string"
              },
              "task_status": {
                "type": "string",
                "enum": [
                  "Pending",
                  "Running",
                  "Success",
                  "Failure",
                  "Cancelled",
                  "Expired"
                ],
                "description": "任务状态。"
              },
              "urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "成功时返回的 3D 模型文件 zip 下载地址（24 小时有效）。"
              },
              "submit_time": {
                "type": "integer",
                "format": "int64",
                "description": "任务提交时间（Unix 时间戳）。"
              },
              "finish_time": {
                "type": "integer",
                "format": "int64",
                "description": "任务完成时间（Unix 时间戳）。"
              },
              "error_message": {
                "type": "string",
                "description": "失败时的错误信息。"
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer",
                "description": "输入 token 数，固定为 0。"
              },
              "completion_tokens": {
                "type": "integer",
                "description": "输出 token 数，成功时为本次消耗的 token 数量。"
              },
              "total_tokens": {
                "type": "integer",
                "description": "总 token 数。"
              }
            }
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "Seed3DCancelResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "任务 ID。"
          },
          "deleted": {
            "type": "boolean",
            "description": "取消操作是否成功；重复取消已取消任务时也返回 true。"
          },
          "object": {
            "type": "string",
            "description": "固定为 `video.deleted`，为兼容既有异步任务接口保留的响应标识，不表示删除任务记录。"
          }
        }
      },
      "Seed3DErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "错误描述信息。"
              },
              "type": {
                "type": "string",
                "description": "错误类型。"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "错误码。"
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "出错的参数名。"
              },
              "trace_id": {
                "type": "string",
                "description": "请求追踪 ID。"
              }
            }
          }
        }
      }
    }
  }
}
```
