openapi: 3.0.0 info: title: OpenAI Assistants Videos API description: The Assistants API allows you to build AI assistants within your own applications. An Assistant has instructions and can leverage models, tools, and knowledge to respond to user queries. The Assistants API currently supports three types of tools - Code Interpreter, Retrieval, and Function calling. In the future, we plan to release more OpenAI-built tools, and allow you to provide your own tools on our platform. version: 2.0.0 termsOfService: https://openai.com/policies/terms-of-use contact: name: OpenAI Support url: https://help.openai.com/ license: name: MIT url: https://github.com/openai/openai-openapi/blob/master/LICENSE servers: - url: https://api.openai.com/v1 security: - ApiKeyAuth: [] tags: - name: Videos paths: /videos: post: tags: - Videos summary: Create a new video generation job from a prompt and optional reference assets. operationId: createVideo parameters: [] requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/CreateVideoMultipartBody' application/json: schema: $ref: '#/components/schemas/CreateVideoJsonBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoResource' x-oaiMeta: name: Create video group: videos path: create examples: request: curl: "curl https://api.openai.com/v1/videos \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -F \"model=sora-2\" \\\n -F \"prompt=A calico cat playing a piano on stage\"\n" javascript: 'import OpenAI from ''openai''; const openai = new OpenAI(); const video = await openai.videos.create({ prompt: ''A calico cat playing a piano on stage'' }); console.log(video.id); ' python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.create(\n prompt=\"x\",\n)\nprint(video.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.New(context.TODO(), openai.VideoNewParams{\n\t\tPrompt: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", video.ID)\n}\n" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") video = openai.videos.create(prompt: "x") puts(video)' java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoCreateParams params = VideoCreateParams.builder()\n .prompt(\"x\")\n .build();\n Video video = client.videos().create(params);\n }\n}" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.create({ prompt: 'x' });\n\nconsole.log(video.id);" response: "{\n \"id\": \"video_123\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"queued\",\n \"progress\": 0,\n \"created_at\": 1712697600,\n \"size\": \"1024x1792\",\n \"seconds\": \"8\",\n \"quality\": \"standard\"\n}\n" get: tags: - Videos summary: List recently generated videos for the current project. operationId: ListVideos parameters: - name: limit in: query description: Number of items to retrieve required: false schema: type: integer minimum: 0 maximum: 100 - name: order in: query description: Sort order of results by timestamp. Use `asc` for ascending order or `desc` for descending order. required: false schema: $ref: '#/components/schemas/OrderEnum' - name: after in: query description: Identifier for the last item from the previous pagination request required: false schema: description: Identifier for the last item from the previous pagination request type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoListResource' x-oaiMeta: name: List videos group: videos path: list for the organization. examples: request: curl: "curl https://api.openai.com/v1/videos \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" javascript: "import OpenAI from 'openai';\n\nconst openai = new OpenAI();\n\n// Automatically fetches more pages as needed.\nfor await (const video of openai.videos.list()) {\n console.log(video.id);\n}\n" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.videos.list()\npage = page.data[0]\nprint(page.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Videos.List(context.TODO(), openai.VideoListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") page = openai.videos.list puts(page)' java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoListPage;\nimport com.openai.models.videos.VideoListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoListPage page = client.videos().list();\n }\n}" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const video of client.videos.list()) {\n console.log(video.id);\n}" response: "{\n \"data\": [\n {\n \"id\": \"video_123\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"completed\"\n }\n ],\n \"object\": \"list\"\n}\n" /videos/characters: post: tags: - Videos summary: Create a character from an uploaded video. operationId: CreateVideoCharacter parameters: [] requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/CreateVideoCharacterBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoCharacterResource' x-oaiMeta: examples: response: '' request: node.js: "import fs from 'fs';\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.createCharacter({\n name: 'x',\n video: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(response.id);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.create_character(\n name=\"x\",\n video=b\"Example data\",\n)\nprint(response.id)" go: "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{\n\t\tName: \"x\",\n\t\tVideo: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoCreateCharacterParams;\nimport com.openai.models.videos.VideoCreateCharacterResponse;\nimport java.io.ByteArrayInputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoCreateCharacterParams params = VideoCreateCharacterParams.builder()\n .name(\"x\")\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n VideoCreateCharacterResponse response = client.videos().createCharacter(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") response = openai.videos.create_character(name: "x", video: StringIO.new("Example data")) puts(response)' /videos/characters/{character_id}: get: tags: - Videos summary: Fetch a character. operationId: GetVideoCharacter parameters: - name: character_id in: path description: The identifier of the character to retrieve. required: true schema: example: char_123 type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoCharacterResource' x-oaiMeta: examples: response: '' request: node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.getCharacter('char_123');\n\nconsole.log(response.id);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.get_character(\n \"char_123\",\n)\nprint(response.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.GetCharacter(context.TODO(), \"char_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoGetCharacterParams;\nimport com.openai.models.videos.VideoGetCharacterResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoGetCharacterResponse response = client.videos().getCharacter(\"char_123\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") response = openai.videos.get_character("char_123") puts(response)' /videos/edits: post: tags: - Videos summary: Create a new video generation job by editing a source video or existing generated video. operationId: CreateVideoEdit parameters: [] requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/CreateVideoEditMultipartBody' application/json: schema: $ref: '#/components/schemas/CreateVideoEditJsonBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoResource' x-oaiMeta: examples: response: '' request: node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.edit({ prompt: 'x', video: fs.createReadStream('path/to/file') });\n\nconsole.log(video.id);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.edit(\n prompt=\"x\",\n video=b\"Example data\",\n)\nprint(video.id)" go: "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Edit(context.TODO(), openai.VideoEditParams{\n\t\tPrompt: \"x\",\n\t\tVideo: openai.VideoEditParamsVideoUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", video.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoEditParams;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoEditParams params = VideoEditParams.builder()\n .prompt(\"x\")\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n Video video = client.videos().edit(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") video = openai.videos.edit(prompt: "x", video: StringIO.new("Example data")) puts(video)' /videos/extensions: post: tags: - Videos summary: Create an extension of a completed video. operationId: CreateVideoExtend parameters: [] requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/CreateVideoExtendMultipartBody' application/json: schema: $ref: '#/components/schemas/CreateVideoExtendJsonBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoResource' x-oaiMeta: examples: response: '' request: node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.extend({\n prompt: 'x',\n seconds: '4',\n video: fs.createReadStream('path/to/file'),\n});\n\nconsole.log(video.id);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.extend(\n prompt=\"x\",\n seconds=\"4\",\n video=b\"Example data\",\n)\nprint(video.id)" go: "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Extend(context.TODO(), openai.VideoExtendParams{\n\t\tPrompt: \"x\",\n\t\tSeconds: openai.VideoSeconds4,\n\t\tVideo: openai.VideoExtendParamsVideoUnion{\n\t\t\tOfFile: io.Reader(bytes.NewBuffer([]byte(\"Example data\"))),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", video.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoExtendParams;\nimport com.openai.models.videos.VideoSeconds;\nimport java.io.ByteArrayInputStream;\nimport java.io.InputStream;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoExtendParams params = VideoExtendParams.builder()\n .prompt(\"x\")\n .seconds(VideoSeconds._4)\n .video(new ByteArrayInputStream(\"Example data\".getBytes()))\n .build();\n Video video = client.videos().extend(params);\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") video = openai.videos.extend_(prompt: "x", seconds: :"4", video: StringIO.new("Example data")) puts(video)' /videos/{video_id}: get: tags: - Videos summary: Fetch the latest metadata for a generated video. operationId: GetVideo parameters: - name: video_id in: path description: The identifier of the video to retrieve. required: true schema: example: video_123 type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoResource' x-oaiMeta: name: Retrieve video group: videos path: retrieve matching the provided identifier. examples: response: '' request: javascript: 'import OpenAI from ''openai''; const client = new OpenAI(); const video = await client.videos.retrieve(''video_123''); console.log(video.id); ' python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.retrieve(\n \"video_123\",\n)\nprint(video.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Get(context.TODO(), \"video_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", video.ID)\n}\n" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") video = openai.videos.retrieve("video_123") puts(video)' java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n Video video = client.videos().retrieve(\"video_123\");\n }\n}" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.retrieve('video_123');\n\nconsole.log(video.id);" delete: tags: - Videos summary: Permanently delete a completed or failed video and its stored assets. operationId: DeleteVideo parameters: - name: video_id in: path description: The identifier of the video to delete. required: true schema: example: video_123 type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DeletedVideoResource' x-oaiMeta: name: Delete video group: videos path: delete examples: response: '' request: javascript: 'import OpenAI from ''openai''; const client = new OpenAI(); const video = await client.videos.delete(''video_123''); console.log(video.id); ' python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.delete(\n \"video_123\",\n)\nprint(video.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Delete(context.TODO(), \"video_123\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", video.ID)\n}\n" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") video = openai.videos.delete("video_123") puts(video)' java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.VideoDeleteParams;\nimport com.openai.models.videos.VideoDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoDeleteResponse video = client.videos().delete(\"video_123\");\n }\n}" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.delete('video_123');\n\nconsole.log(video.id);" /videos/{video_id}/content: get: tags: - Videos summary: 'Download the generated video bytes or a derived preview asset. Streams the rendered video content for the specified video job.' operationId: RetrieveVideoContent parameters: - name: video_id in: path description: The identifier of the video whose media to download. required: true schema: example: video_123 type: string - name: variant in: query description: Which downloadable asset to return. Defaults to the MP4 video. required: false schema: $ref: '#/components/schemas/VideoContentVariant' responses: '200': description: The video bytes or preview asset that matches the requested variant. content: video/mp4: schema: type: string format: binary image/webp: schema: type: string format: binary application/json: schema: type: string x-oaiMeta: name: Retrieve video content group: videos path: content examples: response: '' request: javascript: 'import OpenAI from ''openai''; const client = new OpenAI(); const response = await client.videos.downloadContent(''video_123''); console.log(response); const content = await response.blob(); console.log(content); ' python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.videos.download_content(\n video_id=\"video_123\",\n)\nprint(response)\ncontent = response.read()\nprint(content)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Videos.DownloadContent(\n\t\tcontext.TODO(),\n\t\t\"video_123\",\n\t\topenai.VideoDownloadContentParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") response = openai.videos.download_content("video_123") puts(response)' java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.core.http.HttpResponse;\nimport com.openai.models.videos.VideoDownloadContentParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n HttpResponse response = client.videos().downloadContent(\"video_123\");\n }\n}" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.videos.downloadContent('video_123');\n\nconsole.log(response);\n\nconst content = await response.blob();\nconsole.log(content);" /videos/{video_id}/remix: post: tags: - Videos summary: Create a remix of a completed video using a refreshed prompt. operationId: CreateVideoRemix parameters: - name: video_id in: path description: The identifier of the completed video to remix. required: true schema: example: video_123 type: string requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/CreateVideoRemixBody' application/json: schema: $ref: '#/components/schemas/CreateVideoRemixBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/VideoResource' x-oaiMeta: name: Remix video group: videos path: remix using the provided prompt. examples: request: curl: "curl -X POST https://api.openai.com/v1/videos/video_123/remix \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"prompt\": \"Extend the scene with the cat taking a bow to the cheering audience\"\n }'\n" javascript: 'import OpenAI from ''openai''; const client = new OpenAI(); const video = await client.videos.remix(''video_123'', { prompt: ''Extend the scene with the cat taking a bow to the cheering audience'' }); console.log(video.id); ' python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nvideo = client.videos.remix(\n video_id=\"video_123\",\n prompt=\"x\",\n)\nprint(video.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tvideo, err := client.Videos.Remix(\n\t\tcontext.TODO(),\n\t\t\"video_123\",\n\t\topenai.VideoRemixParams{\n\t\t\tPrompt: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", video.ID)\n}\n" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") video = openai.videos.remix("video_123", prompt: "x") puts(video)' java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.videos.Video;\nimport com.openai.models.videos.VideoRemixParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n VideoRemixParams params = VideoRemixParams.builder()\n .videoId(\"video_123\")\n .prompt(\"x\")\n .build();\n Video video = client.videos().remix(params);\n }\n}" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst video = await client.videos.remix('video_123', { prompt: 'x' });\n\nconsole.log(video.id);" response: "{\n \"id\": \"video_456\",\n \"object\": \"video\",\n \"model\": \"sora-2\",\n \"status\": \"queued\",\n \"progress\": 0,\n \"created_at\": 1712698600,\n \"size\": \"720x1280\",\n \"seconds\": \"8\",\n \"remixed_from_video_id\": \"video_123\"\n}\n" components: schemas: CreateVideoMultipartBody: properties: model: $ref: '#/components/schemas/VideoModel' description: 'The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`.' prompt: type: string maxLength: 32000 minLength: 1 description: Text prompt that describes the video to generate. input_reference: oneOf: - type: string format: binary description: Optional reference asset upload or reference object that guides generation. - $ref: '#/components/schemas/ImageRefParam-2' seconds: $ref: '#/components/schemas/VideoSeconds' description: 'Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.' size: $ref: '#/components/schemas/VideoSize' description: 'Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.' type: object required: - prompt title: Create video multipart request description: Multipart parameters for creating a new video generation job. CreateVideoRemixBody: properties: prompt: type: string maxLength: 32000 minLength: 1 description: Updated text prompt that directs the remix generation. type: object required: - prompt title: Create video remix request description: Parameters for remixing an existing generated video. Error-2: properties: code: type: string description: A machine-readable error code that was returned. message: type: string description: A human-readable description of the error that was returned. type: object required: - code - message title: Error description: An error that occurred while generating the response. ImageRefParam-2: properties: image_url: type: string maxLength: 20971520 format: uri description: A fully qualified URL or base64-encoded data URL. file_id: type: string example: file-123 type: object required: [] CreateVideoJsonBody: properties: model: $ref: '#/components/schemas/VideoModel' description: 'The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults to `sora-2`.' prompt: type: string maxLength: 32000 minLength: 1 description: Text prompt that describes the video to generate. input_reference: $ref: '#/components/schemas/ImageRefParam-2' description: Optional reference object that guides generation. Provide exactly one of `image_url` or `file_id`. seconds: $ref: '#/components/schemas/VideoSeconds' description: 'Clip duration in seconds (allowed values: 4, 8, 12). Defaults to 4 seconds.' size: $ref: '#/components/schemas/VideoSize' description: 'Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280.' type: object required: - prompt title: Create video JSON request description: JSON parameters for creating a new video generation job. CreateVideoEditJsonBody: properties: video: $ref: '#/components/schemas/VideoReferenceInputParam' description: Reference to the completed video to edit. prompt: type: string maxLength: 32000 minLength: 1 description: Text prompt that describes how to edit the source video. type: object required: - video - prompt title: Create video edit JSON request description: JSON parameters for editing an existing generated video. VideoStatus: type: string enum: - queued - in_progress - completed - failed CreateVideoCharacterBody: properties: video: type: string format: binary description: Video file used to create a character. name: type: string maxLength: 80 minLength: 1 description: Display name for this API character. type: object required: - video - name title: Create character request description: Parameters for creating a character from an uploaded video. VideoSeconds: type: string enum: - '4' - '8' - '12' VideoContentVariant: type: string enum: - video - thumbnail - spritesheet VideoCharacterResource: properties: id: anyOf: - type: string description: Identifier for the character creation cameo. - type: 'null' name: anyOf: - type: string description: Display name for the character. - type: 'null' created_at: type: integer format: unixtime description: Unix timestamp (in seconds) when the character was created. type: object required: - id - name - created_at CreateVideoExtendJsonBody: properties: video: $ref: '#/components/schemas/VideoReferenceInputParam' description: Reference to the completed video to extend. prompt: type: string maxLength: 32000 minLength: 1 description: Updated text prompt that directs the extension generation. seconds: $ref: '#/components/schemas/VideoSeconds' description: 'Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).' type: object required: - video - prompt - seconds title: Create video extension JSON request description: JSON parameters for extending an existing generated video. VideoListResource: properties: object: type: string enum: - list description: The type of object returned, must be `list`. default: list x-stainless-const: true data: items: $ref: '#/components/schemas/VideoResource' type: array description: A list of items first_id: anyOf: - type: string description: The ID of the first item in the list. - type: 'null' last_id: anyOf: - type: string description: The ID of the last item in the list. - type: 'null' has_more: type: boolean description: Whether there are more items available. type: object required: - object - data - first_id - last_id - has_more DeletedVideoResource: properties: object: type: string enum: - video.deleted description: The object type that signals the deletion response. default: video.deleted x-stainless-const: true deleted: type: boolean description: Indicates that the video resource was deleted. id: type: string description: Identifier of the deleted video. type: object required: - object - deleted - id title: Deleted video response description: Confirmation payload returned after deleting a video. VideoSize: type: string enum: - 720x1280 - 1280x720 - 1024x1792 - 1792x1024 CreateVideoEditMultipartBody: properties: video: oneOf: - type: string format: binary description: Reference to the completed video to edit. - $ref: '#/components/schemas/VideoReferenceInputParam' prompt: type: string maxLength: 32000 minLength: 1 description: Text prompt that describes how to edit the source video. type: object required: - video - prompt title: Create video edit multipart request description: Parameters for editing an existing generated video. OrderEnum: type: string enum: - asc - desc CreateVideoExtendMultipartBody: properties: video: oneOf: - $ref: '#/components/schemas/VideoReferenceInputParam' - type: string format: binary description: Reference to the completed video to extend. prompt: type: string maxLength: 32000 minLength: 1 description: Updated text prompt that directs the extension generation. seconds: $ref: '#/components/schemas/VideoSeconds' description: 'Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20).' type: object required: - video - prompt - seconds title: Create video extension multipart request description: Multipart parameters for extending an existing generated video. VideoModel: anyOf: - type: string - type: string enum: - sora-2 - sora-2-pro - sora-2-2025-10-06 - sora-2-pro-2025-10-06 - sora-2-2025-12-08 VideoResource: properties: id: type: string description: Unique identifier for the video job. object: type: string enum: - video description: The object type, which is always `video`. default: video x-stainless-const: true model: $ref: '#/components/schemas/VideoModel' description: The video generation model that produced the job. status: $ref: '#/components/schemas/VideoStatus' description: Current lifecycle status of the video job. progress: type: integer description: Approximate completion percentage for the generation task. created_at: type: integer format: unixtime description: Unix timestamp (seconds) for when the job was created. completed_at: anyOf: - type: integer format: unixtime description: Unix timestamp (seconds) for when the job completed, if finished. - type: 'null' expires_at: anyOf: - type: integer format: unixtime description: Unix timestamp (seconds) for when the downloadable assets expire, if set. - type: 'null' prompt: anyOf: - type: string description: The prompt that was used to generate the video. - type: 'null' size: $ref: '#/components/schemas/VideoSize' description: The resolution of the generated video. seconds: type: string description: Duration of the generated clip in seconds. For extensions, this is the stitched total duration. remixed_from_video_id: anyOf: - type: string description: Identifier of the source video if this video is a remix. - type: 'null' error: anyOf: - $ref: '#/components/schemas/Error-2' description: Error payload that explains why generation failed, if applicable. - type: 'null' type: object required: - id - object - model - status - progress - created_at - completed_at - expires_at - prompt - size - seconds - remixed_from_video_id - error title: Video job description: Structured information describing a generated video job. VideoReferenceInputParam: properties: id: type: string description: The identifier of the completed video. example: video_123 type: object required: - id description: Reference to the completed video. securitySchemes: ApiKeyAuth: type: http scheme: bearer x-oaiMeta: groups: - id: audio title: Audio description: 'Learn how to turn audio into text or text into audio. Related guide: [Speech to text](/docs/guides/speech-to-text) ' sections: - type: endpoint key: createSpeech path: createSpeech - type: endpoint key: createTranscription path: createTranscription - type: endpoint key: createTranslation path: createTranslation - id: chat title: Chat description: 'Given a list of messages comprising a conversation, the model will return a response. Related guide: [Chat Completions](/docs/guides/text-generation) ' sections: - type: endpoint key: createChatCompletion path: create - type: object key: CreateChatCompletionResponse path: object - type: object key: CreateChatCompletionStreamResponse path: streaming - id: embeddings title: Embeddings description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. Related guide: [Embeddings](/docs/guides/embeddings) ' sections: - type: endpoint key: createEmbedding path: create - type: object key: Embedding path: object - id: fine-tuning title: Fine-tuning description: 'Manage fine-tuning jobs to tailor a model to your specific training data. Related guide: [Fine-tune models](/docs/guides/fine-tuning) ' sections: - type: endpoint key: createFineTuningJob path: create - type: endpoint key: listPaginatedFineTuningJobs path: list - type: endpoint key: listFineTuningEvents path: list-events - type: endpoint key: retrieveFineTuningJob path: retrieve - type: endpoint key: cancelFineTuningJob path: cancel - type: object key: FineTuningJob path: object - type: object key: FineTuningJobEvent path: event-object - id: files title: Files description: 'Files are used to upload documents that can be used with features like [Assistants](/docs/api-reference/assistants) and [Fine-tuning](/docs/api-reference/fine-tuning). ' sections: - type: endpoint key: createFile path: create - type: endpoint key: listFiles path: list - type: endpoint key: retrieveFile path: retrieve - type: endpoint key: deleteFile path: delete - type: endpoint key: downloadFile path: retrieve-contents - type: object key: OpenAIFile path: object - id: images title: Images description: 'Given a prompt and/or an input image, the model will generate a new image. Related guide: [Image generation](/docs/guides/images) ' sections: - type: endpoint key: createImage path: create - type: endpoint key: createImageEdit path: createEdit - type: endpoint key: createImageVariation path: createVariation - type: object key: Image path: object - id: models title: Models description: 'List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them. ' sections: - type: endpoint key: listModels path: list - type: endpoint key: retrieveModel path: retrieve - type: endpoint key: deleteModel path: delete - type: object key: Model path: object - id: moderations title: Moderations description: 'Given a input text, outputs if the model classifies it as violating OpenAI''s content policy. Related guide: [Moderations](/docs/guides/moderation) ' sections: - type: endpoint key: createModeration path: create - type: object key: CreateModerationResponse path: object - id: assistants title: Assistants beta: true description: 'Build assistants that can call models and use tools to perform tasks. [Get started with the Assistants API](/docs/assistants) ' sections: - type: endpoint key: createAssistant path: createAssistant - type: endpoint key: createAssistantFile path: createAssistantFile - type: endpoint key: listAssistants path: listAssistants - type: endpoint key: listAssistantFiles path: listAssistantFiles - type: endpoint key: getAssistant path: getAssistant - type: endpoint key: getAssistantFile path: getAssistantFile - type: endpoint key: modifyAssistant path: modifyAssistant - type: endpoint key: deleteAssistant path: deleteAssistant - type: endpoint key: deleteAssistantFile path: deleteAssistantFile - type: object key: AssistantObject path: object - type: object key: AssistantFileObject path: file-object - id: threads title: Threads beta: true description: 'Create threads that assistants can interact with. Related guide: [Assistants](/docs/assistants/overview) ' sections: - type: endpoint key: createThread path: createThread - type: endpoint key: getThread path: getThread - type: endpoint key: modifyThread path: modifyThread - type: endpoint key: deleteThread path: deleteThread - type: object key: ThreadObject path: object - id: messages title: Messages beta: true description: 'Create messages within threads Related guide: [Assistants](/docs/assistants/overview) ' sections: - type: endpoint key: createMessage path: createMessage - type: endpoint key: listMessages path: listMessages - type: endpoint key: listMessageFiles path: listMessageFiles - type: endpoint key: getMessage path: getMessage - type: endpoint key: getMessageFile path: getMessageFile - type: endpoint key: modifyMessage path: modifyMessage - type: object key: MessageObject path: object - type: object key: MessageFileObject path: file-object - id: runs title: Runs beta: true description: 'Represents an execution run on a thread. Related guide: [Assistants](/docs/assistants/overview) ' sections: - type: endpoint key: createRun path: createRun - type: endpoint key: createThreadAndRun path: createThreadAndRun - type: endpoint key: listRuns path: listRuns - type: endpoint key: listRunSteps path: listRunSteps - type: endpoint key: getRun path: getRun - type: endpoint key: getRunStep path: getRunStep - type: endpoint key: modifyRun path: modifyRun - type: endpoint key: submitToolOuputsToRun path: submitToolOutputs - type: endpoint key: cancelRun path: cancelRun - type: object key: RunObject path: object - type: object key: RunStepObject path: step-object - id: completions title: Completions legacy: true description: 'Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. Most models that support the legacy Completions endpoint [will be shut off on January 4th, 2024](/docs/deprecations/2023-07-06-gpt-and-embeddings). ' sections: - type: endpoint key: createCompletion path: create - type: object key: CreateCompletionResponse path: object