# AI数字人高清合成 - 任务查询 API Documentation

> 查询数字人高清合成任务结果。配合创建接口使用，创建后用 task_id 轮询。查询不扣费。支持 GET / POST。

## Overview

This document describes how to call the **AI数字人高清合成 - 任务查询** API.

- **Model / path slug**: `aihuman/create_query`
- **Task type**: `sync` (`sync` = synchronous, `async` = create task then poll / callback)
- **HTML docs**: `/doc/48`

## Authentication

All API requests require your platform API key as the query parameter `key`:

```
?key=YOUR_API_KEY
```

Get API Key:
1. Sign in to the console
2. Open [API Key Management](/user/key) and create or copy your key
3. Append `key=YOUR_API_KEY` to the request URL (or pass it in form/JSON when the endpoint accepts it)

---

## API Information

- **URL**: `GET|POST https://apis.xiaobao.ink/api/aihuman/create_query`
- **Content-Type**: `application/json` (request body commonly `application/json` or `application/x-www-form-urlencoded` for POST)
- **HTTP Method**: `GET / POST`
- **Note**: This endpoint accepts both GET query parameters and POST form/JSON body.

### Request Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `task_id` | Yes | 数字人高清合成创建接口返回的任务ID |

> **Note**: `key` (API key) is required for authenticated calls even if omitted from the parameter list above.

### Request Example

```
https://apis.xiaobao.ink/api/aihuman/create_query?task_id=你的task_id&key=你的密钥
```

## Details

## 接口说明：

配合数字人高清合成创建接口使用。创建任务后，用返回的 `task_id` 查询结果。成片会转存到本站，请及时下载。查询不扣费。

**请求方法：**支持 `GET` 与 `POST`（表单或 JSON Body 均可传 `task_id`）。

关联创建：[AI数字人高清合成](/doc/11)

## 请求HEADER：

| 名称 | 值 |
| --- | --- |
| Content-Type | application/json 或 application/x-www-form-urlencoded（POST 时） |

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| task_id | 是 | string | s546950f38680f49 | 创建接口返回的任务ID；GET 查询参数，或 POST 表单/JSON |

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| task_id | string | 任务ID |
| status | int | 0 处理中，1 成功，2 失败 |
| video_url | string | 成片地址（本站可访问），仅成功时有值 |
| video_time | float | 成片时长（秒），仅成功时有值 |
| video_size | int | 成片大小（字节），仅成功时有值 |
| fail_reason | string | 失败原因 |
| power_cost | number | 本平台实际扣点。处理中为 0，成功后按成片时长结算 |

处理中请间隔数秒再次查询；status 为 1 / 2 时停止。

## Response Example

```json
{
    "code": 200,
    "msg": "查询成功",
    "data": {
        "task_id": "s546950f38680f49",
        "status": 1,
        "video_url": "https://apis.xiaobao.ink/upload/video/2025/12/28/demo.mp4",
        "video_time": 15,
        "video_size": 21427169,
        "fail_reason": "",
        "power_cost": 150
    }
}
```

## Error Codes

| HTTP 响应状态码 | 说明 |
| --- | --- |
| 200 | 查询成功 |
| 400 | 缺少 task_id 或任务不存在 |
| 401 | 认证失败，请检查 key |

## Usage Flow

1. Obtain your API Key from the console
2. Call the endpoint with `key` and required parameters
3. Parse the JSON (or binary) response according to the examples above

---

_Generated for AI / LLM consumption. Source of truth: `api_list` (same as HTML `/doc/{id}`)._
