Create translation
client.Audio.Translations.New(ctx, body) (*Translation, error)
POST/audio/translations
Translates audio into English.
Parameters
Returns
Create translation
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"),
)
translation, err := client.Audio.Translations.New(context.TODO(), openai.AudioTranslationNewParams{
File: io.Reader(bytes.NewBuffer([]byte("some file contents"))),
Model: openai.AudioModelWhisper1,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", translation)
}
{
"text": "text"
}Returns Examples
{
"text": "text"
}