# 执行 AI 包虚拟试戴 任务。

本接口用于发起 AI 包虚拟试戴流程。您需要提供源文件、参考文件（URL 或 ID），并指定性别与风格参数。任务会异步处理，您可以使用本响应返回的 task_id 查询其状态。

Endpoint: POST /s2s/v2.0/task/bag
Security: BearerAuthenticationV2

## Security:

  - `BearerAuthenticationV2` (unknown)
    http bearer

## Request fields (application/json):

  - `gender` (string, required)
    图片中人物的性别。
    Enum: "female", "male"

  - `src_file_url` (string, required)
    用于运行任务的文件 URL，该 URL 需可公开访问。
    Example: https://example.com/selfie.jpg

  - `ref_file_url` (string, required)
    用于运行任务的参考文件 URL，该 URL 需可公开访问。
    Example: https://example.com/accessory.jpg

  - `ref_file_id` (string, required)
    用于运行任务的参考文件 ID，取自上传文件接口返回的 file_id。
    Example: pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=

  - `src_file_id` (string, required)
    用于运行任务的文件 ID，取自上传文件接口返回的 file_id。
    Example: pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=

## Response 200:

  - `200` (unknown)
    任务执行成功

## Response 200 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 200

  - `data` (object)

  - `data.task_id` (string)
    该任务的 ID。凭这个 ID 可在 24 小时内查询任务结果。
    Example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe

## Response 400:

  - `400` (unknown)
    任务执行失败

## Response 400 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 400

  - `error` (string)
    错误信息
    Example: The operation could not be completed

  - `error_code` (string)
    错误码：
* InvalidParameters - 请求参数无效
* CreditInsufficiency - 点数不足，无法运行
* BadRequest - 请求参数不符合预期
* InvalidStyleGroup - 风格分组 ID 无效
* InvalidStyle - 风格 ID 无效
    Enum: "InvalidParameters", "CreditInsufficiency", "InvalidStyleGroup", "InvalidStyle", "BadRequest"

## Response 401:

  - `401` (unknown)
    API 密钥无效或缺失

## Response 401 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 401

  - `error` (string)
    Example: Invalid API key

## Response 429:

  - `429` (unknown)
    请求过多

## Response 429 fields (application/json):

  - `status` (integer)
    响应状态
    Example: 429

  - `error` (string)
    Example: Too many requests

