> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joytokens.ai/llms.txt.

# Video Editing

POST https://api.joytokens.ai/openai/v1/videos/edits
Content-Type: application/json

Creates an asynchronous video editing task (multi-video stitching) using an OpenAI-compatible request. The editing endpoint is routed to the video editing model pool (models that support both video generation and video editing); Doubao-Seedance-2.5 is in that pool.

Unlike the generation endpoint, at least one media input is required: input_reference / first_frame / last_frame / input_video. `input_video` is only available on this endpoint and references public video URLs for stitching, as a single string or an array; it can be freely combined with prompt and image inputs. All other fields (model / prompt / size / duration / parameters) are identical to the generation endpoint.

The response and the polling / download endpoints are shared with generation tasks.


Reference: https://docs.joytokens.ai/open-api/api-reference/compatible-model-ap-is/videos/create-video-edit

## Authentication

- `Authorization` header (bearer token, required) — Use `Authorization: Bearer $JOY_TOKEN_API_KEY`.

## Request

### Body (application/json)

This endpoint expects a VideoEditRequest.

- `model` (string, optional) — Model name, e.g. `Doubao-Seedance-2.5`. Omit to use `auto` and let the gateway route within the video generation model pool.
- `prompt` (string, optional) — Text description. Required for text-to-video; may be omitted when any image input (input_reference / first_frame / last_frame) is present.
- `size` (string, optional) — Resolution/aspect. Accepts `480p` / `720p` / `1080p` or `WIDTHxHEIGHT` (e.g. `1280x720`, converted to the aspect ratio and resolution). Aspect ratios support 16:9 and 9:16; use parameters.aspect_ratio for other ratios.
- `duration` (integer, optional) — Video length in seconds. Continuous 2\~30 range (Seedance 2.5), default 8. Out-of-range values are clamped (\<2 becomes 2, >30 becomes 30). Stitch longer videos through POST /openai/v1/videos/edits.
- `input_reference` (VideoEditRequestInputReference, optional) — Reference image URL(s). A single string is one image; an array is multiple images for multi-subject reference (each sent with the reference_image role). Up to 30 images per request (input_reference + first_frame + last_frame combined), otherwise 400.
- `first_frame` (string, optional) — First-frame image URL (first_frame role).
- `last_frame` (string, optional) — Last-frame image URL (last_frame role).
- `user` (string, optional) — Optional end-user identifier for abuse tracking.
- `parameters` (VideoEditRequestParameters, optional) — Native upstream parameter passthrough; snake_case field names are preferred (camelCase accepted). Supports aspect_ratio, resolution, duration_seconds, generate_audio, seed, negative_prompt, compression_quality, and person_generation. `fps`, `sample_count`, and 4K resolutions are not supported (rejected or ignored). Top-level duration / size explicitly provided take precedence.
- `input_video` (VideoEditRequestInputVideo, optional) — Public URL(s) of the video(s) to stitch, only available on the editing endpoint. A single string is one video; an array is multiple videos. Freely combinable with prompt and image inputs. Must be a directly accessible public URL.

## Response

### 202

Task accepted. Fees are settled on task completion based on actual usage.

- `task_id` (string, required) — Task id used for polling and download.
- `status` (enum, required) — Always processing on creation.
  - Allowed values: `processing`
- `progress` (integer, required) — Progress percentage, always 0 on creation.
- `model` (string, required) — The actually selected model name (the real model after auto routing).
- `created` (long, required) — Unix timestamp (seconds) of task creation.

## Errors

### 400 Bad Request Error

No media input provided, or invalid request parameters.

- `error` (ErrorResponseError, required)

### 401 Unauthorized Error

Missing Authorization header.

- `error` (ErrorResponseError, required)

### 403 Forbidden Error

API key invalid or not ACTIVE.

- `error` (ErrorResponseError, required)

### 502 Bad Gateway Error

Upstream did not return a task id; fees are automatically refunded.

- `error` (ErrorResponseError, required)

### 503 Service Unavailable Error

API key validation service or task store temporarily unavailable.

- `error` (ErrorResponseError, required)

## Types

### VideoEditRequestInputReference

Reference image URL(s). A single string is one image; an array is multiple images for multi-subject reference (each sent with the reference_image role). Up to 30 images per request (input_reference + first_frame + last_frame combined), otherwise 400.

- string
- list of string

### VideoEditRequestParameters

Native upstream parameter passthrough; snake_case field names are preferred (camelCase accepted). Supports aspect_ratio, resolution, duration_seconds, generate_audio, seed, negative_prompt, compression_quality, and person_generation. `fps`, `sample_count`, and 4K resolutions are not supported (rejected or ignored). Top-level duration / size explicitly provided take precedence.

### VideoEditRequestInputVideo

Public URL(s) of the video(s) to stitch, only available on the editing endpoint. A single string is one video; an array is multiple videos. Freely combinable with prompt and image inputs. Must be a directly accessible public URL.

- string
- list of string

### ErrorResponseError

- `message` (string, required)
- `type` (string, optional)
- `code` (ErrorResponseErrorCode, optional, nullable)

### ErrorResponseErrorCode

- string
- integer

## Examples

### Videos_createVideoEdit_example

**Response**

```json
{
  "task_id": "vtask-8f3a1c2d9e4b5f6a",
  "status": "processing",
  "progress": 0,
  "model": "Doubao-Seedance-2.5",
  "created": 1760000000
}
```

**SDK Code**

```python Videos_createVideoEdit_example
import requests

url = "https://api.joytokens.ai/openai/v1/videos/edits"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Videos_createVideoEdit_example
const url = 'https://api.joytokens.ai/openai/v1/videos/edits';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Videos_createVideoEdit_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.joytokens.ai/openai/v1/videos/edits"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Videos_createVideoEdit_example
require 'uri'
require 'net/http'

url = URI("https://api.joytokens.ai/openai/v1/videos/edits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Videos_createVideoEdit_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.joytokens.ai/openai/v1/videos/edits")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Videos_createVideoEdit_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.joytokens.ai/openai/v1/videos/edits', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Videos_createVideoEdit_example
using RestSharp;

var client = new RestClient("https://api.joytokens.ai/openai/v1/videos/edits");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Videos_createVideoEdit_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joytokens.ai/openai/v1/videos/edits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Pure multi-video stitching without prompt

**Request**

```json
{
  "model": "auto",
  "input_video": [
    "https://example.com/clip-1.mp4",
    "https://example.com/clip-2.mp4",
    "https://example.com/clip-3.mp4"
  ]
}
```

**Response**

```json
{
  "task_id": "vtask-8f3a1c2d9e4b5f6a",
  "status": "processing",
  "progress": 0,
  "model": "Doubao-Seedance-2.5",
  "created": 1760000000
}
```

**SDK Code**

```python Pure multi-video stitching without prompt
import requests

url = "https://api.joytokens.ai/openai/v1/videos/edits"

payload = {
    "model": "auto",
    "input_video": ["https://example.com/clip-1.mp4", "https://example.com/clip-2.mp4", "https://example.com/clip-3.mp4"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Pure multi-video stitching without prompt
const url = 'https://api.joytokens.ai/openai/v1/videos/edits';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"auto","input_video":["https://example.com/clip-1.mp4","https://example.com/clip-2.mp4","https://example.com/clip-3.mp4"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Pure multi-video stitching without prompt
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.joytokens.ai/openai/v1/videos/edits"

	payload := strings.NewReader("{\n  \"model\": \"auto\",\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\",\n    \"https://example.com/clip-3.mp4\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Pure multi-video stitching without prompt
require 'uri'
require 'net/http'

url = URI("https://api.joytokens.ai/openai/v1/videos/edits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"auto\",\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\",\n    \"https://example.com/clip-3.mp4\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Pure multi-video stitching without prompt
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.joytokens.ai/openai/v1/videos/edits")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"auto\",\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\",\n    \"https://example.com/clip-3.mp4\"\n  ]\n}")
  .asString();
```

```php Pure multi-video stitching without prompt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.joytokens.ai/openai/v1/videos/edits', [
  'body' => '{
  "model": "auto",
  "input_video": [
    "https://example.com/clip-1.mp4",
    "https://example.com/clip-2.mp4",
    "https://example.com/clip-3.mp4"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Pure multi-video stitching without prompt
using RestSharp;

var client = new RestClient("https://api.joytokens.ai/openai/v1/videos/edits");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"auto\",\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\",\n    \"https://example.com/clip-3.mp4\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Pure multi-video stitching without prompt
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "auto",
  "input_video": ["https://example.com/clip-1.mp4", "https://example.com/clip-2.mp4", "https://example.com/clip-3.mp4"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joytokens.ai/openai/v1/videos/edits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Video stitching with an editing instruction

**Request**

```json
{
  "model": "auto",
  "prompt": "Stitch these three clips in chronological order and keep a consistent visual style",
  "duration": 12,
  "input_video": [
    "https://example.com/clip-1.mp4",
    "https://example.com/clip-2.mp4"
  ]
}
```

**Response**

```json
{
  "task_id": "vtask-8f3a1c2d9e4b5f6a",
  "status": "processing",
  "progress": 0,
  "model": "Doubao-Seedance-2.5",
  "created": 1760000000
}
```

**SDK Code**

```python Video stitching with an editing instruction
import requests

url = "https://api.joytokens.ai/openai/v1/videos/edits"

payload = {
    "model": "auto",
    "prompt": "Stitch these three clips in chronological order and keep a consistent visual style",
    "duration": 12,
    "input_video": ["https://example.com/clip-1.mp4", "https://example.com/clip-2.mp4"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Video stitching with an editing instruction
const url = 'https://api.joytokens.ai/openai/v1/videos/edits';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"auto","prompt":"Stitch these three clips in chronological order and keep a consistent visual style","duration":12,"input_video":["https://example.com/clip-1.mp4","https://example.com/clip-2.mp4"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Video stitching with an editing instruction
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.joytokens.ai/openai/v1/videos/edits"

	payload := strings.NewReader("{\n  \"model\": \"auto\",\n  \"prompt\": \"Stitch these three clips in chronological order and keep a consistent visual style\",\n  \"duration\": 12,\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Video stitching with an editing instruction
require 'uri'
require 'net/http'

url = URI("https://api.joytokens.ai/openai/v1/videos/edits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"auto\",\n  \"prompt\": \"Stitch these three clips in chronological order and keep a consistent visual style\",\n  \"duration\": 12,\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Video stitching with an editing instruction
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.joytokens.ai/openai/v1/videos/edits")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"auto\",\n  \"prompt\": \"Stitch these three clips in chronological order and keep a consistent visual style\",\n  \"duration\": 12,\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\"\n  ]\n}")
  .asString();
```

```php Video stitching with an editing instruction
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.joytokens.ai/openai/v1/videos/edits', [
  'body' => '{
  "model": "auto",
  "prompt": "Stitch these three clips in chronological order and keep a consistent visual style",
  "duration": 12,
  "input_video": [
    "https://example.com/clip-1.mp4",
    "https://example.com/clip-2.mp4"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Video stitching with an editing instruction
using RestSharp;

var client = new RestClient("https://api.joytokens.ai/openai/v1/videos/edits");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"auto\",\n  \"prompt\": \"Stitch these three clips in chronological order and keep a consistent visual style\",\n  \"duration\": 12,\n  \"input_video\": [\n    \"https://example.com/clip-1.mp4\",\n    \"https://example.com/clip-2.mp4\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Video stitching with an editing instruction
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "auto",
  "prompt": "Stitch these three clips in chronological order and keep a consistent visual style",
  "duration": 12,
  "input_video": ["https://example.com/clip-1.mp4", "https://example.com/clip-2.mp4"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joytokens.ai/openai/v1/videos/edits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Single video edit with a reference image

**Request**

```json
{
  "model": "auto",
  "prompt": "Re-render the video in the night-scene style of the reference image",
  "input_reference": "https://example.com/night-style.png",
  "input_video": "https://example.com/clip-1.mp4"
}
```

**Response**

```json
{
  "task_id": "vtask-8f3a1c2d9e4b5f6a",
  "status": "processing",
  "progress": 0,
  "model": "Doubao-Seedance-2.5",
  "created": 1760000000
}
```

**SDK Code**

```python Single video edit with a reference image
import requests

url = "https://api.joytokens.ai/openai/v1/videos/edits"

payload = {
    "model": "auto",
    "prompt": "Re-render the video in the night-scene style of the reference image",
    "input_reference": "https://example.com/night-style.png",
    "input_video": "https://example.com/clip-1.mp4"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Single video edit with a reference image
const url = 'https://api.joytokens.ai/openai/v1/videos/edits';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"auto","prompt":"Re-render the video in the night-scene style of the reference image","input_reference":"https://example.com/night-style.png","input_video":"https://example.com/clip-1.mp4"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Single video edit with a reference image
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.joytokens.ai/openai/v1/videos/edits"

	payload := strings.NewReader("{\n  \"model\": \"auto\",\n  \"prompt\": \"Re-render the video in the night-scene style of the reference image\",\n  \"input_reference\": \"https://example.com/night-style.png\",\n  \"input_video\": \"https://example.com/clip-1.mp4\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Single video edit with a reference image
require 'uri'
require 'net/http'

url = URI("https://api.joytokens.ai/openai/v1/videos/edits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"auto\",\n  \"prompt\": \"Re-render the video in the night-scene style of the reference image\",\n  \"input_reference\": \"https://example.com/night-style.png\",\n  \"input_video\": \"https://example.com/clip-1.mp4\"\n}"

response = http.request(request)
puts response.read_body
```

```java Single video edit with a reference image
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.joytokens.ai/openai/v1/videos/edits")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"auto\",\n  \"prompt\": \"Re-render the video in the night-scene style of the reference image\",\n  \"input_reference\": \"https://example.com/night-style.png\",\n  \"input_video\": \"https://example.com/clip-1.mp4\"\n}")
  .asString();
```

```php Single video edit with a reference image
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.joytokens.ai/openai/v1/videos/edits', [
  'body' => '{
  "model": "auto",
  "prompt": "Re-render the video in the night-scene style of the reference image",
  "input_reference": "https://example.com/night-style.png",
  "input_video": "https://example.com/clip-1.mp4"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Single video edit with a reference image
using RestSharp;

var client = new RestClient("https://api.joytokens.ai/openai/v1/videos/edits");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"auto\",\n  \"prompt\": \"Re-render the video in the night-scene style of the reference image\",\n  \"input_reference\": \"https://example.com/night-style.png\",\n  \"input_video\": \"https://example.com/clip-1.mp4\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Single video edit with a reference image
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "auto",
  "prompt": "Re-render the video in the night-scene style of the reference image",
  "input_reference": "https://example.com/night-style.png",
  "input_video": "https://example.com/clip-1.mp4"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joytokens.ai/openai/v1/videos/edits")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```