# AI视频翻译-查询导出任务 API Documentation

> 查询最终视频导出任务的状态和结果；这是视频翻译的最终步骤，获取最终带字幕的翻译视频文件；

## Overview

This document describes how to call the **AI视频翻译-查询导出任务** API.

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

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

### 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/video_translation/query_generate?task_id=你的task_id&key=你的密钥
```

## Details

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| task_id | 是 | string | generate-task-789 | 创建导出任务时返回的task_id |

## 返回参数：

| task_id | string | 任务ID |
| --- | --- | --- |
| status | int | 任务状态 |
| result.translated_video | string | 最终生成的翻译视频URL |
| result.video_url | string | 原始视频URL |
| result.audio_url | string | 音频URL |

## 完整调用流程：

1. 获取语音列表 → 2. 创建预览任务 → 3. 查询预览结果 → 4. 创建合成任务 → 5. 查询合成结果 → 6. 创建导出任务 → 7. 查询导出结果

## Response Example

```json
{
    "code": 200,
    "msg": "查询成功",
    "data": {
        "task_id": "generate-task-789",
        "status": 2,
        "progress": 100,
        "result": {
            "translated_video": "https://example.com/final_video.mp4",
            "video_url": "https://example.com/original_video.mp4",
            "audio_url": "https://example.com/audio.mp3"
        }
    }
}
```

## 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. 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}`)._
