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

# OpenAI Sora 2

> Create asynchronous video tasks with sora-2 via POST /v1/predictions.

## Overview

**OpenAI Sora 2** (`sora-2`) supports:

* **Text-to-video** — `prompt` (up to **32,000** characters)
* **Reference-guided generation** — optional `first_frame_url`

Output is **720P** only.

## Input parameters

| Field             | Required | Default | Notes                                      |
| ----------------- | -------- | ------- | ------------------------------------------ |
| `prompt`          | Yes      | —       | Max **32,000** characters                  |
| `aspect_ratio`    | No       | `16:9`  | `16:9` or `9:16`                           |
| `resolution`      | No       | `720P`  | `720P` only                                |
| `duration`        | No       | `4`     | `4`, `8`, or `12` seconds                  |
| `first_frame_url` | No       | —       | Optional reference URL to guide generation |


## OpenAPI

````yaml en/api-reference/video-series/openai/sora-2-video-generate.json POST /v1/predictions
openapi: 3.1.0
info:
  title: OpenAI Sora 2
  version: 1.0.0
servers:
  - url: https://api.shuyou.ai
security:
  - bearerAuth: []
paths:
  /v1/predictions:
    post:
      tags:
        - Video Generation
      summary: OpenAI Sora 2
      description: >-
        OpenAI Sora 2 (`sora-2`) creates videos asynchronously via POST
        /v1/predictions. Supports text-to-video and optional `first_frame_url`
        as a reference for generation. Poll [Get a
        prediction](/en/api-reference/task-management/get-prediction) using
        `data.task_id`, or configure top-level `webhook` for completion
        callbacks.
      operationId: createSora2VideoPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Sora2VideoPredictionRequest'
            examples:
              text_to_video:
                summary: Text to video
                value:
                  model: sora-2
                  input:
                    prompt: >-
                      A cinematic shot of a majestic lion in the savannah at
                      golden hour
                    aspect_ratio: '16:9'
                    resolution: 720P
                    duration: 4
              text_to_video_minimal:
                summary: Minimal request
                value:
                  model: sora-2
                  input:
                    prompt: A cat playing on the grass
              image_to_video:
                summary: With first frame reference
                value:
                  model: sora-2
                  input:
                    prompt: The scene comes to life with gentle natural motion
                    aspect_ratio: '9:16'
                    resolution: 720P
                    duration: 8
                    first_frame_url: https://example.com/first-frame.png
                  webhook: https://api.shuyou.ai/backend/api/callback
      responses:
        '200':
          description: Async task created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PredictionTaskResponse'
              example:
                data:
                  task_id: 2c4d50261173430290971a2395a3b607
                  task_status: processing
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Model access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Sora2VideoPredictionRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: Model ID. Use `sora-2` for this endpoint.
          enum:
            - sora-2
          default: sora-2
          example: sora-2
        input:
          $ref: '#/components/schemas/Sora2VideoInput'
        webhook:
          type: string
          format: uri
          description: >-
            Optional HTTPS callback URL when the task completes, fails, or is
            cancelled.
    PredictionTaskResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            task_id:
              type: string
              description: Async task ID. Use with Get a prediction or webhook correlation.
              example: 2c4d50261173430290971a2395a3b607
            task_status:
              type: string
              description: Current task status, e.g. `processing`.
              example: processing
          required:
            - task_id
            - task_status
      required:
        - data
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            type:
              type: string
    Sora2VideoInput:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          maxLength: 32000
          description: The text prompt describing the video you want to generate.
          example: A cinematic shot of a majestic lion in the savannah at golden hour
        aspect_ratio:
          type: string
          description: The aspect ratio of the generated video.
          enum:
            - '16:9'
            - '9:16'
          default: '16:9'
          example: '16:9'
        resolution:
          type: string
          description: The resolution of the generated video.
          enum:
            - 720P
          default: 720P
          example: 720P
        duration:
          type: integer
          description: The duration of the generated video in seconds.
          enum:
            - 4
            - 8
            - 12
          default: 4
          example: 4
        first_frame_url:
          type: string
          format: uri
          description: >-
            Optional reference object that guides generation (e.g. first-frame
            image URL).
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer YOUR_API_KEY`'

````