Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Create voice consent

client.Audio.VoiceConsents.New(ctx, body) (*VoiceConsent, error)
POST
/audio/voice_consents

Upload a voice consent recording.

Parameters
body AudioVoiceConsentNewParams
Language param.Field[string]

The BCP 47 language tag for the consent phrase (for example, en-US).

Name param.Field[string]

The label to use for this consent recording.

Recording param.Field[Reader]

The consent audio recording file. Maximum size is 10 MiB.

Supported MIME types: audio/mpeg, audio/wav, audio/x-wav, audio/ogg, audio/aac, audio/flac, audio/webm, audio/mp4.

Returns

Create voice consent

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"),
  )
  voiceConsent, err := client.Audio.VoiceConsents.New(context.TODO(), openai.AudioVoiceConsentNewParams{
    Language: "language",
    Name: "name",
    Recording: io.Reader(bytes.NewBuffer([]byte("Example data"))),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", voiceConsent.ID)
}
200 example
{
  "id": "cons_1234",
  "created_at": 0,
  "language": "language",
  "name": "name",
  "object": "audio.voice_consent"
}
Returns Examples
200 example
{
  "id": "cons_1234",
  "created_at": 0,
  "language": "language",
  "name": "name",
  "object": "audio.voice_consent"
}