Audio API

Text-to-speech

Convert text into lifelike spoken audio. The endpoint streams raw audio bytes — drop them into a <audio> element or save to disk.

POSThttps://api.getnimbus.net/v1/audio/speech

Send a JSON body with your text and voice selection. The response is raw audio bytes with Content-Type: audio/mpeg.

Request body

{
  "model": "tts-1",
  "input": "Hello, welcome to Meridian.",
  "voice": "alloy"
}

model

tts-1

The TTS model to use. Currently only tts-1 is available.

input

string (required)

The text to generate audio for. Maximum length: 4096 characters.

voice

alloy

The voice to use. alloy is a neutral, expressive voice.

Example with cURL

curl https://api.getnimbus.net/v1/audio/speech \
  -H "Authorization: Bearer $MERIDIAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }' \
  --output speech.mp3

Example with fetch

const response = await fetch("https://api.getnimbus.net/v1/audio/speech", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.MERIDIAN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "tts-1",
    input: "Hello from the browser.",
    voice: "alloy",
  }),
});

const blob = await response.blob();
const url = URL.createObjectURL(blob);
const audio = new Audio(url);
audio.play();

Response

The response body is the raw audio data. The Content-Type header is set to audio/mpeg. On error, a standard JSON error object is returned with the appropriate HTTP status code.