dots.v1.audio.speech.post()

Generated on 27 Oct 2026 from DoTs version v1.21.0

Usage

client.v1.audio.speech.post(body: Create_speech_request, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Speech_response>

Description

Convert text input to speech audio. The response may be raw audio bytes (audio/mpeg, audio/wav, and similar) or a JSON envelope with base64-encoded audio in data[].b64_json.

Parameters

model string required

Example: qwen3-tts-voicedesign

The text-to-speech model to use.

input string required

Example: Hello, world!

The text to convert to speech.

Min length: 1

voice string optional

Example: alloy

The voice to use for synthesis.

responseFormat string optional

Example: mp3

The audio format to return. Supported values include mp3 and wav. The API may return raw audio bytes or a JSON envelope with base64-encoded audio.

instructions string optional

Example: Speak naturally.

Optional style or delivery instructions for the synthesizer.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v1.audio.speech.post({
    model: "qwen3-tts-voicedesign",
    input: "Hello, world!",
    voice: "alloy",
    responseFormat: "mp3",
    instructions: "Speak naturally.",
});

Response Example

Show Response Example
{
  "created": 1710700000,
  "data": [
    {
      "b64_json": "//uQxAAAA..."
    }
  ]
}

More Information

See /v1/audio/speech in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.