Google Gemini 3.1 Flash TTS — Text to audio API
Google, text-to-audio. Credits per character of text (counted as spoken:speech.text): 0.0056.
Endpoint: POST https://queue.auray.run/auray-serverless/google/gemini-3-1-flash-tts
Endpoint ID: auray-serverless/google/gemini-3-1-flash-tts
Usage notes
One of Auray's catalogue models: the same key, the same credits, the same job lifecycle as every other address.
Its request shape is published below. Whether it runs right now is GET /v1/catalogue's word, with no key needed: its addresses say connected for an address that runs, and a submit to any other is refused before anything is charged — described answers 501 model_not_connected, paused 503 model_disabled.
Category text-to-audio · Scope audio:write (or external:write on an older key) · Price Credits per character of text (counted as spoken:speech.text): 0.0056. Each character of speech.text counts the time it takes to say: 1.1672 a letter of the Latin or Cyrillic script, a space or a pause mark; 1.7679 an Arabic or Hebrew letter; 3.4818 a kana; 4.8746 a Hangul syllable, a Greek letter or a letter of any other script; 24.3726 a Han character, seven kana; 16 a letter read by its name (alone, in a word with no vowel, or in a word in capitals of four letters or fewer or that no word could be said as, its plural or possessive s a letter); 20 a digit; 48 a symbol or an emoji; a combining mark none. From 70 to 97490.4 characters a request. Quoted when you submit, at the most the request can cost; the charge settles to what the job cost and never above the quote. The submit's answer carries the quote as credits_quoted, and credits_charged says what has been taken.
speech— Text → Speechdialogue— Dialogue- Prompt: up to 4,000 characters
- Languages: ar-EG, bn-BD, nl-NL, en-IN, en-US, fr-FR, de-DE, hi-IN, id-ID, it-IT, ja-JP, ko-KR, mr-IN, pl-PL, pt-BR, ro-RO, ru-RU, es-ES, ta-IN, te-IN, th-TH, tr-TR, uk-UA, vi-VN, af-ZA, sq-AL, am-ET, ar-001, hy-AM, az-AZ, eu-ES, be-BY, bg-BG, my-MM, ca-ES, ceb-PH, cmn-CN, cmn-tw, hr-HR, cs-CZ, da-DK, en-AU, en-GB, et-EE, fil-PH, fi-FI, fr-CA, gl-ES, ka-GE, el-GR, gu-IN, ht-HT, he-IL, hu-HU, is-IS, jv-JV, kn-IN, kok-IN, lo-LA, la-VA, lv-LV, lt-LT, lb-LU, mk-MK, mai-IN, mg-MG, ms-MY, ml-IN, mn-MN, ne-NP, nb-NO, nn-NO, or-IN, ps-AF, fa-IR, pt-PT, pa-IN, sr-RS, sd-IN, si-LK, sk-SK, sl-SI, es-419, es-MX, sw-KE, sv-SE, ur-PK
- Voices: 30 to choose from
- Sound: makes its own sound
- Priced by:
char_in(the whole rule is under Price)
Find the addresses that do any of these with GET /v1/models?operation=<id>; the openapi.json carries them as data under x-auray-capability.
Quick start
curl -X POST https://queue.auray.run/auray-serverless/google/gemini-3-1-flash-tts \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"speech": {
"text": "a brass orrery on a walnut desk, morning light from a window to the left"
}
}'import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const result = await auray.subscribe("auray-serverless/google/gemini-3-1-flash-tts", {
input: {
"speech": {
"text": "a brass orrery on a walnut desk, morning light from a window to the left"
}
},
onQueueUpdate: (update) => console.log(update.status),
});
console.dir(result, { depth: null });from auray_client import Client
auray = Client() # reads AURAY_API_KEY
result = auray.subscribe(
"auray-serverless/google/gemini-3-1-flash-tts",
input={
"speech": {
"text": "a brass orrery on a walnut desk, morning light from a window to the left"
}
},
on_queue_update=lambda update: print(update["status"]),
)
print(result){
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run_model",
"arguments": {
"address": "auray-serverless/google/gemini-3-1-flash-tts",
"input": {
"speech": {
"text": "a brass orrery on a walnut desk, morning light from a window to the left"
}
}
}
}
}const res = await fetch("https://queue.auray.run/auray-serverless/google/gemini-3-1-flash-tts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"speech": {
"text": "a brass orrery on a walnut desk, morning light from a window to the left"
}
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://queue.auray.run/auray-serverless/google/gemini-3-1-flash-tts",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"speech": {
"text": "a brass orrery on a walnut desk, morning light from a window to the left"
}
},
)
r.raise_for_status()
print(r.json())The same body on https://auray.run runs synchronously and answers the result — unless it usually takes longer than a run may hold its connection, which is refused 400 model_not_synchronous before anything is charged. Options — ?webhook=, ?wait=, priority and timeout headers — are on Submit a request.
Input schema
Show child attributes
"Achernar", "Achird", "Algenib", "Algieba", "Alnilam", "Aoede", "Autonoe", "Callirrhoe" and 22 more
"Charon", "Despina", "Enceladus", "Erinome", "Fenrir", "Gacrux", "Iapetus", "Kore", "Laomedeia", "Leda", "Orus", "Puck", "Pulcherrima", "Rasalgethi", "Sadachbia", "Sadaltager", "Schedar", "Sulafat", "Umbriel", "Vindemiatrix", "Zephyr", "Zubenelgenubi"Show child attributes
"Achernar", "Achird", "Algenib", "Algieba", "Alnilam", "Aoede", "Autonoe", "Callirrhoe" and 22 more
"Charon", "Despina", "Enceladus", "Erinome", "Fenrir", "Gacrux", "Iapetus", "Kore", "Laomedeia", "Leda", "Orus", "Puck", "Pulcherrima", "Rasalgethi", "Sadachbia", "Sadaltager", "Schedar", "Sulafat", "Umbriel", "Vindemiatrix", "Zephyr", "Zubenelgenubi""ar-EG", "bn-BD", "nl-NL", "en-IN", "en-US", "fr-FR", "de-DE", "hi-IN" and 79 more
"id-ID", "it-IT", "ja-JP", "ko-KR", "mr-IN", "pl-PL", "pt-BR", "ro-RO", "ru-RU", "es-ES", "ta-IN", "te-IN", "th-TH", "tr-TR", "uk-UA", "vi-VN", "af-ZA", "sq-AL", "am-ET", "ar-001", "hy-AM", "az-AZ", "eu-ES", "be-BY", "bg-BG", "my-MM", "ca-ES", "ceb-PH", "cmn-CN", "cmn-tw", "hr-HR", "cs-CZ", "da-DK", "en-AU", "en-GB", "et-EE", "fil-PH", "fi-FI", "fr-CA", "gl-ES", "ka-GE", "el-GR", "gu-IN", "ht-HT", "he-IL", "hu-HU", "is-IS", "jv-JV", "kn-IN", "kok-IN", "lo-LA", "la-VA", "lv-LV", "lt-LT", "lb-LU", "mk-MK", "mai-IN", "mg-MG", "ms-MY", "ml-IN", "mn-MN", "ne-NP", "nb-NO", "nn-NO", "or-IN", "ps-AF", "fa-IR", "pt-PT", "pa-IN", "sr-RS", "sd-IN", "si-LK", "sk-SK", "sl-SI", "es-419", "es-MX", "sw-KE", "sv-SE", "ur-PK"Show child attributes
"URL"."MP3", "WAV", "FLAC", "OGG".Show child attributes
1, 2.Idempotency-Key: as a header is accepted as an alias — that is the spelling a retrying proxy replays, and the one to use when running a model on auray.run, where a request that outlives its connection is answered 504 and recovered by replay. Omit it and the platform mints one. 1 to 64 characters.Rules
Across fields, as the model's documentation states them. Each is judged before anything is charged — warned with a Deprecation header until enforcement starts — and listed as JSON Schema under x-auray-rules in the openapi.json.
- When
outputFormatis one of "WAV", "FLAC", do not sendaudioSettings. - When
outputFormatis "MP3",audioSettings.sampleRatemust be one of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000. WhenoutputFormatis "MP3", whenaudioSettings.sampleRateis one of 16000, 22050, 24000,audioSettings.bitratemust be between 8 and 160. WhenoutputFormatis "MP3", whenaudioSettings.sampleRateis one of 32000, 44100, 48000,audioSettings.bitratemust be between 32 and 320. WhenoutputFormatis "MP3", whenaudioSettings.sampleRateis one of 8000, 11025, 12000,audioSettings.bitratemust be between 8 and 64. - When
outputFormatis "OGG",audioSettings.sampleRatemust be one of 8000, 12000, 16000, 24000, 48000. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 8000 andaudioSettings.channelsis 2,audioSettings.bitratemust be between 16 and 80. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 12000 andaudioSettings.channelsis 1,audioSettings.bitratemust be between 16 and 48. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 12000 andaudioSettings.channelsis 2,audioSettings.bitratemust be between 16 and 96. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 16000 andaudioSettings.channelsis 1,audioSettings.bitratemust be between 16 and 96. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 16000 andaudioSettings.channelsis 2,audioSettings.bitratemust be between 24 and 192. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 24000 andaudioSettings.channelsis 1,audioSettings.bitratemust be between 16 and 80. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 24000 andaudioSettings.channelsis 2,audioSettings.bitratemust be between 32 and 160. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 48000 andaudioSettings.channelsis 1,audioSettings.bitratemust be between 32 and 224. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 48000 andaudioSettings.channelsis 2,audioSettings.bitratemust be between 48 and 256. WhenoutputFormatis "OGG", whenaudioSettings.sampleRateis 8000 andaudioSettings.channelsis 1,audioSettings.bitratemust be between 8 and 40. - Do not send
speech.voicetogether withspeech.voices. speech.voicesmust hold exactly 2 items. In every item ofspeech.voices:speech.voices[].speakerandspeech.voices[].voiceare required.
Machine contracts
- openapi.json — this page as an OpenAPI 3.1 document, public.
- llms.txt — the same, written for an agent.
Was this page helpful?