> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jimmyai.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建视频

> Create a new video generation task using Sora models. Route 1 (route1): model sora2-12s, duration must be 12. Route 3: sora2-gz-stable / sora2-gz-sp. Route 6: see model config.

## 线路与模型

在开放平台为模型配置 `route` 后，通过本接口创建任务。常用 Sora 模型示例：

| 线路  | `route` 配置 | 模型示例                            | 时长         |
| --- | ---------- | ------------------------------- | ---------- |
| 线路一 | `route1`   | `sora2-12s`                     | 仅 **12** 秒 |
| 线路三 | `route3`   | `sora2-gz-stable`、`sora2-gz-sp` | 按模型        |
| 线路六 | `route6`   | `openai-sora-2` 等               | 按模型        |

### 线路一（`sora2-12s`）

* `duration` 必须为 `12`
* `orientation`：`landscape` → 16:9，`portrait` → 9:16
* 可选 `images` 传一张参考图 URL（图生视频）
* 任务查询与其它视频任务相同：[查询视频任务](/zh/api-reference/common/query)

<Note>
  视频结果 URL 保存约 **3 天**，请及时转存。
</Note>


## OpenAPI

````yaml POST /api/open-api/v1/videos
openapi: 3.1.0
info:
  title: Jimmy AI OpenAPI
  description: API for Jimmy AI video generation services
  version: 1.0.0
servers:
  - url: https://www.jimmyai.cn
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/open-api/v1/videos:
    post:
      summary: Create Video Task
      description: >-
        Create a new video generation task using Sora models. Route 1 (route1):
        model sora2-12s, duration must be 12. Route 3: sora2-gz-stable /
        sora2-gz-sp. Route 6: see model config.
      operationId: createVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
      responses:
        '200':
          description: Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
components:
  schemas:
    VideoGenerationRequest:
      type: object
      required:
        - model
        - prompt
        - duration
      properties:
        model:
          type: string
          description: >-
            Model name. Route 1: sora2-12s (duration must be 12). Route 3:
            sora2-gz-stable, sora2-gz-sp, etc.
        prompt:
          type: string
          description: Text prompt for video generation
        duration:
          type: integer
          description: Duration in seconds. Route 1 sora2-12s must be 12
        orientation:
          type: string
          enum:
            - landscape
            - portrait
          description: Video orientation
        images:
          type: array
          items:
            type: string
          description: Reference image URLs
    VideoGenerationResponse:
      type: object
      properties:
        code:
          type: string
          example: '20000'
        msg:
          type: string
          example: ok
        data:
          type: object
          properties:
            task_id:
              type: string
            status:
              type: string
            model:
              type: string
            created_at:
              type: integer
              format: int64
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````