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

# Sora 2

> OpenAI Sora 2 video generation model. Generate videos from text prompts and reference images.

Sora 2 is OpenAI's video generation model, available through Anyfast API. It supports text-to-video, image-to-video (first frame reference), and video remix.

## Key capabilities

* **Text-to-Video** — Generate videos from natural language descriptions
* **Image-to-Video** — Use a reference image as the first frame
* **Video Remix** — Reuse structure, motion, and framing from a previous video
* **Flexible Duration** — 4, 8, or 12 seconds
* **Multiple Resolutions** — Portrait (720x1280), Landscape (1280x720), and more

## Workflow

The Sora 2 API is asynchronous. Follow these steps:

1. **Create task** — `POST /v1/videos`
2. **Query status** — `GET /v1/videos/{id}` (poll until `status` is `completed`)
3. **Download video** — `GET /v1/videos/{id}/content`

## Quick example

### Step 1: Create task

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.ai/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=sora-2" \
    -F "prompt=A cat walking through a sunflower field at golden sunset" \
    -F "seconds=12" \
    -F "size=1280x720"
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://www.anyfast.ai/v1/videos",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      data={
          "model": "sora-2",
          "prompt": "A cat walking through a sunflower field at golden sunset",
          "seconds": "12",
          "size": "1280x720"
      }
  )

  task = response.json()
  print(f"Task ID: {task['id']}")
  ```
</CodeGroup>

### Step 2: Query status

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.ai/v1/videos/video_69b131ea03548190925a6a06febf993b \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  status = requests.get(
      f"https://www.anyfast.ai/v1/videos/{task['id']}",
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  ).json()

  print(f"Status: {status['status']}, Progress: {status['progress']}")
  ```
</CodeGroup>

### Step 3: Download video

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.ai/v1/videos/video_69b131ea03548190925a6a06febf993b/content \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  result = requests.get(
      f"https://www.anyfast.ai/v1/videos/{task['id']}/content",
      headers={"Authorization": "Bearer YOUR_API_KEY"}
  ).json()

  print(f"Video URL: {result['video_url']}")
  ```
</CodeGroup>

## Parameters

| Parameter         | Type   | Required | Description                                                                                                                             |
| ----------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `model`           | string | Yes      | Must be `sora-2`                                                                                                                        |
| `prompt`          | string | Yes      | Natural language description of the video. Include shot type, subject, action, setting, lighting. Keep single-purpose for best results. |
| `seconds`         | string | No       | `4`, `8`, `12`. Default: `4`                                                                                                            |
| `size`            | string | No       | `720x1280`, `1280x720`, `1024x1792`, `1792x1024`. Default: `720x1280`                                                                   |
| `input_reference` | file   | No       | Reference image for the first frame. Accepts image/jpeg, image/png, image/webp.                                                         |
| `remix_video_id`  | string | No       | ID of a completed video to reuse its structure, motion, and framing.                                                                    |

<Card title="API Reference" icon="code" href="/api-reference/model-api/openai/sora-2">
  View the interactive API playground for Sora 2.
</Card>

<script src="/feedback.js" />
