Frequently asked questions
What is the best voice for a game protagonist?
No single voice fits all protagonists. Choose based on your character’s personality: Aria offers a warm, clear narrator style; Felix provides energetic, promo tones; Atlas delivers neutral, news-style delivery; and Orion suits deep, documentary roles. Select the preset that best matches your protagonist’s specific tone and personality.
How do I handle long dialogue scripts?
Split your text into parts of up to 4096 characters per request. Generate each part individually and then join the resulting audio files. This ensures you stay within the character limit while maintaining consistent audio quality across your entire script without hitting API constraints.
Can I use the API for NPC dialogue?
Yes, the API is ideal for NPC dialogue. You can assign different voices like Nova for upbeat characters or Sage for instructional NPCs. Generate lines on demand or in batches, ensuring consistent audio formats and speeds suitable for real-time game engines or pre-baked audio files.
What format is best for Unity or Unreal?
Our API supports MP3, WAV, OPUS, FLAC, and PCM. For game projects, MP3 and WAV are reliable choices for broad compatibility, while FLAC offers lossless quality. OPUS and PCM are also available if your pipeline requires them. Select the format that best fits your specific audio pipeline and storage requirements.
How do I ensure voice consistency?
Use the same voice preset for all lines belonging to a specific character. Maintain consistent speed settings (0.25–4.0) and response formats. Since voices are fixed presets, sticking to one voice ensures your character’s audio remains recognizable and consistent across all generated dialogue lines.
Can I generate voice lines in batches?
Yes, you can generate multiple voice lines by sending separate POST requests. Each request handles up to 4096 characters. Process them sequentially or concurrently, keeping in mind the rate limit of 60 requests per minute per key to manage your generation workflow efficiently.
What if I make a mistake in the text?
Simply send a new request with the corrected text. Failed requests are free, so if a generation error occurs, you are not charged. For text errors, just re-submit the correct input. You only pay for successfully generated audio files, ensuring you only pay for usable output.
Do I need to re-generate if I change speed?
Yes, changing the speed parameter requires a new generation request. The API generates audio based on the specific speed setting (0.25–4.0) provided in the request. Adjusting speed alters the audio output, so you must submit a new request to get the updated audio file.
How do I track my API usage?
Check your account dashboard at /get-api-key/. It displays your balance, characters left, and usage history. You can also monitor request metadata like time, characters, and status, which are kept for billing purposes, allowing you to track exactly how many characters you have consumed.
Is there a limit to concurrent requests?
Requests are processed one after another, so under load, a request may wait in a queue. The rate limit is 60 requests per minute per key. While there is no explicit concurrency limit, sequential processing means high volume may cause slight delays during peak usage times.
Can I use the API for multiplayer games?
Yes, the API can generate voice lines for multiplayer games. Generate audio files beforehand or on demand. Since audio is returned in the response and not stored, you can integrate these files into your game client. Ensure you manage rate limits to handle multiple players’ requests.
How do I handle multiple languages in one game?
Specify the ISO language code in the request for each voice line. The API supports 23 languages, including English, Spanish, Japanese, and more. Each voice can speak any supported language. Set the language parameter to ensure correct pronunciation and tone for each character’s dialogue.
What is the difference between tts-1 and tts-1-hd?
Both models use the same engine and cost $0.01 per 1,000 characters. They support identical voices, formats, and speed settings. While the API distinguishes them as "tts-1" or "tts-1-hd," the underlying synthesis and billing remain exactly the same. Choose whichever identifier fits your workflow, as there is no functional or quality difference between the two options.
Can I use the API for mobile games?
Yes, the API is suitable for mobile games. Generate audio files and integrate them into your mobile app. Use formats like MP3 or WAV for compatibility. Ensure you handle rate limits and generate audio efficiently to support mobile device performance and network constraints during gameplay.
Why Use API Voice Lines for Games?
Indie developers often face the constraint of limited budgets when aiming for professional audio quality. Hiring a full voice cast for every character can quickly drain resources, especially during early development stages. Our API offers a cost-effective alternative, allowing you to generate distinct voice lines for multiple characters without the overhead of studio time or talent fees.
Cost Efficiency
With pricing at $10 per 1 million characters, you only pay for what you use. There are no monthly plans, seats, or minimum spend requirements. Failed requests are free, ensuring you don’t pay for errors. This model fits perfectly for freelancers managing tight indie budgets.
- $0.01 per 1,000 characters
- No monthly plans or subscriptions
- Free failed requests
Rapid Prototyping
Speed is critical when iterating on game mechanics. You can generate voice lines in seconds, allowing you to test dialogue flow and character reactions instantly. This rapid turnaround helps you refine scripts before committing to final production assets.
- Generate audio in seconds
- Iterate on dialogue quickly
- Test character reactions instantly
Scalability
As your game grows, so does your cast. Our API handles multiple voices and languages seamlessly. You can scale from a few characters to dozens without changing your workflow. The 8 distinct presets ensure consistent quality across your entire project.
- Supports 8 distinct voices
- Handles multiple languages
- Consistent quality across projects
Setting Up Your API Key
Setting up your API key starts at the /get-api-key/ page, where you create your independent storefront account. You can sign in using Google or email. Accounts created via email do not receive trial credit, while Google sign-ins grant $0.50 valid for 7 days. This immediate access lets you start testing without waiting for payment processing.
Once registered, you receive one active API key displayed on your dashboard. You can issue a new key at any time; the old one stops immediately. This ensures clean security management as you move from prototyping to production for your indie game voice lines.
Google Sign-In Process
Visit /get-api-key/ and select the Google sign-in option. Your account is created instantly on this site’s independent storefront. Note that only Google sign-ins include the $0.50 free trial credit (valid for 7 days). Email-based accounts start with zero balance.
The process is straightforward: authorize the site, and you are logged in. No email verification delays occur. You are ready to generate your first key immediately after authentication.
- Google sign-in grants $0.50 trial credit
- Email sign-in has no trial credit
- Instant account creation on /get-api-key/
- No email verification delays
Key Retrieval
Your API key appears on the dashboard alongside your balance and usage stats. It starts with tts-. Copy this key to use in your requests. The key is tied to your account on this specific site.
You can generate a new key at any time. When you issue a new key, the previous one becomes invalid instantly. This is useful if you suspect exposure or want to rotate credentials between development and production environments.
- Keys start with
tts- - One active key per account
- New keys invalidate old ones instantly
- View key on dashboard
Security Best Practices
Treat your API key like a password. Pass it in the Authorization: Bearer header. Do not hardcode it in publicly accessible client-side game builds. Use server-side proxies if your game fetches audio directly from the browser.
Rate limits apply per key: 60 requests per minute (10 before top-up). Monitor your usage on the dashboard to avoid throttling. If you lose access or suspect a leak, issue a new key immediately to revoke the old one.
- Use
Authorization: Bearerheader - Avoid client-side exposure
- Issue new keys to revoke old ones
- Monitor usage on dashboard

Choosing the Right Voice
Selecting the correct voice preset ensures your characters sound distinct and consistent throughout the game. With eight specific presets available, you can map each role to a unique vocal identity, from the warm narration of Aria to the deep documentary tone of Orion.
Matching Tone to Character
Each voice has a defined personality: Aria offers a clear narrator style, while Sage provides calm, instructional tones suitable for tutorials. For energetic promo lines, Felix works well, whereas Milio’s conversational style suits casual dialogue. Use Atlas for neutral news-style lines or Orion for deeper, serious moments.
Testing Preset Voices
Generate short samples using the API to verify fit before committing to full scripts. Since voices are based on licensed recordings, they offer consistent quality across 23 languages. Remember that any voice can speak any supported language, so you can test cross-lingual consistency easily.
Consistency Across Scenes
Maintain the same voice ID for each character to ensure audio continuity. If a character speaks in multiple languages, use the language parameter to guide pronunciation without changing the voice preset. This approach keeps your audio assets organized and recognizable to players.
Sending Your First Request
Generating voice lines is straightforward: send a POST request to the API endpoint with your text and configuration. You can use the official OpenAI SDKs by changing the base_url to https://api.tkb399thai.com/v1, or use plain HTTP. This ensures compatibility without learning a new protocol.
Each request converts up to 4096 characters of text into audio. The API returns an audio file in your chosen format, ready for immediate integration into your game engine. Failed requests are free, so you can test freely.
Curl Example
Use this command to generate a speech file. Replace YOUR_API_KEY with your key from the dashboard.
`curl -X POST https://api.tkb399thai.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`
JSON Body Construction
The request body is JSON. Required fields are model (e.g., tts-1 or tts-1-hd), input (text up to 4096 characters), and voice (one of 8 presets). Optional fields include response_format (mp3, wav, opus, flac, pcm), speed (0.25–4.0), and language (ISO code).
Set language for non-English Latin text to ensure correct pronunciation. If omitted, the API guesses the language, defaulting to English for Latin scripts.
Handling Responses
On success, the response contains the audio file binary. Save it directly to your project assets. The API processes requests sequentially, so under load, there may be a queue.
If the request fails, the response indicates the error, and no charge is applied. Always check the HTTP status code and handle errors gracefully in your script.
Handling Long Dialogues
When your character’s dialogue exceeds 4,096 characters, you must split the input text into smaller chunks. This ensures each request stays within the API’s strict input limit, preventing errors and ensuring consistent synthesis quality across your entire script.
The API does not automatically handle multi-chunk audio stitching. You need to process each segment individually and then join the resulting audio files in your preferred order to create a seamless voice line for your game.
Splitting Text into Chunks
Break your script into segments of up to 4,096 characters each. Ensure you split at natural sentence boundaries where possible to avoid awkward pauses in the generated speech.
Remember that spaces and punctuation count toward the character limit, so plan your splits carefully to maximize usable text per request.
- Max 4,096 characters per request
- Count spaces and punctuation
- Split at natural breaks
Joining Audio Files
Since the API returns individual audio files for each chunk, you will need to concatenate them in your game engine or post-production workflow. Most engines allow you to chain audio clips seamlessly.
Maintain the correct order of chunks to preserve the narrative flow of your dialogue without audible gaps.
Managing Character Limits
Strictly adhere to the 4,096-character limit to avoid request failures. If you exceed this, the API will reject the input, and you will not be charged, but you will need to retry with corrected chunks.
Keep track of your character count as you prepare scripts to ensure efficient use of your API credits.
Optimizing for Game Engines
Game developers need reliable audio assets that balance quality with performance. Choosing the right format ensures your voice lines load quickly without sacrificing clarity or draining resources unnecessarily during gameplay.
The API supports multiple output formats, allowing you to select the optimal file type for your specific engine requirements. Understanding these differences helps streamline your asset pipeline.
Choosing MP3 vs WAV
MP3 offers high compression with good quality, ideal for reducing download sizes and storage usage. WAV provides a standard container format that is widely supported across engines. Choose based on whether you prioritize smaller file sizes or broader compatibility.
Note that WAV is a container format and does not inherently guarantee uncompressed PCM data, though it is commonly used for that purpose. PCM is also available directly if you need raw, uncompressed samples.
- MP3: Best for storage efficiency.
- WAV: Widely supported container.
- PCM: Raw uncompressed data.
- Opus/FLAC: Alternative high-compression options.
Loading Audio at Runtime
Load audio assets asynchronously to prevent frame drops when spawning characters. Ensure your engine can handle the specific format returned by the API without complex decoding steps.
Test loading times with actual voice files to verify they integrate smoothly into your scene transitions and dialogue systems.
- Use async loaders.
- Pre-load common lines.
- Test format compatibility.
Memory Management
Dispose of audio objects after playback to prevent memory leaks, especially in scenes with frequent dialogue. Monitor memory usage during prolonged play sessions to ensure stability.
Cache frequently used voice lines to avoid re-downloading or re-generating the same audio clips repeatedly.
- Unload unused assets.
- Cache frequent lines.
- Monitor memory usage.
Debugging Common Issues
Debugging audio generation issues in your game pipeline is straightforward once you understand the API’s constraints. Since requests are processed sequentially, high concurrency can lead to queuing delays, but failed synthesis attempts are fully refunded and do not consume your character balance or rate limit quota.
Rate Limit Errors
The API enforces a limit of 60 requests per minute per key (10 per minute before your first top-up). If you exceed this threshold, you will receive a rate limit error. Since requests are processed one after another, your synthesis may also wait in a queue under load, causing perceived delays without exceeding the hard limit.
Invalid Voice IDs
Ensure you are using one of the eight supported presets: aria, nova, luna, sage, felix, milo, atlas, or orion. If you send an unknown voice ID, the request will fail, but the charge is returned in full. Always verify your voice list against the /v1/voices endpoint before generating large batches.
Network Timeouts
Short phrases may take a few seconds to generate, while longer texts process at roughly real-time speed (25 characters per second). If your game engine times out before the audio file arrives, increase your client-side timeout duration. Unlike some services, we do not offer a live server status dashboard, so rely on response codes to diagnose connectivity issues.

Testing Your Voice Lines
Testing your voice lines ensures your characters sound consistent and fit the scene’s pacing. Since the API returns complete audio files rather than streaming data, you must download the full file before syncing it with your animation timeline.
Start by listening for natural pauses and emotional tone. Verify that the voice matches the character’s personality across different scenes to maintain immersion for players.
Quality Checks
Listen to the generated audio for clarity and tone consistency. Check that the synthetic watermark doesn’t interfere with dialogue clarity. Verify that the speech rate (0.25–4.0) matches the character’s energy level.
Ensure the input text stays within the 4096-character limit. If a line is too long, split it manually to avoid truncation or awkward pauses in the generated audio.
- Check audio clarity and tone consistency.
- Verify synthetic watermark presence.
- Ensure text stays under 4096 characters.
- Adjust speed parameter (0.25–4.0) for energy match.
Syncing with Animation
Since the API does not support streaming or real-time partial audio, you must download the complete file before playback. Import the audio into your game engine and align the waveform with your character’s lip movements or sprite animations.
Use the audio’s duration to adjust animation timing. If the speech is too fast or slow, adjust the speed parameter in your next request and regenerate the line.
- Download full audio file before syncing.
- Align waveform with character animation.
- Adjust animation timing to match audio duration.
- Regenerate with adjusted
speedif needed.
User Feedback Loops
Share test builds with playtesters to gather feedback on voice delivery. Ask specific questions about whether the tone matches the character’s intended personality and if the pacing feels natural during gameplay.
Use this feedback to tweak voice selection or speed settings. Iterate on the voice lines until they meet your creative vision and player expectations.
- Gather playtester feedback on tone and pacing.
- Ask specific questions about character match.
- Tweak voice selection or speed settings.
- Iterate until creative vision is met.
Scaling Your Production
Scaling your indie game production means handling dozens of characters without manual bottlenecks. Since requests are processed sequentially server-side, parallel client requests may queue, but bulk strategies still streamline your pipeline. Focus on automating the split of long dialogues and the joining of audio files to maintain consistency across scenes.
Efficient scaling relies on consistent voice selection and clear character management. By standardizing which voice ID maps to each character, you ensure tonal consistency even when generating lines out of order. This approach helps freelancers manage assets without hiring full voice casts.
Bulk Generation Strategies
To handle large scripts, split texts into chunks of up to 4096 characters. Use the API’s single-request limit to generate these parts independently, then join the resulting audio files. This ensures no character limit is breached while keeping the workflow simple.
Since requests are processed one after another, under load a request may wait in a queue. Sending multiple requests in parallel from your client side is possible, but be aware they will be queued server-side. This sequential processing means overall generation time depends on queue depth, not just parallelism.
- Split text into 4096-character max chunks.
- Generate parts independently.
- Join audio files client-side.
Managing Multiple Characters
Assign a specific voice ID to each character to maintain consistency. For example, use 'atlas' for news-style narrators or 'nova' for upbeat protagonists. This prevents tonal shifts when generating lines out of sequence.
With 8 distinct voices across 23 languages, you can cover diverse cast needs without hiring multiple actors. Keep a mapping document linking character names to voice presets for easy reference during bulk generation.
- Map characters to specific voice IDs.
- Use 8 distinct voices.
- Cover 23 languages.
Automating Workflows
Integrate the API into your game engine’s asset pipeline. Use scripts to read character dialogue files and send POST requests to the speech endpoint. This reduces manual steps and allows for rapid iteration during prototyping.
Automate the handling of responses. If synthesis fails, the charge is returned, so build retry logic into your script. Monitor usage to avoid hitting the 60 requests per minute limit per key.
- Integrate API into asset pipeline.
- Automate dialogue file reading.
- Build retry logic for failures.
Cost Management Tips
Keep your indie game production running smoothly by keeping a close eye on your usage metrics. The dashboard shows exactly how many characters you have left and your current balance, so you never face a silent cutoff mid-sprint.
Monitoring Usage
Check your balance regularly via the /get-api-key/ dashboard. Since charges are based on character count, tracking your progress helps you plan voice line batches accurately without overspending.
Top-Up Strategies
When your balance runs low, top up with USDT on the TRON network (TRC-20). Payments are credited automatically within minutes, ensuring your voice generation pipeline never stops due to a lack of funds.
Avoiding Waste
Failed synthesis requests are fully refunded, so you can experiment freely. However, remember that every character counts toward your limit, including spaces. Plan your text chunks carefully to maximize your $0.01 per 1,000 characters budget.
Finalizing Your Game Audio
Once your voice lines are generated, you have full control over the final audio quality since our API returns raw files without built-in effects. You can add reverb, EQ, or noise reduction in your preferred DAW to match the game’s atmosphere. This approach ensures consistent character voices while allowing flexible post-production for each scene.
Post-Processing Options
Our API provides clean, watermark-marked audio files that serve as a solid foundation for your sound design. Since we do not offer built-in SSML or emotion tags, your post-processing workflow handles all nuance. You can layer voices with sound effects or adjust timing manually in your editor.
- Import raw MP3 or WAV files into Audacity, Reaper, or Pro Tools.
- Apply EQ and compression to match the game’s acoustic environment.
- Add subtle reverb to simulate indoor vs. outdoor settings.
Integration with BGM
Mix your generated voice lines with background music by adjusting volume levels and frequency ranges. Ensure the voices remain clear against the BGM by cutting low-end frequencies from the music track where necessary. This balance keeps dialogue intelligible during gameplay.
- Sidechain BGM to duck volume during speech.
- Use high-pass filters on music to avoid muddying vocals.
- Maintain consistent volume levels across all scenes for a polished feel.
Exporting Assets
Export your final mixed audio in formats compatible with your game engine, such as OGG or WAV. Keep a library of unused lines for future patches or DLC content. Organize files by character and scene to streamline your development pipeline.
- Use OGG for smaller file sizes in Unity or Godot.
- Store high-quality WAV backups for master audio.
- Name files consistently using character ID and scene number.

Next Steps for Developers
As you refine your indie game’s audio pipeline, you have plenty of room to experiment. The API supports eight distinct voices, allowing you to cast multiple characters without hiring a full voice cast. You can also swap between MP3, WAV, Opus, FLAC, and PCM to match your engine’s specific loading and compression needs.
Explore More Voices
Each of the eight presets offers a unique tone, from Aria’s warm narration to Felix’s energetic promo style. Since every voice can speak all 23 supported languages, you can maintain character consistency across localized versions of your game without needing separate voice actors for each region.
- Aria for clear narration
- Felix for energetic promos
- Atlas for neutral news-style lines
- Orion for deep documentary tones
Try Different Formats
Choose MP3 for balanced file size and quality, or WAV for lossless accuracy. For more specific compression or lossless requirements, Opus and FLAC are also available. PCM is an option for raw data processing if your engine prefers uncompressed streams.
- MP3: Balanced compression
- WAV: Lossless quality
- Opus: High efficiency
- FLAC: Lossless compression
- PCM: Raw data
Read Full Documentation
For detailed endpoint structures, rate limits, and authentication headers, visit our docs page. The documentation includes ready-to-use curl examples and explains how to handle character limits by splitting text into 4096-character chunks.
You can also check /get-api-key/ to retrieve your key and monitor your balance. Keep your key secure and rotate it if needed, as a new key instantly invalidates the old one.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Capturing your unique style with fluid motion brings freelance animation dreams to life for every client.
23 languages
Any voice speaks any of these languages.
