# Sora 2

> Video-to-video remix endpoint for Sora 2, OpenAI’s advanced model that transforms existing videos based on new text or image prompts allowing rich edits, style changes, and creative reinterpretations while preserving motion and structure


## Overview

- **Endpoint**: `https://fal.run/fal-ai/sora-2/video-to-video/remix`
- **Model ID**: `fal-ai/sora-2/video-to-video/remix`
- **Category**: video-to-video
- **Kind**: inference
**Tags**: video to video, audio, sora, 



## Pricing

The pricing is $0.1/s for Sora 2.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`video_id`** (`string`, _required_):
  The video_id from a previous Sora 2 generation. Note: You can only remix videos that were generated by Sora (via text-to-video or image-to-video endpoints), not arbitrary uploaded videos.
  - Examples: "video_123"

- **`prompt`** (`string`, _required_):
  Updated text prompt that directs the remix generation
  - Examples: "Change the cat's fur color to purple."

- **`delete_video`** (`boolean`, _optional_):
  Whether to delete the video after generation for privacy reasons. If True, the video cannot be used for remixing and will be permanently deleted. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "video_id": "video_123",
  "prompt": "Change the cat's fur color to purple."
}
```

**Full Example**:

```json
{
  "video_id": "video_123",
  "prompt": "Change the cat's fur color to purple.",
  "delete_video": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`VideoFile`, _required_):
  The generated video
  - Examples: {"content_type":"video/mp4","url":"https://v3b.fal.media/files/b/rabbit/nk1MK6LY90QqScvI4_Yn8.mp4"}

- **`video_id`** (`string`, _required_):
  The ID of the generated video
  - Examples: "video_123"

- **`thumbnail`** (`ImageFile`, _optional_):
  Thumbnail image for the video

- **`spritesheet`** (`ImageFile`, _optional_):
  Spritesheet image for the video



**Example Response**:

```json
{
  "video": {
    "content_type": "video/mp4",
    "url": "https://v3b.fal.media/files/b/rabbit/nk1MK6LY90QqScvI4_Yn8.mp4"
  },
  "video_id": "video_123"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/sora-2/video-to-video/remix \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "video_id": "video_123",
     "prompt": "Change the cat's fur color to purple."
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/sora-2/video-to-video/remix",
    arguments={
        "video_id": "video_123",
        "prompt": "Change the cat's fur color to purple."
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/sora-2/video-to-video/remix", {
  input: {
    video_id: "video_123",
    prompt: "Change the cat's fur color to purple."
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/sora-2/video-to-video/remix)
- [API Documentation](https://fal.ai/models/fal-ai/sora-2/video-to-video/remix/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/sora-2/video-to-video/remix)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
