# 索拉Pro API Documentation

> 最新发布的AI视频生成模型，支持文本转视频和图像转视频功能。它提供逼真的动作效果、物理一致性，并改善了风格、场景和比例的控制，非常适合创意应用和社交媒体内容。

## Overview

This document describes how to call the **索拉Pro** API.

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

## 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/sora`
- **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 |
|-----------|----------|-------------|
| `prompt` | Yes | 提示词 描述所需视频运动的文本提示（最大长度：10000 个字符） |
| `image_urls` | Yes | 参考图 用作第一帧的图片 URL。必须可公开访问（上传后的文件 URL |
| `aspect_ratio` | Yes | 分辨率 Allowed values: portrait landscape Default: landscape |
| `duration` | Yes | 时长 10、15  Allowed values: 10 15 Default: 10 |
| `notify` | Yes | 回调地址 |
| `` | 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/sora?key=你的密钥
```

## Details

## 请求HEADER：

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

## 请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| key | 是 | string | 35kj5jnlj53453kl5j43nj5 | 接口密钥,在控制台->密钥管理查看 |
| prompt | 是 | string |  提示词  | 图片base64编码数据或网络图片URL |
| image_urls | 否 | array | ["https://file.1x.com/s/17594315607644506ltpf.jpg"] | 参考图 |
| aspect_ratio | 否 | string | landscape | 分辨率 |
| duration | 否 | string | 10 | 时长 |
| notify | 是 | string | https://xx.com | 回调地址 |

## 返回参数说明：

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

## Error Codes

200: Success - Request has been processed successfully
401: Unauthorized - Authentication credentials are missing or invalid
402: Insufficient Credits - Account does not have enough credits to perform the operation
404: Not Found - The requested resource or endpoint does not exist
422: Validation Error - The request parameters failed validation checks
429: Rate Limited - Request limit has been exceeded for this resource
433: Request Limit - Sub-key Usage Exceeds Limit
455: Service Unavailable - System is currently undergoing maintenance
500: Server Error - An unexpected error occurred while processing the request
501: Generation Failed - Content generation task failed
505: Feature Disabled - The requested feature is currently disabled

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