---
title: "Create a video"
description: "Starts a video job and returns its `id`. Poll `GET /v1/videos/{id}` until `status` is `completed` or `failed`, then download the video. Follows OpenAI's Videos API; Gemini (Omni), OpenRouter, DeepInfra, MiniMax, Qwen (Wan), Z.ai, Together AI and EmpirioLabs answer it. A job's id starts with its provider's prefix, which routes each follow-up back to the provider that made it. Each provider uses the fields it has a place for and refuses a `size` it cannot make with `400`."
---

<a id="playground-button:docs/apis/gateway/create-video"></a>

**POST** `https://gateway.respan.ai/v1/videos`

Starts a video job and returns its `id`. Poll `GET /v1/videos/{id}` until `status` is `completed` or `failed`, then download the video. Follows OpenAI's Videos API; Gemini (Omni), OpenRouter, DeepInfra, MiniMax, Qwen (Wan), Z.ai, Together AI and EmpirioLabs answer it. A job's id starts with its provider's prefix, which routes each follow-up back to the provider that made it. Each provider uses the fields it has a place for and refuses a `size` it cannot make with `400`.

## Servers

`https://gateway.respan.ai`: Respan gateway

## Authentication

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


## Request body

A request body is required.

### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | Additional properties are allowed |
| `model` | `string` | Required in parent | The video model, such as `gemini/gemini-omni-1.2-flash`. |
| `prompt` | `string` | Required in parent | What to show. |
| `seconds` | `string` | Optional | Length of the video in seconds, as a string such as `"5"`. |
| `size` | `string` | Optional | Frame size, such as `1280x720`. |
| `aspect_ratio` | `string` | Optional | The shape alone, such as `16:9`. |
| `resolution` | `string` | Optional | The provider's named tier, such as `720p`. |
| `generate_audio` | `boolean` | Optional | `true` to make a soundtrack with the video. |
| `negative_prompt` | `string` | Optional | What to leave out. |
| `seed` | `integer` | Optional | A number that makes a draw repeat. |
| `provider` | `object` | Optional | Settings only one provider takes, as `{"options": {"<provider id>": {...}}}`. A call carries the settings of the provider it goes to and ignores the rest. A key the provider does not list, or one that another field already sets, is refused with `400` naming `provider.options.<id>.<key>`. In a form, send it as JSON text.<br />Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "type": "object",
  "required": [
    "model",
    "prompt"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "The video model, such as `gemini/gemini-omni-1.2-flash`."
    },
    "prompt": {
      "type": "string",
      "description": "What to show."
    },
    "seconds": {
      "type": "string",
      "description": "Length of the video in seconds, as a string such as `\"5\"`."
    },
    "size": {
      "type": "string",
      "description": "Frame size, such as `1280x720`."
    },
    "aspect_ratio": {
      "type": "string",
      "description": "The shape alone, such as `16:9`."
    },
    "resolution": {
      "type": "string",
      "description": "The provider's named tier, such as `720p`."
    },
    "generate_audio": {
      "type": "boolean",
      "description": "`true` to make a soundtrack with the video."
    },
    "negative_prompt": {
      "type": "string",
      "description": "What to leave out."
    },
    "seed": {
      "type": "integer",
      "description": "A number that makes a draw repeat."
    },
    "provider": {
      "type": "object",
      "description": "Settings only one provider takes, as `{\"options\": {\"<provider id>\": {...}}}`. A call carries the settings of the provider it goes to and ignores the rest. A key the provider does not list, or one that another field already sets, is refused with `400` naming `provider.options.<id>.<key>`. In a form, send it as JSON text.",
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
```

</details>

##### Gemini Omni


```json
{
  "model": "gemini/gemini-omni-1.2-flash",
  "prompt": "A paper boat drifting down a rainy street"
}
```


##### Qwen (Wan) with provider settings


```json
{
  "model": "wan2.2-t2v-plus",
  "prompt": "A paper boat drifting down a rainy street",
  "provider": {
    "options": {
      "qwen": {
        "prompt_extend": true,
        "watermark": false
      }
    }
  }
}
```


### multipart/form-data


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | - |
| `model` | `string` | Required in parent | - |
| `prompt` | `string` | Required in parent | - |
| `seconds` | `string` | Optional | Length of the video in seconds, as a string such as `"5"`. |
| `size` | `string` | Optional | - |
| `input_reference` | `string` | Optional | An image to start from, as a file.<br />Format: `binary` |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "type": "object",
  "required": [
    "model",
    "prompt"
  ],
  "properties": {
    "model": {
      "type": "string"
    },
    "prompt": {
      "type": "string"
    },
    "seconds": {
      "type": "string",
      "description": "Length of the video in seconds, as a string such as `\"5\"`."
    },
    "size": {
      "type": "string"
    },
    "input_reference": {
      "type": "string",
      "description": "An image to start from, as a file.",
      "format": "binary"
    }
  }
}
```

</details>

## Responses

### 200

The job.

#### Response headers


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| `X-Respan-Log-Id` | `string` | Optional | ID of the Respan request log for this call. |


#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | A video job, as OpenAI's Videos API writes it.<br />Reference: `#/components/schemas/VideoJob`<br />Additional properties are allowed |
| `id` | `string` | Optional | The job's id. It starts with its provider's prefix. |
| `status` | `string` | Optional | Allowed: `"queued"`, `"in_progress"`, `"completed"`, `"failed"` |
| `model` | `string` | Optional | - |
| `seconds` | `string` | Optional | The video's length. A string in OpenAI's API. |
| `size` | `string` | Optional | - |
| `error` | `object` | Optional | Why the job failed.<br />Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/VideoJob"
}
```

</details>

### 400

The request is malformed, or a field is one the provider cannot take. Fields refused before the call say which one.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
```


### 429

A rate limit or usage limit was reached. Retry with exponential backoff.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Additional properties are allowed |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "additionalProperties": true
}
```

</details>

## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Create a video",
  "operationId": "createVideo",
  "tags": [
    "Gateway"
  ],
  "servers": [
    {
      "url": "https://gateway.respan.ai",
      "description": "Respan gateway"
    }
  ],
  "description": "Starts a video job and returns its `id`. Poll `GET /v1/videos/{id}` until `status` is `completed` or `failed`, then download the video. Follows OpenAI's Videos API; Gemini (Omni), OpenRouter, DeepInfra, MiniMax, Qwen (Wan), Z.ai, Together AI and EmpirioLabs answer it. A job's id starts with its provider's prefix, which routes each follow-up back to the provider that made it. Each provider uses the fields it has a place for and refuses a `size` it cannot make with `400`.",
  "security": [
    {
      "RespanApiKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "model",
            "prompt"
          ],
          "properties": {
            "model": {
              "type": "string",
              "description": "The video model, such as `gemini/gemini-omni-1.2-flash`."
            },
            "prompt": {
              "type": "string",
              "description": "What to show."
            },
            "seconds": {
              "type": "string",
              "description": "Length of the video in seconds, as a string such as `\"5\"`."
            },
            "size": {
              "type": "string",
              "description": "Frame size, such as `1280x720`."
            },
            "aspect_ratio": {
              "type": "string",
              "description": "The shape alone, such as `16:9`."
            },
            "resolution": {
              "type": "string",
              "description": "The provider's named tier, such as `720p`."
            },
            "generate_audio": {
              "type": "boolean",
              "description": "`true` to make a soundtrack with the video."
            },
            "negative_prompt": {
              "type": "string",
              "description": "What to leave out."
            },
            "seed": {
              "type": "integer",
              "description": "A number that makes a draw repeat."
            },
            "provider": {
              "type": "object",
              "description": "Settings only one provider takes, as `{\"options\": {\"<provider id>\": {...}}}`. A call carries the settings of the provider it goes to and ignores the rest. A key the provider does not list, or one that another field already sets, is refused with `400` naming `provider.options.<id>.<key>`. In a form, send it as JSON text.",
              "additionalProperties": true
            }
          },
          "additionalProperties": true
        },
        "examples": {
          "gemini": {
            "summary": "Gemini Omni",
            "value": {
              "model": "gemini/gemini-omni-1.2-flash",
              "prompt": "A paper boat drifting down a rainy street"
            }
          },
          "qwen": {
            "summary": "Qwen (Wan) with provider settings",
            "value": {
              "model": "wan2.2-t2v-plus",
              "prompt": "A paper boat drifting down a rainy street",
              "provider": {
                "options": {
                  "qwen": {
                    "prompt_extend": true,
                    "watermark": false
                  }
                }
              }
            }
          }
        }
      },
      "multipart/form-data": {
        "schema": {
          "type": "object",
          "required": [
            "model",
            "prompt"
          ],
          "properties": {
            "model": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            },
            "seconds": {
              "type": "string",
              "description": "Length of the video in seconds, as a string such as `\"5\"`."
            },
            "size": {
              "type": "string"
            },
            "input_reference": {
              "type": "string",
              "description": "An image to start from, as a file.",
              "format": "binary"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The job.",
      "headers": {
        "X-Respan-Log-Id": {
          "description": "ID of the Respan request log for this call.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/VideoJob"
          }
        }
      }
    },
    "400": {
      "description": "The request is malformed, or a field is one the provider cannot take. Fields refused before the call say which one.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "429": {
      "description": "A rate limit or usage limit was reached. Retry with exponential backoff.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "schemas": {
    "VideoJob": {
      "type": "object",
      "description": "A video job, as OpenAI's Videos API writes it.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The job's id. It starts with its provider's prefix."
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "in_progress",
            "completed",
            "failed"
          ]
        },
        "model": {
          "type": "string"
        },
        "seconds": {
          "type": "string",
          "description": "The video's length. A string in OpenAI's API."
        },
        "size": {
          "type": "string"
        },
        "error": {
          "type": "object",
          "description": "Why the job failed.",
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
