API Documentation: Quick Start Guide for Text-to-Speech Integration

By SonicPipe editorial team · Updated 2026-11-18

This guide helps indie developers and no-code creators switch from Google Cloud or Azure to SonicPipe’s TTS API. You will find concrete integration steps for both cURL and the OpenAI SDK, covering authentication, request parameters, and response handling. Every example is tested against the live endpoint at https://api.vip4bd.com/v1.

We focus on raw data: exact rate limits, character pricing, and supported voice presets. You will learn how to handle long texts, rotate API keys, and understand why failed requests are free. No marketing fluff, just the technical details you need to build and deploy your audio features quickly.

API Documentation: Quick Start Guide for Text-to-Speech Integration

Frequently asked questions

How do I get an API key?

Sign up at /get-api-key/ using Google or email. Google sign-ins receive a $0.50 free trial valid for seven days; email accounts start without trial credit. You receive one active key per account, displayed on the dashboard alongside your balance and usage statistics.

Can I use the OpenAI SDK?

Yes. The API mimics the OpenAI speech endpoint structure. Simply change your SDK’s base_url to https://api.vip4bd.com/v1 and use your SonicPipe key. This allows you to use official OpenAI SDKs directly without rewriting your integration code, ensuring a smooth transition from other providers.

What is the base URL?

The API base URL is https://api.vip4bd.com/v1. Use this endpoint for all requests, including POST /v1/audio/speech for generation and GET /v1/voices for metadata. This base URL ensures compatibility with standard OpenAI SDK configurations when you update the endpoint in your client library.

How do I handle rate limits?

Limits are 60 requests per minute per key, or 10 per minute before your first top-up. Requests process sequentially, so load may cause queuing. If you exceed limits, requests will wait or fail. Monitor your usage dashboard to stay within these bounds and avoid delays.

What formats are supported?

Supported response formats are mp3, wav, opus, flac, and pcm. Specify your preferred format in the response_format field of your JSON request body. These formats cover most standard audio playback and processing needs for indie developers and no-code applications integrating text-to-speech functionality.

Can I change the speed?

Yes. Adjust the speed parameter between 0.25 and 4.0. This allows you to slow down narration for clarity or speed up content for quick consumption. Adjustments apply to the generated audio file immediately without requiring additional processing steps.

How do I specify language?

Pass the ISO code in the language field. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting the language ensures accurate synthesis for non-English Latin-script texts or specific dialects supported by the 23 available languages.

What happens if I exceed limits?

Requests are processed sequentially, so high volume causes queuing. If you exceed the 60 requests per minute limit, new requests may wait or fail. Failed requests are free, with charges returned in full. Monitor your dashboard to manage throughput and avoid unnecessary delays in generation.

Is streaming supported?

No. The API returns the complete audio file upon request completion. There is no WebSocket or real-time partial audio streaming. You must wait for the full synthesis to finish before receiving the audio data. This simplifies integration but does not support real-time playback scenarios.

Do I need SSML?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You control pacing and tone primarily through voice selection and speed adjustments. This keeps the integration simple for no-code users who do not require granular control over individual phoneme pronunciation.

How long does a request take?

Typical speed is roughly real-time, generating about 25 characters per second. Short phrases take a few seconds. Under load, requests may queue since they process sequentially. Expect delays during high traffic, but long texts generally generate at a pace matching their audio duration.

Can I use custom voices?

No. SonicPipe offers eight fixed presets: Aria, Nova, Luna, Sage, Felix, Milo, Atlas, and Orion. There is no custom voice cloning or uploading of your own voice. Each voice is based on licensed recordings from LibriTTS-R (CC BY 4.0) and LibriVox public-domain audiobook readings, providing consistent synthetic speech.

How do I rotate my API key?

Issue a new key from your dashboard at any time. The new key becomes active immediately, and the old one stops working at once. This allows seamless rotation without downtime. You can generate a new key whenever needed to secure your account or distribute access.

What is the character limit?

Each request supports up to 4096 characters of input text. For longer texts, split them into parts of this size and join the resulting audio files. Spaces and punctuation count toward the limit. This ensures consistent processing times and manageable payload sizes for each API call.

First request

curl

curl https://api.vip4bd.com/v1/audio/speech \
  -H "Authorization: Bearer $TTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","voice":"aria","input":"Hello from the API.","response_format":"mp3"}' \
  --output hello.mp3

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.vip4bd.com/v1", api_key="tts-...")

with client.audio.speech.with_streaming_response.create(
    model="tts-1", voice="nova", input="Hello from Python.", response_format="mp3"
) as response:
    response.stream_to_file("hello.mp3")

Node.js (openai)

import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({ baseURL: "https://api.vip4bd.com/v1", apiKey: process.env.TTS_API_KEY });
const res = await client.audio.speech.create({ model: "tts-1", voice: "milo", input: "Hello from Node.js." });
fs.writeFileSync("hello.mp3", Buffer.from(await res.arrayBuffer()));
voice
ariafemale
novafemale
lunafemale
sagefemale
felixmale
milomale
atlasmale
orionmale
language
arالعربية
zh中文
daDansk
nlNederlands
enEnglish
fiSuomi
frFrançais
deDeutsch
elΕλληνικά
heעברית
hiहिन्दी
itItaliano
ja日本語
ko한국어
msBahasa Melayu
noNorsk
plPolski
ptPortuguês
ruРусский
esEspañol
swKiswahili
svSvenska
trTürkçe

Authentication

Sound wave illustration for: Authentication

Generate a unique API key via the /get-api-key/ dashboard. Use this key to authenticate all requests to the TTS engine.

Each account holds one active key. Secure it and use it in the Authorization header for every API call.

API key generation

Create your key on the /get-api-key/ page. It appears instantly for immediate use in your integration.

  • Available via Google sign-in or email registration.
  • One key per account.

Bearer token usage

Include the header: Authorization: Bearer tts-... in every request to https://api.vip4bd.com/v1.

The key authenticates your account and tracks usage against your balance.

  • Prefix with 'Bearer '.
  • Case-sensitive.

Key rotation policy

Issue a new key anytime from the dashboard. The previous key stops working immediately.

No downtime occurs during rotation if you update your code promptly.

  • Instant invalidation.
  • No legacy key overlap.

Quick Start with cURL

Sound wave illustration for: Quick Start with cURL

Send a POST request to https://api.vip4bd.com/v1/audio/speech with your API key. This endpoint generates audio files directly from text input, supporting formats like MP3, WAV, and FLAC.

You need a valid Bearer token in the Authorization header and a JSON body containing the model, input text, and voice preset. The API returns the generated audio file in the response body.

Basic request example

Use this cURL command to generate speech. Replace YOUR_API_KEY with your key from /get-api-key/.

`curl -X POST https://api.vip4bd.com/v1/audio/speech -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"model": "tts-1", "input": "Hello world", "voice": "nova", "response_format": "mp3"}' -o output.mp3`

Required parameters

The model must be tts-1 or tts-1-hd. The input field accepts text up to 4096 characters. The voice field requires one of the eight available presets, such as nova or aria. The response_format determines the output file type (mp3, wav, opus, flac, or pcm).

Response format

A successful request returns the audio file directly in the response body. The file type matches your specified response_format. If synthesis fails, an error is returned; failed requests are refunded in full.

Quick Start with cURL

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

The SonicPipe API follows the same request shape as the OpenAI Speech endpoint. By adjusting the base URL, you can use the official OpenAI SDKs without rewriting your integration logic. This compatibility allows indie developers to swap providers with minimal code changes.

Base URL configuration

Point your OpenAI SDK client to the SonicPipe API endpoint. Set the base URL to https://api.vip4bd.com/v1 and use your API key for authentication. This simple configuration enables the SDK to route requests to our TTS service.

  • Base URL: https://api.vip4bd.com/v1
  • Auth: Authorization: Bearer tts-...

Client initialization

Initialize the OpenAI client with your API key. The SDK handles the connection details, allowing you to focus on sending text and receiving audio data.

Method calls

Call the audio.speech method with your desired model, voice, and input text. The API returns the generated audio file directly in the response, ready for playback or storage. Failed requests are free, ensuring you only pay for successful synthesis.

Request Parameters

Sound wave illustration for: Request Parameters

Configure your synthesis requests by specifying the model, voice, and optional parameters like speed and language. This section details the exact fields required to generate audio via the POST /v1/audio/speech endpoint.

Model selection (tts-1, tts-1-hd)

Choose between tts-1 or tts-1-hd. Both models use the same underlying engine and share the identical price point of $10 per 1 million characters.

Voice presets

Select from eight distinct voice presets, including female voices like Aria and Nova, or male options such as Felix and Atlas. Every voice supports all 23 available languages, allowing you to mix and match without purchasing separate voice assets.

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Felix: Energetic, promo
  • Atlas: Neutral, news

Speed and language settings

Adjust the speed parameter between 0.25 and 4.0 to control playback rate. The language field is optional; if omitted, the system guesses the language from the script, defaulting to English for Latin text.

Response Formats

Sound wave illustration for: Response Formats

The API returns synthesized audio in the format specified by the response_format parameter. Available options include mp3, wav, opus, flac, and pcm. Each format serves different integration needs, from web delivery to raw data processing.

Choose the format that best fits your pipeline. MP3 offers efficient compression for web use, while WAV and FLAC provide lossless quality for archival or editing. PCM delivers raw audio data, and Opus balances quality with small file sizes for bandwidth-constrained environments.

MP3 output

MP3 is a widely supported compressed format suitable for web playback and general distribution. It reduces file size while maintaining acceptable audio quality for most listener applications.

Select mp3 in your request to receive a standard MPEG-1 Audio Layer III file. This format is ideal when bandwidth efficiency is a priority without requiring specialized decoders.

  • Compatible with all major browsers and media players
  • Significantly smaller file size compared to uncompressed formats

WAV and FLAC options

WAV provides uncompressed PCM audio, ensuring maximum compatibility with legacy systems and audio editing software. FLAC offers lossless compression, preserving exact audio fidelity while reducing storage requirements compared to WAV.

Use wav for direct audio processing or flac when you need perfect reconstruction of the synthesized voice for further analysis or high-quality archival storage.

  • WAV: Uncompressed, universally supported
  • FLAC: Lossless compression, smaller than WAV

PCM and Opus support

PCM returns raw audio samples, providing the purest data stream for custom audio pipelines or real-time processing applications. Opus is a highly efficient codec ideal for low-latency streaming or voice-over-IP integrations.

Specify pcm for raw byte streams or opus when you need efficient encoding with low computational overhead. These formats give you direct control over the audio data structure.

  • PCM: Raw audio data, no encoding overhead
  • Opus: Efficient encoding, low latency
Response Formats

Rate Limits

Sound wave illustration for: Rate Limits

Each API key supports a maximum throughput of 60 requests per minute. This baseline applies once your account has an active balance. The limit is enforced per key, ensuring fair resource distribution across all users on vip4bd.com.

60 requests per minute

After your first top-up, your key operates at the standard rate of 60 requests per minute. This capacity allows indie developers to process longer texts efficiently without significant queuing delays, provided requests are spaced appropriately.

Initial 10 requests per minute

New keys or those without a current top-up are limited to 10 requests per minute. This lower tier helps manage initial load and prevents resource exhaustion before billing is established. The restriction lifts automatically once a valid USDT (TRC-20) transfer is confirmed and your balance updates.

Rate limit headers

The API response includes standard rate-limit headers to help you monitor your usage. Check these headers in your HTTP responses to adjust your client’s request frequency dynamically, ensuring you stay within the 60 rpm or 10 rpm limits depending on your account status.

Error Handling

Sound wave illustration for: Error Handling

Errors are handled via standard HTTP status codes and JSON responses. When a request fails, the API returns an error object with a message explaining the issue, such as invalid input or insufficient balance. Use these messages to debug your integration quickly without guessing the cause.

Common error codes

The API returns specific codes for distinct issues. A 401 error indicates an invalid or expired API key, while a 400 error signals malformed JSON or missing required fields like input or voice. A 413 error occurs if your text exceeds the 4096-character limit per request. Check the response body for a detailed message to identify the exact problem.

  • 401: Unauthorized (invalid key)
  • 400: Bad Request (missing fields or invalid format)
  • 413: Payload Too Large (text > 4096 chars)

Retry logic

For transient network issues, implement a simple retry with a short delay. The API processes requests sequentially, so under high load, a request may wait in a queue. If you receive a temporary failure, waiting a few seconds before retrying is usually sufficient. Avoid aggressive exponential backoff unless you are hitting rate limits, as the queue handles mild congestion naturally.

Failed request refunds

Failed requests are free. If synthesis fails due to a server-side error, the charge is returned in full to your balance. You do not need to submit a claim; the refund is automatic. This ensures you only pay for successfully generated audio files. Check your account dashboard to verify refunded amounts appear in your balance within minutes.

Error Handling

Advanced Usage

Sound wave illustration for: Advanced Usage

Split input text into segments of up to 4,096 characters. Each segment generates a separate audio file. The server processes these requests sequentially, so under load, generation may wait in a queue.

After synthesis, join the resulting audio files into a single continuous file. This ensures seamless playback for longer documents without gaps or metadata inconsistencies between segments.

Long text splitting

Divide your input into chunks of 4,096 characters or fewer. Spaces and punctuation count toward this limit. Send each chunk as a separate request to the POST /v1/audio/speech endpoint.

  • Max 4,096 characters per request
  • Spaces and punctuation count as characters
  • Each chunk generates a separate audio file

Audio file joining

Combine the returned audio files sequentially. Since the server processes requests one after another, the output files will naturally align. Use your preferred audio library to merge them into one continuous file.

Language detection

The API guesses the language from the text script. Latin script defaults to English. For non-English Latin text, explicitly set the language parameter. Supported languages include Arabic, Chinese, Danish, and 20 others.

  • Latin script defaults to English
  • Set language for non-English Latin text
  • 23 supported languages available

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. You can build your dream game without writing a single line of code using these intuitive tools.

Avatar of the voice aria
ariafemale
Avatar of the voice nova
novafemale
Avatar of the voice luna
lunafemale
Avatar of the voice sage
sagefemale
Avatar of the voice felix
felixmale
Avatar of the voice milo
milomale
Avatar of the voice atlas
atlasmale
Avatar of the voice orion
orionmale

23 languages

Any voice speaks any of these languages.

Sources and further reading

  1. Wikipedia
  2. LibriTTS-R paper (arXiv 2305.18802)
  3. openai-node on GitHub
  4. Creative Commons Attribution 4.0
  5. MDN: Web Speech API
  6. TRON developer hub: TRC-20
  7. Node.js documentation
  8. LibriVox public-domain audiobooks
  9. ISO 639 language codes
  10. openai-python on GitHub
  11. IETF RFC 7845: Ogg Opus
  12. W3C WAI: making audio and video accessible

More on this site