Skip to main content
Method: client.AudioApi.AudioSpeechPostAsync()

Example

var client = new Client(apiKey);

var request = new AudioSpeechRequest(
    model: "openai/gpt-4o-mini-tts",
    input: "Hello world",
    voice: "alloy",
    format: AudioSpeechRequest.FormatEnum.Mp3
);

var response = client.AudioApi.AudioSpeechPostAsync(request).Result;

Key parameters

  • model (required): TTS-capable model id.
  • input (required): Text to synthesize.
  • voice: Voice preset (model-dependent, e.g., alloy).
  • format: mp3, wav, flac, etc.
  • speed: Playback speed multiplier (typically 0.25–4).

Returns

Audio binary