Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.
Example Usage
package mainimport( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/models/operations" "log")func main() { ctx := context.Background() s := openrouter.New( openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) example, fileErr := os.Open("example.file") if fileErr != nil { panic(fileErr) } res, err := s.STT.CreateTranscriptionMultipart(ctx, operations.CreateAudioTranscriptionsMultipartRequest{ File: &operations.CreateAudioTranscriptionsMultipartFile{ FileName: "example.file", Content: example, }, Language: openrouter.Pointer("en"), Model: "openai/whisper-large-v3", }) if err != nil { log.Fatal(err) } if res != nil { // handle response }}