# 智能剪辑-模板详情 API Documentation

> 获取指定智能剪辑模板的结构详情（画布、图层等）

## Overview

This document describes how to call the **智能剪辑-模板详情** API.

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

## 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/smartclip/template_detail`
- **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 |
|-----------|----------|-------------|
| `key` | Yes | 平台密钥 |
| `id` | Yes | 模板ID（必填，兼容 template_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/smartclip/template_detail?key=你的密钥
```

## Details

## 请求HEADER：

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

**鉴权说明：**请在 URL 参数或 JSON Body 中携带 `key`（平台 API 密钥）。使用 POST + JSON 时，`key` 必须写在 JSON Body 内。

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| key | 是 | string | 你的密钥 | 平台 API 密钥 |
| id | 是 | string | 6a2668a137004e003477b6ed | 模板 ID（也兼容字段名 template_id） |

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| code | int | 200 成功 |
| msg | string | 状态信息 |
| data.result.data.id | string | 模板 ID |
| data.result.data.name | string | 模板名称 |
| data.result.data.coverUrl | string | 封面 URL |
| data.result.data.scene | string | 应用场景 |
| data.result.data.videoStructInfo | object | 模板结构（canvas、headerLayer、subtitleLayer 等图层） |

## Response Example

```json
{
    "code": 200,
    "msg": "success",
    "data": {
        "result": {
            "code": "Succeed",
            "data": {
                "id": "6a2668a137004e003477b6ed",
                "name": "双语大橙",
                "coverUrl": "https://example.com/cover.jpg",
                "scene": "realMan",
                "videoStructInfo": {
                    "editInfo": {
                        "canvas": {
                            "width": 1080,
                            "height": 1920
                        }
                    }
                }
            }
        }
    }
}
```

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