Skip to content
Primary navigation

Create a character from an uploaded video.

client.videos.createCharacter(VideoCreateCharacterParams { name, video } body, RequestOptionsoptions?): VideoCreateCharacterResponse { id, created_at, name }
POST/videos/characters

Create a character from an uploaded video.

ParametersExpand Collapse
body: VideoCreateCharacterParams { name, video }
name: string

Display name for this API character.

maxLength80
minLength1
video: Uploadable

Video file used to create a character.

ReturnsExpand Collapse
VideoCreateCharacterResponse { id, created_at, name }
id: string | null

Identifier for the character creation cameo.

created_at: number

Unix timestamp (in seconds) when the character was created.

name: string | null

Display name for the character.

Create a character from an uploaded video.

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

const response = await client.videos.createCharacter({
  name: 'x',
  video: fs.createReadStream('path/to/file'),
});

console.log(response.id);
{
  "id": "id",
  "created_at": 0,
  "name": "name"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "name": "name"
}