DocsAPI reference
Speech
POST /v1/audio/speech — natural text to speech in 10 languages with Qwen3-TTS on your own GPU, in OpenAI's speech format.
HTTP
POST https://osarai.xyz/v1/audio/speechTurns text into spoken audio in OpenAI's speech format. Deploy Qwen3-TTS 1.7B CustomVoice (qwen3-tts-1.7b): natural speech in 10 languages with preset voices.
Request
Terminal
curl "https://osarai.xyz/v1/audio/speech" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-tts-1.7b",
"input": "Welcome to Osarai. This voice runs on a GPU of your own.",
"voice": "Vivian",
"response_format": "wav"
}' --output welcome.wavPython
from openai import OpenAI
import os
client = OpenAI(base_url="https://osarai.xyz/v1", api_key=os.environ["OSARAI_API_KEY"])
with client.audio.speech.with_streaming_response.create(
model="qwen3-tts-1.7b",
input="Welcome to Osarai. This voice runs on a GPU of your own.",
voice="Vivian",
response_format="wav",
) as response:
response.stream_to_file("welcome.wav")TypeScript
import OpenAI from "openai";
import { writeFile } from "node:fs/promises";
const client = new OpenAI({ baseURL: "https://osarai.xyz/v1", apiKey: process.env.OSARAI_API_KEY });
const audio = await client.audio.speech.create({
model: "qwen3-tts-1.7b",
input: "Welcome to Osarai. This voice runs on a GPU of your own.",
voice: "Vivian",
response_format: "wav",
});
await writeFile("welcome.wav", Buffer.from(await audio.arrayBuffer()));| Field | Notes |
|---|---|
model | qwen3-tts-1.7b |
input | The text to speak |
voice | A preset voice (below) |
response_format | wav, mp3, flac, opus, aac or pcm |
The response body is the audio file itself, with a matching Content-Type.
Voices
| Voice | Voice | Voice |
|---|---|---|
Vivian | Serena | Uncle_Fu |
Dylan | Eric | Ryan |
Aiden | Ono_Anna | Sohee |
Every voice speaks every supported language; the language follows the text. Try them in the dashboard's playground before you pick one.