# 超凡数字人 API Documentation

> 将一张照片 + 音频 转换为音频驱动的说话或唱歌虚拟形象视频

## Overview

This document describes how to call the **超凡数字人** API.

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

## 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**: `POST https://apis.xiaobao.ink/api/video/phototalk`
- **Content-Type**: `application/json` (request body commonly `application/json` or `application/x-www-form-urlencoded` for POST)
- **HTTP Method**: `POST`

### Request Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `image` | Yes | 人物、动物主体照片，要清晰 |
| `audio` | Yes | 驱动的声音 |
| `prompt` | Yes | 额外的提示词 |
| `resolution` | Yes | 分辨率 480p、720p |
| `seed` | Yes | 随机参数 |
| `notify` | Yes | 回调地址 |

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

### Request Example

```
https://apis.xiaobao.ink/api/video/phototalk?key=你的密钥
```

## Details

## 请求HEADER：

| 名称 | 值 |
| --- | --- |
| Content-Type | application/json |

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| key | 是 | string | 35kj5jnlj53453kl5j43nj5 | 接口密钥,在控制台->密钥管理查看 |
| image | 是 | string | https://a1t/images/store4.jpg |  网络图片URL |
| audio | 是 | string | mp3 | 音频地址 |
| resolution | 否 | string | 480p | 480p  、720p |
| seed | 否 | string | -1 |  |
| notify | 是 | string | https://xx.com/xxx | 回调地址 （ 任务推送地址） |

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| code | int | 状态码 |
| msg | string | 状态信息 |
| data | string | 请求结果数据集 |
| - task_id | string | 任务ID |
| exec_time | float | 执行耗时 |
| user_ip | string | 客户端IP |

## Error Codes

| Status / code | Description |
|---------------|-------------|
| 200 / success | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, please check API Key |
| 402 | Insufficient account balance / points |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |

## Usage Flow

1. **Create Task**: Call this API with your `key` and required parameters
2. **Get Task ID**: Read the task id from the response
3. **Wait for Results**: Use the notify/callback URL if provided, or poll the related query endpoint
4. **Get Results**: When the task succeeds, read result URLs / payload from the response

---

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