Skip to content
Primary navigation

Create a character from an uploaded video.

client.Videos.NewCharacter(ctx, body) (*VideoNewCharacterResponse, error)
POST/videos/characters

Create a character from an uploaded video.

ParametersExpand Collapse
body VideoNewCharacterParams
Name param.Field[string]

Display name for this API character.

maxLength80
minLength1
Video param.Field[Reader]

Video file used to create a character.

ReturnsExpand Collapse
type VideoNewCharacterResponse struct{…}
ID string

Identifier for the character creation cameo.

CreatedAt int64

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

Name string

Display name for the character.

Create a character from an uploaded video.

package main

import (
  "bytes"
  "context"
  "fmt"
  "io"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Videos.NewCharacter(context.TODO(), openai.VideoNewCharacterParams{
    Name: "x",
    Video: io.Reader(bytes.NewBuffer([]byte("Example data"))),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
{
  "id": "id",
  "created_at": 0,
  "name": "name"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "name": "name"
}