Frequently asked questions
How do I get an API key?
Sign up on the /get-api-key/ page using Google or email and password. Your account page displays your active key, balance, and usage. You can issue a new key at any time, which immediately invalidates the old one. Each site account is independent, so you need a separate key for each storefront you use. Accounts are per site.
What is the base URL?
The API base URL is https://api.2222bdcasino.com/v1. You use this endpoint for all requests, including the speech generation at /v1/audio/speech. This URL structure allows you to use standard OpenAI SDKs by simply changing the base_url configuration in your client initialization to point to this domain.
Which Python SDK should I use?
Use the official OpenAI Python SDK. Since our endpoint shape matches the OpenAI speech endpoint, you can integrate VocalByte by updating the base_url to https://api.2222bdcasino.com/v1. No custom package is required. The SDK handles the JSON request body and audio response format automatically.
How do I set the base URL?
Initialize the OpenAI client with base_url="https://api.2222bdcasino.com/v1". Pass your API key via the api_key parameter. This redirects all standard SDK calls to our infrastructure. Ensure you import the necessary modules from the openai package and configure the client before making any speech generation requests.
What are the required fields?
You must provide the model ("tts-1" or "tts-1-hd"), input text (up to 4096 characters), and voice. Optional fields include response_format, speed, and language. The model determines the engine and price, while the voice selects one of the eight available presets. Text length is strictly limited per request.
How do I handle rate limits?
The limit is 60 requests per minute per key, or 10 per minute before your first top-up. Requests are processed sequentially, so under load, you may experience queue delays. Implement exponential backoff in your Python code to handle 429 Too Many Requests responses gracefully during high traffic periods.
What happens if the request fails?
If synthesis fails, the charge is returned in full. You are not billed for failed requests. Ensure your code checks the response status and handles exceptions appropriately. Failed requests do not consume your character balance, allowing you to retry without cost if the initial attempt encounters an error. Failed requests are free.
Can I use SSML?
No, SSML is not supported. You must send plain text input. The API does not support phoneme dictionaries, custom pronunciation lexicons, or emotion tags. If you need specific pacing or emphasis, you must manage this by splitting your text into smaller segments and adjusting the speed parameter manually.
How do I change the voice speed?
Use the speed parameter in your request, accepting values between 0.25 and 4.0. This allows you to slow down or speed up the narration. The default speed is 1.0. Adjust this value based on your content type, such as using slower speeds for instructional content or faster speeds for summaries.
What is the maximum input length?
The maximum input length is 4096 characters per request. For longer texts, you must split the content into parts of up to 4096 characters and join the resulting audio files. Spaces and punctuation count toward this character limit. Plan your text segmentation strategy to ensure seamless audio playback for long documents.
Do I need to install a specific package?
No, you do not need a specific VocalByte package. Use the standard openai Python package. Since the API follows the OpenAI endpoint structure, the official SDK works directly by changing the base_url. This keeps your dependencies minimal and ensures compatibility with existing OpenAI-based workflows and libraries.
How do I authenticate requests?
Include the header Authorization: Bearer tts-... with your API key. You obtain this key from your account page after signing up. Each account has one active key at a time. If you issue a new key, the old one stops immediately. Ensure your key is valid and not expired.
What is the response format?
The response returns an audio file in the format you specified: mp3, wav, opus, flac, or pcm. The audio data is included directly in the response body. The audio data is included directly in the response body. You can process this binary data or save it to a file. Every generated file carries an inaudible watermark that marks it as synthetic speech.
How do I handle errors in Python?
Catch exceptions raised by the OpenAI SDK, such as RateLimitError or APIError. Check the status code and error message to determine the cause. For rate limits, implement a retry mechanism with delays. For other errors, log the details and notify the user. Failed requests do not deduct from your balance.
First request
curl
curl https://api.2222bdcasino.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.mp3Python (openai)
from openai import OpenAI
client = OpenAI(base_url="https://api.2222bdcasino.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.2222bdcasino.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 | |
|---|---|
aria | female |
nova | female |
luna | female |
sage | female |
felix | male |
milo | male |
atlas | male |
orion | male |
| language | |
|---|---|
ar | العربية |
zh | 中文 |
da | Dansk |
nl | Nederlands |
en | English |
fi | Suomi |
fr | Français |
de | Deutsch |
el | Ελληνικά |
he | עברית |
hi | हिन्दी |
it | Italiano |
ja | 日本語 |
ko | 한국어 |
ms | Bahasa Melayu |
no | Norsk |
pl | Polski |
pt | Português |
ru | Русский |
es | Español |
sw | Kiswahili |
sv | Svenska |
tr | Türkçe |
Authentication
Access the VocalByte API by including a valid bearer token in your request headers. Your key is issued upon account creation and is unique to your billing profile.
API Key Format
Keys begin with the prefix tts- followed by a sequence of alphanumeric characters. This format ensures clear identification in your application logs and distinguishes your token from other potential identifiers.
- Starts with
tts- - Alphanumeric characters only
- Case-sensitive
Header Authorization
Include your key in the Authorization header using the Bearer scheme. Every request to the speech endpoint requires this header for authentication and usage tracking.
- Header:
Authorization: Bearer tts-... - Required for all requests
- No query parameter support
Key Rotation
You can generate a new key at any time from your dashboard. The old key stops working immediately upon the issuance of the new one, ensuring tight security control.
First Request with Curl
Once you have your API key, the quickest way to verify connectivity is a simple cURL command. This sends a standard JSON payload to the speech endpoint, returning an audio file directly in the response body. It requires no external libraries or complex setup scripts.
The request structure mirrors the OpenAI standard, making it easy to switch between clients. You only need to provide the core parameters: the text to convert, the voice model, and the desired output format.
Basic JSON Body
Send a POST request to /v1/audio/speech with a JSON body containing the text, model, voice, and format. The API accepts standard UTF-8 encoded strings up to 4,096 characters per request. Spaces and punctuation count as characters.
This minimal payload ensures compatibility with existing OpenAI SDKs by simply overriding the base_url. No additional metadata or headers are required beyond authentication.
model: "tts-1" or "tts-1-hd"input: Your text string (max 4096 chars)voice: e.g., "nova", "aria", "felix"response_format: "mp3", "wav", "opus", or "flac"
Required Fields
The model, input, voice, and response_format fields are mandatory. Omitting any will result in a 400 Bad Request error before processing begins.
The language field is optional. If omitted, the system guesses the language from the script, defaulting to English for Latin characters. Explicitly setting it is recommended for non-English texts to ensure accuracy.
Response Format
On success, the API returns the audio file directly in the response body with the appropriate Content-Type header (e.g., audio/mpeg).
If the synthesis fails, you will receive a JSON error object with a descriptive message and status code, such as 429 for rate limits or 400 for invalid input. Failed requests are free.
Python Integration
VocalByte’s API mirrors the OpenAI speech endpoint structure, allowing you to leverage existing Python libraries without learning a new interface. By simply adjusting the base URL, you can use the standard OpenAI Python SDK to generate audio files directly in your application.
OpenAI SDK Setup
Install the official openai package via pip. This library handles JSON serialization and HTTP requests, providing a clean, idiomatic Python experience for startup developers who prefer standard tools over custom wrappers.
- pip install openai
Base URL Configuration
Point the SDK client to our API endpoint. Replace the default base URL with https://api.2222bdcasino.com/v1 to route requests through our infrastructure while maintaining the same request shape as OpenAI’s model.
Code Example
Initialize the client with your API key and call the audio.speech method. Pass your text, selected voice, and desired format to receive an MP3 file ready for playback or storage in your pipeline.
Parameters Explained
The API accepts two model variants, both powered by the same underlying engine. The choice between them affects only the engine and price, not the synthesis quality or voice characteristics.
Model Selection
Both tts-1 and tts-1-hd deliver identical voice quality. Use tts-1 for standard requests and tts-1-hd when you require higher fidelity without a significant difference in character-to-audio ratio. Both incur the same rate limit and pricing structure.
Voice Presets
Select from eight licensed presets, ranging from warm narrators to energetic promo voices. Each voice supports all 23 supported languages, including Arabic, Chinese, and Swahili. Any voice can speak any of these languages. If the language field is omitted, the system guesses the language based on the input script.
- aria: warm, clear narrator
- nova: bright, upbeat
- luna: soft, storytelling
- sage: calm, instructional
- felix: energetic, promo
- milo: friendly, conversational
Speed Adjustment
Adjust playback speed between 0.25x and 4.0x. The API processes requests sequentially, so extreme speeds may slightly alter perceived latency but do not affect the character limit. For long texts, speed adjustments apply uniformly across all generated audio segments.
Response Formats
VocalByte supports five distinct audio formats: mp3, wav, opus, flac, and pcm. Each format is generated directly from the TTS-1 engine, ensuring consistent voice quality regardless of your selection.
MP3 Output
MP3 is the default format, offering universal compatibility with nearly all web players and mobile applications. It provides a good balance between file size and audio fidelity, making it ideal for most standard use cases.
WAV Output
WAV provides uncompressed, high-quality audio suitable for professional editing or playback in environments where bit-perfect fidelity is required. Choose this format when you need to process the audio further without compression artifacts.
OPUS and FLAC
OPUS offers superior compression efficiency for web streaming, while FLAC provides lossless compression for archival quality. PCM provides uncompressed raw audio. Select OPUS for bandwidth-constrained environments and FLAC when you need perfect audio reproduction without the file size of WAV.

Error Handling
Robust error handling ensures your integration remains stable when the API returns non-successful status codes. VocalByte’s TTS API follows standard HTTP conventions, allowing you to programmatically detect and resolve issues during synthesis.
Common HTTP Errors
A 401 Unauthorized indicates your API key is missing or incorrect. A 403 Forbidden means the key is valid but may be revoked, often after a rotation. Always check your dashboard if access is unexpectedly denied.
Rate Limit Errors
Exceeding 60 requests per minute triggers a 429 Too Many Requests error. New accounts start with a 10 requests per minute limit until the first top-up. Implement exponential backoff to handle queue delays gracefully.
Invalid Input Errors
A 400 Bad Request occurs if the text exceeds 4096 characters or the voice ID is unknown. Ensure your input field is properly encoded and within the specified length limits to avoid silent failures.
Rate Limits
VocalByte enforces a global rate limit of 60 requests per minute for each active API key. This ceiling ensures consistent performance across all users sharing the same infrastructure. If you exceed this threshold, subsequent requests will be rejected until the window resets.
New accounts start with a stricter limit of 10 requests per minute. This restriction lifts automatically after your first top-up, allowing you to scale your volume as your project grows. There are no monthly plans or seats to manage, so your limit is tied directly to your single active key.
60 Requests Per Minute
The standard limit allows 60 synthesis requests every minute. This is sufficient for most batch processing workflows, such as generating audio for a podcast episode or a series of short notifications. Exceeding this cap results in a 429 Too Many Requests error.
Initial Limit
Fresh accounts begin with a 10 requests per minute limit. This ensures fair usage during the trial phase or before financial commitment. The limit increases to the standard 60 rpm once you complete your first USDT top-up of at least $5.
Queue Behavior
Requests are processed sequentially. Under heavy load, a request may wait in a queue before synthesis begins. This means generation time can vary slightly depending on current server traffic. Longer texts take roughly one second per 25 characters, but short phrases may take a few seconds due to queue positioning. Requests are processed one after another.
Long Text Handling
The API accepts a maximum of 4096 characters per single request. This constraint applies to the input field in your JSON payload, including spaces and punctuation. Exceeding this limit results in an immediate error, requiring you to split your text before sending.
For longer documents, you must implement a client-side chunking strategy. Divide your text into segments no larger than 4096 characters, ensuring you do not break words mid-sentence to maintain audio coherence. Send each segment as a separate request to the POST /v1/audio/speech endpoint.
4096 Character Limit
Each request is capped at 4096 characters. This limit is strict and applies to the entire input string, counting all spaces and punctuation marks. If your source text exceeds this length, the API will reject the request with a 400-level error.
- Limit includes all characters in the string
- Applies to the
inputfield only - Exceeding results in a request error
Chunking Strategy
Split your text into logical segments, ideally at sentence or paragraph boundaries. Use a simple string split function in Python to create an array of chunks. Ensure each chunk is strictly under 4096 characters to avoid truncation errors during synthesis.
Send these chunks sequentially or in parallel, depending on your rate limit handling. Since requests are processed one after another under load, consider adding a small delay between requests to prevent hitting the 60 requests per minute limit.
- Split at sentence boundaries for natural pauses
- Verify each chunk is < 4096 chars
- Handle rate limits during parallel sends
Audio Joining
After receiving the audio files for each chunk, join them in the original order. Most audio libraries can concatenate these files seamlessly. Since the API returns complete audio segments, no additional cross-fading or processing is needed for basic continuity.
The resulting audio will play back as a continuous stream of speech. Remember that short phrases may take a few seconds to generate, so your chunking logic should account for the cumulative latency of multiple requests.
- Concatenate audio files in order
- No special processing needed for continuity
- Account for generation latency
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Once the audio is delivered to your application, we do not store the generated audio files.
23 languages
Any voice speaks any of these languages.
