Frequently asked questions
What is the API endpoint?
Send POST requests to https://api.bdgocasino.com/v1/audio/speech with a JSON body. The request shape matches the OpenAI speech endpoint, allowing you to use official OpenAI SDKs by simply changing the base_url to https://api.bdgocasino.com/v1 and providing your API key.
How do I authenticate my requests?
Include an Authorization header with your Bearer token: Authorization: Bearer tts-... . Each account has one active key; issuing a new key immediately invalidates the old one. You can find your key on the /get-api-key/ dashboard page.
Which is better: tts-1 or tts-1-hd?
Both models use the same engine and have identical pricing. Choose based on your audio quality preference. The API accepts either 'tts-1' or 'tts-1-hd' in the model field, with no functional difference in processing or cost between the two options.
What models are available?
The API offers two models: 'tts-1' and 'tts-1-hd'. Both utilize the same underlying engine and pricing structure. You can list available models by sending a GET request to the /v1/models endpoint to confirm current availability and details.
How do I change the voice speed?
Include a 'speed' field in your JSON request body with a value between 0.25 and 4.0. This allows you to adjust the playback rate of the generated audio. The default speed is 1.0, suitable for standard narration or dialogue.
Can I specify the language?
Yes, include an optional 'language' field with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, explicitly setting the language ensures accurate synthesis.
What happens if I exceed the rate limit?
The limit is 60 requests per minute per key (10 per minute before the first top-up). Exceeding this may cause requests to wait in a queue or fail. Failed requests are free, so you are not charged for failed synthesis requests.
Do I need to handle audio buffering?
No, the API returns the complete audio file in the response. There is no streaming or WebSocket support. You receive the full file immediately after processing, which may take time for long texts due to sequential processing and queuing.
Is the API synchronous or asynchronous?
The API is synchronous. You send a request and wait for the complete audio file in the response. Requests are processed sequentially, so under load, your request may wait in a queue before synthesis begins and completes.
How do I parse the JSON response?
The response contains the audio file data directly. Use standard HTTP client handling for your chosen language. The body includes the audio bytes in the requested format (mp3, wav, opus, flac, or pcm).
What is the maximum text length?
Each request supports up to 4096 characters. For longer texts, split your input into parts of this size and join the resulting audio files. Spaces and punctuation count toward the character limit used for billing and processing.
Can I use this with Node.js?
Yes, use the official OpenAI SDK or plain HTTP. Change the base_url to https://api.bdgocasino.com/v1 and provide your API key. The request shape matches the OpenAI speech endpoint, ensuring compatibility with existing Node.js implementations without custom drivers.
How do I handle audio format conversion?
Specify the desired format using the 'response_format' field: mp3, wav, opus, flac, or pcm. The API returns the audio in that exact format. No additional conversion is needed unless your downstream system requires a different standard.
Is there a sandbox environment?
No separate sandbox environment exists. Use your production API key against https://api.bdgocasino.com/v1. You can test with your free trial credit of $0.50 (valid for 7 days) to verify functionality before committing to paid top-ups.
First request
curl
curl https://api.bdgocasino.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.bdgocasino.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.bdgocasino.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 and Setup
Accessing the ToonTTS API requires a valid API key, which you can generate on the /get-api-key/ page using Google or email registration. Each account holds one active key at a time, ensuring straightforward authentication for your animation pipeline.
Generating Your API Key
Visit the /get-api-key/ page to create your account. Signing in with Google provides a $0.50 trial credit valid for 7 days, while email-based accounts start without trial credit. Your key appears immediately in the dashboard.
Bearer Token Authorization
Include your key in the request header as Authorization: Bearer tts-.... This standard Bearer token format ensures secure access to the https://api.bdgocasino.com/v1 base URL for all API calls.
Key Management and Revocation
You can issue a new key at any time via the dashboard. The previous key stops working immediately, allowing you to revoke access instantly if needed. Only one key is active per account.
Endpoints and Request Structure
The core of the API is the POST /v1/audio/speech endpoint, which accepts text and returns an audio file. It mirrors the OpenAI speech structure, allowing agencies to swap the base URL and use existing OpenAI SDKs with minimal code changes.
Two auxiliary endpoints provide metadata. GET /v1/voices lists the eight available presets, supported languages, and formats. GET /v1/models confirms the available engine versions (tts-1 and tts-1-hd) for integration testing.
POST /v1/audio/speech
This endpoint processes your input text and returns the synthesized audio. You send a JSON body containing the model, input text, voice selection, and desired format. The API handles the conversion and returns the audio file in the response.
- Endpoint: POST https://api.bdgocasino.com/v1/audio/speech
- Accepts JSON body with model, input, voice, and response_format fields
- Returns audio file in the specified format (mp3, wav, opus, flac, pcm)
GET /v1/voices
Retrieve a list of all available voice presets, their associated languages, and supported audio formats. This allows developers to dynamically populate voice selection menus in their applications without hardcoding voice names.
- Lists 8 voice presets (e.g., aria, nova, felix, atlas)
- Returns supported languages and formats for each voice
- Useful for dynamic UI integration in animation pipelines
GET /v1/models
Returns the list of available TTS models. Currently, this includes tts-1 and tts-1-hd, both using the same engine and pricing. This endpoint helps verify model availability for your integration.
- Returns available model IDs (tts-1, tts-1-hd)
- Useful for automated health checks or model selection logic
- Both models share the same pricing structure
Parameters for Voice Generation
Configure your synthesis requests using three core parameters: model, voice, and optional speed or language settings. The API accepts two model variants, "tts-1" and "tts-1-hd," which share identical pricing and engine capabilities. You must select one of eight distinct voice presets tailored for animation, ranging from warm narrators to deep documentary tones.
Control delivery pacing with a speed multiplier between 0.25 and 4.0. While the system auto-detects language from the text script, you can explicitly override this via an ISO code. This ensures accurate phonetics for non-English Latin scripts or specific regional dialects without relying on heuristic guessing.
Model Selection (tts-1 / tts-1-hd)
Both "tts-1" and "tts-1-hd" utilize the same underlying engine and pricing structure. The distinction lies solely in the output format, with "tts-1-hd" offering higher fidelity.
- "tts-1": Standard quality, real-time performance
- "tts-1-hd": High fidelity, ideal for prominent roles
- Identical pricing: $0.01 per 1,000 characters
Voice Presets and Styles
Select from eight preset voices designed for varied animation needs. Female voices include Aria (warm narrator), Nova (upbeat), Luna (storytelling), and Sage (instructional). Male options cover Felix (energetic promo), Milo (conversational), Atlas (neutral news), and Orion (deep documentary).
These voices are derived from licensed recordings and support all 23 languages. Each generated audio file contains an inaudible watermark identifying it as synthetic speech, useful for content tracking in broadcast pipelines.
- Aria: Warm, clear narrator
- Nova: Bright, upbeat
- Luna: Soft, storytelling
- Sage: Calm, instructional
- Felix: Energetic, promo
- Milo: Friendly, conversational
- Atlas: Neutral, news
- Orion: Deep, documentary
Speed and Language Codes
Adjust the speed parameter from 0.25 to 4.0 to match character timing. The default speed is 1.0. Note that requests are processed sequentially, so extreme speeds may affect queue wait times during high load.
Set the language parameter with an ISO code (e.g., "en", "de", "ja") to force specific pronunciation. If omitted, the API guesses from the script, defaulting to English for Latin text. Explicitly setting this prevents mispronunciation in mixed-language scenes.
- Speed range: 0.25–4.0
- Language: Optional ISO code
- Default guess: English for Latin script
Response Formats and Audio Output
The API returns generated audio as a binary file or base64-encoded data, depending on the chosen response format. This allows seamless integration into your animation pipeline without intermediate file conversions.
Supported Audio Formats
You can request audio in MP3, WAV, Opus, FLAC, or PCM formats via the response_format parameter. MP3 and Opus are efficient for web delivery, while WAV and FLAC preserve lossless quality for post-production.
- MP3: Standard compressed audio for web playback
- WAV: Uncompressed PCM audio for editing
- Opus: High-efficiency compression for web delivery
- FLAC: Lossless compression for archival
- PCM: Raw uncompressed audio data
Handling Binary Responses
When using application/octet-stream or binary formats, the response body contains the raw audio bytes. Ensure your HTTP client handles binary data correctly to avoid corruption.
Error Codes and Messages
Errors return standard HTTP status codes (4xx, 5xx) with a JSON body containing a code and message. Failed synthesis requests are free, so no charge is applied.
Rate Limits and Performance
Each API key is limited to 60 requests per minute, rising to 10 per minute for new accounts before the first top-up. This constraint ensures stable performance across the network. Exceeding the limit returns a 429 error, so implement exponential backoff in your integration logic.
Requests Per Minute Limits
Rate limits are enforced per key, not per IP address. Since each account holds one active key, your total throughput is capped by this single limit. Monitor your usage via the dashboard to avoid unexpected throttling during bulk generation tasks.
Processing Queue Behavior
Requests are processed sequentially. Under load, your request may wait in a queue before synthesis begins. Short phrases typically take a few seconds, while longer texts process at roughly real-time speed (25 characters per second). Plan your workflow to account for this linear processing time.
Optimizing for Long Texts
For texts exceeding 4,096 characters, split the input into smaller chunks. Generate audio for each segment individually, then join the files client-side. This approach keeps individual requests within the character limit and allows for parallel processing if you manage multiple keys.

Code Examples and SDKs
The API is compatible with standard HTTP clients and the official OpenAI SDKs. You can generate audio files directly using command-line tools or integrate synthesis into your application logic with minimal code changes.
All examples use the base URL https://api.bdgocasino.com/v1. Replace YOUR_API_KEY with your secret key from the dashboard. Ensure your key is active and has sufficient balance before testing.
cURL Command Example
Use cURL to send a POST request for instant audio generation. This method is ideal for quick testing or scripting.
The command sends the text "Hello, this is a test." using the nova voice in mp3 format. Ensure your key is valid and your network allows outbound HTTPS requests.
- Replace YOUR_API_KEY with your actual token.
- Adjust input, voice, and response_format as needed.
OpenAI Python SDK Integration
Install the openai package and configure the base_url to point to our endpoint. This allows you to use familiar SDK methods for speech synthesis.
Create a client instance with your API key. Call the audio.speech.create method with the desired model, input text, and voice preset. The method returns the audio binary data directly.
- pip install openai
- client = OpenAI(base_url="https://api.bdgocasino.com/v1", api_key="YOUR_API_KEY")
- speech = client.audio.speech.create(model="tts-1", voice="nova", input="Hello world")
JavaScript Fetch Example
Use the native fetch API to send requests from browser or Node.js environments. Construct a POST request with the JSON body containing your parameters.
Handle the response as a blob to save the audio file locally or play it directly in the browser. This approach requires no additional dependencies beyond the standard library.
- const response = await fetch("https://api.bdgocasino.com/v1/audio/speech", { ... })
- const audioBlob = await response.blob()
- URL.revokeObjectURL(URL.createObjectURL(audioBlob))
Advanced Usage Patterns
For agencies producing animated content, long dialogues often exceed the 4,096-character limit per request. You must split your script into chunks, generate each part independently, and concatenate the resulting audio files. This ensures stable generation without truncation.
Since requests are processed sequentially under load, joining segments locally is often faster than waiting for a single large response to be generated. Use your preferred audio library to merge the files, preserving timing and format consistency across all dialogue lines.
Splitting Long Narrations
Divide your script into segments of up to 4,096 characters. Each segment becomes a separate API call. This prevents payload size issues and ensures every line is synthesized completely.
- Count characters including spaces and punctuation.
- Respect the 4,096-character hard limit.
- Issue one request per segment.
Joining Audio Segments
Concatenate the returned audio files in order. Ensure all segments use the same response_format and speed settings to avoid playback glitches. Local merging is efficient and gives you full control over the final timeline.
- Maintain consistent format (mp3, wav, etc.).
- Preserve speed settings across segments.
- Merge files sequentially.
Handling Concurrent Requests
While the API queues requests, high concurrency may increase latency. Monitor your rate limit of 60 requests per minute. Stagger requests if generating many lines simultaneously to avoid throttling.
- Limit to 60 requests per minute.
- Queue requests if needed.
- Monitor for 429 Too Many Requests.
Frequently Asked Questions
The quickstart guide covers the essentials, but you may have specific questions about integration details or workflow constraints. Below are precise answers to common developer inquiries regarding our TTS API.
How do I get an API key?
Sign up on /get-api-key/ using Google or email. Your key is displayed immediately on the dashboard alongside your balance and usage stats.
Which SDK should I use?
We do not provide an official SDK. Use the OpenAI SDK or standard HTTP libraries. Change the base URL to our endpoint.
What is the base URL?
https://api.bdgocasino.com/v1
How do I handle errors?
Check the HTTP status code. Failed requests are free, and the charge is returned in full. Read the JSON error message for details.
Can I use the OpenAI SDK?
Yes. Point the SDK's base_url to https://api.bdgocasino.com/v1 and use your API key. The request shape is identical to OpenAI's speech endpoint.
What formats are supported?
- mp3
- wav
- opus
- flac
- pcm
How do I specify the voice?
Pass one of the 8 voice presets (e.g., aria, nova, felix) in the voice field. Each has a distinct style for animation needs.
What is the character limit?
Each request supports up to 4096 characters. Split longer texts into chunks and join the resulting audio files.
How does speed work?
Adjust the speed parameter between 0.25 and 4.0. Default is 1.0. Lower values slow narration; higher values speed it up.
Can I stream the output?
No. The API returns the complete audio file after processing. There is no WebSocket or streaming endpoint.
Do I need to install extra libraries?
No. Use any standard HTTP client or the OpenAI Python/Node SDKs. No proprietary libraries are required.
How do I test the API?
Use the provided cURL example on the dashboard. You can also use the $0.50 free trial credit if you signed in with Google.
What is the response time?
Short phrases take a few seconds. Long texts generate at roughly real-time speed (25 characters per second). Requests are processed sequentially.
Can I use custom headers?
Only the Authorization: Bearer tts-... header is required. No other custom headers are needed for standard requests.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Agencies rely on our vibrant animation and cartoons to captivate audiences and bring their creative visions to life.
23 languages
Any voice speaks any of these languages.
