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

# Video Generation APIs

# Video APIs

## Overview

Video generation is asynchronous. Use this lifecycle:

1. **Submit** a job (`POST /v1/videos`)
2. **Poll** status (`GET /v1/videos/{id}`)
3. **Download** output (`GET /v1/videos/{id}/content`)

## Base URL

`https://api.sciforium.com/v1`

## Authentication

Include your API token in the headers:

* `Authorization: Bearer <TOKEN>`
* `x-api-key: <TOKEN>`

***

## Supported Endpoints

| Method   | Path                   | Purpose                      |
| -------- | ---------------------- | ---------------------------- |
| `POST`   | `/videos`              | Create a video job           |
| `GET`    | `/videos/{id}`         | Get video job status         |
| `GET`    | `/videos/{id}/content` | Download video content (MP4) |
| `GET`    | `/videos`              | List video jobs              |
| `DELETE` | `/videos/{id}`         | Delete a video job           |

***

## 1) Create Video Job

**Method:** `POST`\
**Endpoint:** `https://api.sciforium.com/v1/videos`\
**Content-Type:** `multipart/form-data`\
**Success Status:** `201 Created`

### Request fields

| Field             | Type   | Required | Description                                                                                         |
| ----------------- | ------ | -------- | --------------------------------------------------------------------------------------------------- |
| `prompt`          | string | Yes      | Prompt text (`1..32000` chars).                                                                     |
| `model`           | string | Yes      | Video model ID.                                                                                     |
| `seconds`         | string | No       | Duration in seconds: `2`, `4`, `8`, `12`. Default: `4`.                                             |
| `size`            | string | No       | One of `720x1280`, `1280x720`, `1024x1792`, `1792x1024`, `640x480`, `480x640`. Default: `720x1280`. |
| `input_reference` | file   | No       | Optional reference image for image-to-video flows.                                                  |

### Example cURL (text-to-video)

```bash theme={null}
curl -X POST "https://api.sciforium.com/v1/videos" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-api-key: $TOKEN" \
  -F "model=Wan-AI/Wan2.2-T2V-A14B-Diffusers" \
  -F "prompt=A cinematic drone shot over mountain ridges at sunrise" \
  -F "seconds=4" \
  -F "size=640x480"
```

***

## 2. Check the Status: GET /v1/videos/{id}

Since you don't know exactly when the video will be finished, you "poll" this endpoint (requesting it every 5–10 seconds) or wait for a **Webhook** notification if you have one configured.

### The Response

The status field is the most important part of this response.

| **Status**   | **Meaning**                                   |
| :----------- | :-------------------------------------------- |
| queued       | Waiting for available compute.                |
| in\_progress | The model is currently rendering frames.      |
| completed    | The video is ready for download.              |
| failed       | Something went wrong (check the error field). |

**Example of a completed status:**

```json theme={null}
{
  "id": "vid_abc123xyz",
  "status": "completed",
  "progress": 1.0,
  "expires_at": 1775701400 
}
```

**Note:** Most completed videos are only stored on OpenAI's servers for **24 hours** before they are deleted for privacy and storage reasons.

***

## 3. Retrieve the File: GET /v1/videos/{id}/content

Once the status is completed, you call this final endpoint to get the actual media.

### The Response

Unlike the other two endpoints which return JSON, this endpoint returns the **binary data** of the video file (usually an .mp4).

**Content-Type**: video/mp4 **Behavior**: In a browser or code, this will trigger a download or allow you to stream the bytes directly into a file buffer.

***
