Docs

Running a model

Auray ServerlessText to audio

Dia2 2B

Streaming dialogue TTS with voice cloning, non-verbal cues, and multi-speaker support

POSTauray-serverless/dia2-2b
openapi.jsonllms.txt

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.0157. 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 128 to 73117.8 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.

#Input

FieldTypeRequiredDefaultDescription
inputsobjectno—
inputs.audiosstring[]no—Voice reference audio samples for speaker cloning (an http(s) URL; upload a local file first and send its read URL). The first audio provides the voice for lines tagged [S1] in speech.text, and the second for [S2]. Internally transcribed with Whisper for alignment. Documented range: 1 to 2.
negativePromptstringno—Prompt to guide what to exclude from generation. Ignored when guidance is disabled (CFGScale ≤ 1). Documented range: 2 to 3,000 characters.
seedintegerno—Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range. Documented range: 0 to 2,147,483,647.
CFGScalenumberno3Guidance scale representing how closely the output will resemble the prompt. Higher values produce results more aligned with the prompt. Documented range: 1 to 30.
speechobjectyes—
speech.textstringyes—Text to convert to speech. Documented range: 1 to 3,000 characters.
settingsobjectno—
settings.temperaturenumberno0.6Sampling temperature for text token generation. Lower = more coherent, higher = more variety. 0 = greedy decoding. Documented range: 0 to 5.
settings.audioTemperaturenumberno0.8Sampling temperature for audio token generation. Lower = cleaner audio, higher = more expressive. 0 = greedy decoding. Documented range: 0 to 5.
settings.includePrefixbooleanno—Whether to include prefix audio in the final output or trim it.
settings.topKintegerno50Top-K sampling for both text and audio tokens. Limits selection to K most likely tokens per step. Documented range: 1 to 500.
outputTypestringno"URL"Audio output type. One of "URL".
outputFormatstringno"MP3"Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities. - `JPG`: Best for photorealistic images with smaller file sizes (no transparency). - `PNG`: Lossless compression, supports high quality and transparency (alpha channel). - `WEBP`: Modern format providing superior compression and transparency support. - `MP4`: Widely supported video container (H.264), recommended for general use. - `WEBM`: Optimized for web delivery. - `MOV`: QuickTime format, common in professional workflows (Apple ecosystem). - `GIF`: Animated image format (no audio), suitable for short loops or previews. - `MP3`: Compressed audio, smaller file size. - `WAV`: Uncompressed, high-quality audio. - `FLAC`: Lossless compression. - `OGG`: Open-source compressed audio format (Vorbis codec). - `SVG`: Scalable Vector Graphics. - `TIFF`: High-quality output supporting layers. - `GLB`: Binary glTF format for 3D models, including geometry, textures, and PBR materials. > [!NOTE] > **Transparency**: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., `PNG`, `WEBP`, `TIFF`). `JPG` does not support transparency. One of "MP3", "WAV", "FLAC", "OGG".
audioSettingsobjectno—
audioSettings.bitrateintegerno—Audio bitrate in kbps. Documented range: 8 or more.
audioSettings.channelsintegerno2Number of audio channels. 1 for mono, 2 for stereo. One of 1, 2.
audioSettings.sampleRateintegerno—Audio sample rate in Hz.
idempotency_keystringno—Your own name for this request. Send the same one twice and the second call is answered with the first request rather than charged again. 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 outputFormat is one of "WAV", "FLAC", do not send audioSettings.
  • When outputFormat is "MP3", audioSettings.sampleRate must be one of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000. When outputFormat is "MP3", when audioSettings.sampleRate is one of 16000, 22050, 24000, audioSettings.bitrate must be between 8 and 160. When outputFormat is "MP3", when audioSettings.sampleRate is one of 32000, 44100, 48000, audioSettings.bitrate must be between 32 and 320. When outputFormat is "MP3", when audioSettings.sampleRate is one of 8000, 11025, 12000, audioSettings.bitrate must be between 8 and 64.
  • When outputFormat is "OGG", audioSettings.sampleRate must be one of 8000, 12000, 16000, 24000, 48000. When outputFormat is "OGG", when audioSettings.sampleRate is 8000 and audioSettings.channels is 2, audioSettings.bitrate must be between 16 and 80. When outputFormat is "OGG", when audioSettings.sampleRate is 12000 and audioSettings.channels is 1, audioSettings.bitrate must be between 16 and 48. When outputFormat is "OGG", when audioSettings.sampleRate is 12000 and audioSettings.channels is 2, audioSettings.bitrate must be between 16 and 96. When outputFormat is "OGG", when audioSettings.sampleRate is 16000 and audioSettings.channels is 1, audioSettings.bitrate must be between 16 and 96. When outputFormat is "OGG", when audioSettings.sampleRate is 16000 and audioSettings.channels is 2, audioSettings.bitrate must be between 24 and 192. When outputFormat is "OGG", when audioSettings.sampleRate is 24000 and audioSettings.channels is 1, audioSettings.bitrate must be between 16 and 80. When outputFormat is "OGG", when audioSettings.sampleRate is 24000 and audioSettings.channels is 2, audioSettings.bitrate must be between 32 and 160. When outputFormat is "OGG", when audioSettings.sampleRate is 48000 and audioSettings.channels is 1, audioSettings.bitrate must be between 32 and 224. When outputFormat is "OGG", when audioSettings.sampleRate is 48000 and audioSettings.channels is 2, audioSettings.bitrate must be between 48 and 256. When outputFormat is "OGG", when audioSettings.sampleRate is 8000 and audioSettings.channels is 1, audioSettings.bitrate must be between 8 and 40.
  • When settings.includePrefix is sent, inputs.audios is required.

#Example

curl -X POST https://queue.auray.run/auray-serverless/dia2-2b \
  -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"
  }
}'

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.

#Machine contracts

  • openapi.json — this page as an OpenAPI 3.1 document, public.
  • llms.txt — the same, written for an agent.

Start typing to search every page of the documentation.

Up arrow Down arrow to moveEnter to openEscape to close