How to Generate Anime Voice Lines with API

By ToonVox editorial team · Updated 2026-11-19

This guide shows animation studios and game developers how to generate consistent anime voice lines using the ToonVox API. You will learn to convert scripts into high-quality audio files that integrate directly into your production pipeline. We cover everything from selecting the right voice preset to handling Japanese and international languages accurately.

You will see exactly how to structure your JSON requests, adjust speed for pacing, and manage batch processing for long dialogues. Perfect for teams needing reliable, programmable voice synthesis without extra overhead.

How to Generate Anime Voice Lines with API

Frequently asked questions

What is the best way to format text for anime voices?

Keep text under 4096 characters per request. The API accepts standard text inputs without requiring SSML or phoneme dictionaries. You can control tone using specific voice presets like Aria or Felix. Since custom pronunciation lexicons are not supported, ensure spelling matches the intended pronunciation. Spaces and punctuation count toward the character limit, so concise scripting helps manage costs and generation time effectively.

How do I ensure the voice sounds natural in Japanese?

Explicitly set the language parameter to 'ja' in your JSON body. If omitted, Latin script defaults to English, which may cause mispronunciation for Japanese text. All eight voices support Japanese natively. This ensures the engine applies correct phonemes and intonation patterns specific to Japanese dialogue, avoiding the default English fallback behavior.

Can I generate voice lines for multiple characters at once?

No, each request generates audio for a single voice preset. To create multi-character scenes, send separate POST requests for each character using different voice IDs like Nova for one character and Atlas for another. You can then sync these audio files in your animation software. The API processes requests sequentially, so batch them efficiently.

What is the recommended speed for anime dialogue?

The default speed is 1.0, which provides natural pacing. You can adjust the speed between 0.25 and 4.0 to match specific character traits or scene urgency. For standard anime dialogue, keeping the speed near 1.0 ensures clarity. Higher speeds may reduce intelligibility, while lower speeds can emphasize dramatic pauses without requiring manual editing.

How do I handle long monologues in the API?

Split text into parts of up to 4096 characters and join the resulting audio files. The API does not automatically split long inputs. You must manage the segmentation in your application logic. This ensures each request stays within limits and generates high-quality audio chunks that you can concatenate for the final monologue.

Do I need to split text manually or does the API do it?

You must split text manually. The API accepts up to 4096 characters per request and does not handle segmentation internally. Your code should divide longer scripts into chunks, send each as a separate POST request, and then concatenate the returned audio files to create the complete voice line for your animation project.

How do I check if the language detection is correct?

Verify by setting the language parameter explicitly. If you omit it, Latin script defaults to English. For Japanese or other non-English text, always specify the ISO code. This prevents the engine from guessing incorrectly. You can also test with short phrases to confirm pronunciation matches your expectations before processing full scenes.

What is the difference between TTS-1 and TTS-1-HD?

Both models use the same engine and have identical pricing. TTS-1-HD offers higher audio quality but costs the same as TTS-1. You can choose either based on your production needs. The choice does not affect character limits, speed, or voice presets. Use TTS-1-HD for critical scenes where audio fidelity is paramount.

Can I use the API for voiceovers in animated shorts?

Yes, the API is ideal for animated shorts. You can generate voice lines for characters using presets like Luna or Orion. Each request returns an audio file ready for integration. Since input text is not used for training, your script content remains private. The generated audio carries an inaudible synthetic watermark for identification.

How do I integrate the audio files into Unity?

Download the generated audio file from the API response and import it into Unity as an AudioClip. Support formats include MP3, WAV, OPUS, FLAC, and PCM. You can trigger playback via C# scripts by loading the clip into an AudioSource component. This allows integration into your game engine’s audio system.

What is the maximum request size per minute?

You are limited to 60 requests per minute per API key. Before your first top-up, this limit is 10 requests per minute. Exceeding the limit may result in delays as requests are processed sequentially. Monitor your usage via the dashboard to ensure smooth production workflows without hitting rate limits during busy rendering periods.

How do I troubleshoot a failed synthesis request?

Check the API response for error codes. Failed requests are free, so no charge is applied. Verify your input text is under 4096 characters and the voice ID is valid. Ensure your authorization header is correct. If issues persist, review the request metadata and character count. Support is available via email for further assistance with persistent errors.

Is the API suitable for high-volume game production?

Yes, with proper rate limit management. You can generate thousands of voice lines by batching requests within the 60-per-minute limit. Use TTS-1 or TTS-1-HD for consistent quality. Since balances do not expire and top-ups are instant via USDT, you can maintain continuous production without worrying about monthly plan constraints or minimum spend requirements.

Do I need to convert the audio format after generation?

No, you can request the format directly in your API call. Choose from MP3, WAV, OPUS, FLAC, or PCM. This eliminates the need for post-generation conversion tools. Select the format that best fits your animation pipeline’s requirements. The API returns the audio file in your chosen format, ready for immediate use in your project.

Understanding the Input Text

Sound wave illustration for: Understanding the Input Text

Generating anime voice lines starts with precise input text. Each API request accepts up to 4,096 characters, including spaces and punctuation. For scripts exceeding this limit, split the text into manageable chunks and join the resulting audio files later in your pipeline. This ensures consistent character voices across long dialogues without hitting request constraints.

The API does not support SSML or emphasis tags; pauses are determined by punctuation. Avoid complex markdown; use simple plain text. Short phrases may take a few seconds to generate, while longer texts approach real-time speed. Plan your batch processing to accommodate these processing times during production.

Character Limits

Each POST request to /v1/audio/speech handles a maximum of 4,096 characters. Exceeding this limit results in an error. For longer monologues or dialogue scenes, segment your script into parts under this threshold. You can then concatenate the audio outputs to create a seamless final clip.

Remember that spaces and punctuation count toward the character limit. A 4,096-character text yields roughly 164 seconds of audio at normal speed (approx. 25 characters per second). Monitor your character usage carefully to avoid unexpected charges or errors during bulk generation.

  • Maximum input: 4,096 characters per request
  • Includes spaces, punctuation, and special characters
  • Longer texts require manual splitting and joining

Script Formatting

Use plain text for your input. The API does not support SSML tags, so avoid HTML or complex formatting. Keep sentences clear and concise to ensure accurate pronunciation. The engine guesses language from the script, so consistent formatting helps maintain accuracy across different language lines.

For anime voice lines, consider how punctuation affects pacing. Commas and periods create natural pauses. Test your script with a single voice preset first to verify that the text flows well before committing to full production. Adjust line breaks if the audio sounds rushed or disjointed.

Language Detection

The API automatically detects language from the script’s script (e.g., Latin vs. CJK). However, for non-English Latin-script text, explicitly set the language field to avoid misidentification. This is crucial for anime scripts containing mixed languages or loanwords. Supported languages include Japanese, English, Chinese, and 20 others.

If your character speaks a mix of languages, ensure each chunk’s language is correctly specified. The engine supports 23 languages, allowing consistent voice rendering across international productions. Always verify the detected language matches your intended output to prevent accent mismatches in character voices.

Choosing the Right Voice Preset

Sound wave illustration for: Choosing the Right Voice Preset

Choosing the right voice preset is essential for defining your anime characters' identities. ToonVox provides eight distinct presets with specific voice characteristics. Selecting the appropriate voice ensures your dialogue aligns with the character's personality from the first syllable.

You can leverage voices like Aria for warm narration or Nova for upbeat energy. Each voice is designed to convey specific traits, allowing you to create consistent character audio lines without manual editing. The key is matching the voice's inherent tone to your script's emotional core.

Selecting Aria or Nova

Aria offers a warm, clear narration style, ideal for introspective or gentle characters. Nova provides a bright, upbeat tone suitable for energetic or comedic roles. Both are female presets that deliver high clarity and emotional resonance.

When choosing between these, consider the character's age and demeanor. Aria works well for mature or wise figures, while Nova suits youthful or lively personalities. Experimenting with both can help you find the perfect fit for your script.

  • Aria: Warm, clear narrator.
  • Nova: Bright, upbeat tone.
  • Test both presets to see which resonates with your script's tone.

Matching Tone to Character

Match the voice's inherent tone to your character's personality. For example, use Felix for energetic promos or Atlas for neutral news-style lines. Each voice has a distinct flavor that can enhance the storytelling without additional effects.

Consider the genre of your animation. Shonen action might benefit from Felix's energy, while a slice-of-life series could use Luna's soft storytelling tone. Aligning voice with genre ensures consistency across your production pipeline.

  • Felix: Energetic, promo-style.
  • Luna: Soft, storytelling tone.
  • Atlas: Neutral, news-style.

Testing Different Presets

Generate short samples with different voices to evaluate their suitability. Use the API to test how each voice handles your specific script. This iterative process helps you refine your character audio lines before full-scale production.

Keep a log of which voices work best for each character. This reference can streamline future projects and ensure consistency across episodes or game levels. Testing early saves time during the final integration phase.

  • Generate 5-second samples with different voices.
  • Log which voices best match each character's personality.
  • Use these logs to streamline future production workflows.

Configuring Speed and Format

Sound wave illustration for: Configuring Speed and Format

Adjusting the speed parameter (0.25–4.0) allows precise control over pacing, essential for matching character personalities or comedic timing in anime. Faster speeds suit energetic promos, while slower rates enhance dramatic pauses.

Choosing between MP3, WAV, OPUS, FLAC, or PCM depends on your pipeline. WAV offers lossless quality for post-production, while MP3 reduces bandwidth for web delivery. Select the format that balances quality and file size for your specific use case.

Adjusting Speed for Pacing

The speed parameter accepts values from 0.25 to 4.0, enabling fine-tuned control over speech rhythm. For energetic characters like Felix or Nova, speeds around 1.5–2.0 enhance their lively delivery. Conversely, slower speeds (0.75–0.9) suit deep, documentary-style voices like Orion, adding gravity to narration.

  • Use speeds >1.0 for comedic timing or fast-paced dialogue.
  • Reduce speed for emotional or dramatic pauses.
  • Test edge cases (0.25, 4.0) for unnatural but stylized effects.

Choosing MP3 vs WAV

MP3 is ideal for web integration due to its small file size and broad compatibility. WAV provides uncompressed, lossless audio, preferred for post-production editing where quality is paramount. OPUS offers efficient compression for low-bandwidth scenarios, while FLAC preserves quality without loss. PCM is raw data for custom pipelines.

  • MP3: Best for web and mobile apps.
  • WAV: Ideal for editing and mastering.
  • OPUS: Efficient compression format.
  • FLAC: Lossless quality for archives.
  • PCM: Raw data for custom processing.

Optimizing for Game Engines

Game engines like Unity and Unreal prefer specific audio formats. WAV is often used for high-quality sound effects, while MP3 is suitable for background music or less critical dialogue. Ensure your engine supports the chosen format to avoid conversion overhead.

  • Unity: Supports WAV, MP3, OGG.
  • Unreal: Prefers WAV, MP3.
  • Consider platform-specific constraints.

Sending the Request

Sound wave illustration for: Sending the Request

Generating anime voice lines requires precise HTTP requests to the TTS endpoint. You send a JSON payload containing the script, voice selection, and audio settings. The API processes the text and returns the synthesized audio file.

Proper header configuration ensures authentication and data integrity. Use the Bearer token from your account dashboard. The request shape mirrors standard OpenAI compatibility, allowing you to use existing SDKs or simple curl commands for quick tests.

Constructing the JSON Body

Define the model as tts-1 or tts-1-hd. Include your script in the input field, ensuring it stays within the 4096-character limit per request. Select one of the eight voice presets, such as Aria or Nova, and specify the response_format (mp3, wav, opus, flac, or pcm).

Set the speed parameter between 0.25 and 4.0 to match character pacing. If the voice defaults to English, explicitly set the language field using ISO codes for non-English scripts to ensure accurate synthesis.

  • model: "tts-1" or "tts-1-hd"
  • input: Your script text (max 4096 chars)
  • voice: e.g., "aria", "nova"
  • response_format: "mp3", "wav", "opus", "flac", "pcm"
  • speed: 0.25–4.0
  • language: optional ISO code

Setting Headers

Include the Content-Type: application/json header to specify the request body format. Most importantly, add the Authorization: Bearer <your-api-key> header. Replace <your-api-key> with the key issued to your account.

This key authenticates your request and tracks usage against your balance. Ensure the key is active and matches the site domain you are using.

  • Content-Type: application/json
  • Authorization: Bearer tts-...

Executing the POST Request

Send your request to POST https://api.cly88.info/v1/audio/speech. The API processes the request sequentially. Under load, you may experience a queue delay, but typical speed is roughly real-time.

Upon success, the response contains the audio file data. Failed requests incur no charge. Store the audio file locally or pass it directly into your game engine pipeline.

Processing the Response

Sound wave illustration for: Processing the Response

After your POST request completes, the API returns the audio file directly in the response body. Depending on your chosen response_format, this will be binary data (like WAV or FLAC) or a standard audio container (MP3, OPUS, PCM). The HTTP headers provide the content type, allowing your script to correctly identify and save the file without guessing the format.

Receiving Audio Data

The response contains the raw audio bytes. Use your HTTP client’s built-in binary handling to capture this stream directly into memory or a file handle. Ensure your code expects binary output rather than JSON, unless an error occurs. The API does not stream partial audio; you receive the complete file only after synthesis finishes.

  • Check Content-Type header to confirm format (e.g., audio/mp3).
  • Capture binary data, not JSON metadata.
  • Handle large responses by streaming to disk if needed.

Saving Files Locally

Write the received binary data to a file using the extension matching your response_format. For game engines, WAV or PCM is often preferred for lossless quality, while MP3 saves bandwidth. Ensure filenames include unique identifiers to prevent overwriting during batch processing of multiple character lines.

Handling Errors

If synthesis fails (e.g., rate limit exceeded or invalid voice), the API returns a JSON error object with a code and message. Failed requests are free, so no charge applies. Always check the HTTP status code before processing the body. Retry logic should account for the 60 requests/minute limit per key.

  • HTTP 429 indicates rate limit; wait and retry.
  • HTTP 400/500 returns JSON error details.
  • Errors are free; no charge for failed synthesis.

Integrating with Game Engines

Sound wave illustration for: Integrating with Game Engines

ToonVox simplifies voice line generation for animation and game dev pipelines. Use our API to produce consistent character audio via simple HTTP requests, ensuring your dialogue matches the required format and pacing.

Unity Integration Basics

Fetch audio files via POST requests and load them as AudioClip objects. Our API returns MP3 or WAV files compatible with Unity’s standard audio system, allowing direct integration into your character controllers.

  • Supports MP3, WAV, Opus, FLAC, PCM

Unreal Engine Setup

Import generated audio assets into Unreal’s Content Browser. Use the raw PCM or compressed formats to optimize memory usage while maintaining quality for your game’s audio middleware.

  • Direct import to Content Browser

Audio Asset Management

Store generated files locally or in cloud storage. Since requests are processed sequentially, manage your queue to ensure consistent character voices across long dialogue sequences without manual re-recording.

Batch Processing Long Dialogues

Sound wave illustration for: Batch Processing Long Dialogues

When generating full anime episodes, you will quickly exceed the 4,096-character limit per request. ToonVox requires you to split long scripts into manageable segments before synthesis begins. This ensures each chunk is processed efficiently without truncation errors.

The API does not auto-split text; your pipeline must handle the segmentation logic. Once you have your chunks ready, you can submit them sequentially or in parallel, depending on your rate limit capacity, to keep your production schedule on track.

Splitting Text into Chunks

Divide your script into segments of 4,096 characters or fewer. Ensure you split at natural boundaries like sentence endings to avoid cutting mid-phrase. This prevents the TTS engine from producing awkward pauses or incomplete words in the final audio.

Keep track of your chunk indices. If you are generating a dialogue scene, label each chunk clearly so you can reconstruct the timeline accurately later. This is crucial for syncing lip movements in animation or game cutscenes.

  • Limit each input to 4,096 characters.
  • Split at sentence or clause boundaries.
  • Preserve original chunk order.
  • Include metadata tags for scene identification.

Joining Audio Files

Once all chunks are synthesized, you receive individual audio files. Your workflow must concatenate these files in the exact order of your original script. Most game engines and DAWs support seamless joining of MP3 or WAV files.

Use a simple script or audio tool to merge the files. Ensure there are no gaps or overlaps between segments. Consistent formatting (e.g., all WAV 44.1kHz) prevents playback issues in your target engine.

  • Concatenate files in original order.
  • Use consistent audio formats.
  • Remove silence gaps if needed.
  • Verify file integrity before import.

Maintaining Consistency

To keep character voices consistent across chunks, always use the same voice parameter for a specific character. For example, use aria for your protagonist across all her scenes. This ensures tonal uniformity.

If your script spans multiple sessions, track your used characters. Using the same voice preset for the same character maintains the intended emotional tone and pacing, which is vital for anime storytelling.

  • Use the same voice for one character.
  • Track voice assignments per scene.
  • Maintain consistent speed settings.
  • Document voice choices for team reference.
Batch Processing Long Dialogues

Optimizing for Production

Sound wave illustration for: Optimizing for Production

Optimizing your TTS pipeline ensures consistent voice delivery without wasting credits on redundant requests. By caching responses for identical character lines, you reduce latency and keep costs predictable. Monitor your rate limits closely to prevent queue delays during peak production hours.

Caching Responses

Store generated audio files locally or in object storage using a hash of the input text, voice, and speed. This avoids re-synthesizing the same line, saving both time and characters from your balance.

  • Hash text + voice + speed parameters
  • Store MP3/WAV in production asset folder

Monitoring Rate Limits

Your key allows 60 requests per minute. Track your usage via the dashboard to stay under this limit, ensuring your batch jobs process smoothly without hitting the 10 req/min default if you haven't topped up yet.

  • 60 requests/minute limit per key
  • Check dashboard for real-time usage

Automating Workflows

Integrate the API into your CI/CD pipeline to auto-generate voice assets when new dialogue is committed. Use scripts to split long texts and join outputs, keeping your animation studio's production line efficient.

  • Auto-generate on code commit
  • Split and join long dialogues automatically

Common Pitfalls and Solutions

Sound wave illustration for: Common Pitfalls and Solutions

Even with dedicated Japanese voices, the API may misidentify Latin-script text as English if the language field is omitted. This results in unnatural phoneme selection for anime-style dialogue that uses romaji or mixed scripts.

Rate limits and character caps are frequent blockers for production pipelines. Understanding these constraints prevents unexpected delays or silent failures during bulk voice line generation.

Language Mismatch Issues

If you send romaji text without specifying the language, the model defaults to English. For anime scripts using romaji, explicitly set language: "ja" to ensure correct pronunciation. This avoids the robotic English accent on Japanese syllables.

Not all languages are supported. Vietnamese, Thai, and Ukrainian are excluded. Using an unsupported code may result in fallback behavior or poor quality, so verify your script’s language against the 23 supported options before processing.

  • Set language explicitly for romaji or mixed-script scripts.
  • Verify language codes against the 23 supported languages.
  • Avoid assuming Latin script equals English for non-English dialogue.

Speed Limit Exceedances

You are limited to 60 requests per minute. If your pipeline sends too many requests simultaneously, excess requests may queue or fail. Monitor your usage dashboard to stay within this limit.

Failed requests do not consume credits, but they still count toward your rate limit. Ensure your error handling retries correctly without spamming the API, which could temporarily block further requests.

Character Count Errors

Each request is capped at 4096 characters. Exceeding this limit causes the request to fail. Split long dialogues into smaller chunks before sending them to the API.

Spaces and punctuation count as characters. A seemingly short line might exceed the limit if it includes extensive stage directions or detailed descriptions. Always count characters precisely before submission.

Validating Audio Output

Sound wave illustration for: Validating Audio Output

Validating output ensures your anime voice lines meet production standards before integration. Since the service returns a final audio file rather than a stream, you must verify the complete segment for clarity and consistency. This step helps ensure quality before integration.

While the TTS engine delivers high-quality synthetic speech, minor artifacts can occasionally occur during rapid pacing or complex phoneme transitions. Checking these details early prevents costly re-renders later in your pipeline.

Listening for Artifacts

Play back each generated segment at normal speed. Listen for unnatural pauses, clipped words, or robotic intonation that breaks character immersion. If an error occurs, the request is free, so retry immediately.

Pay attention to transitions between sentences. Since texts are split into chunks, ensure there are no abrupt cuts or overlapping audio that might disrupt the flow when joined later.

  • Listen at 1.0x and 1.25x speed
  • Check for abrupt sentence endings
  • Verify no clipping or distortion

Checking Watermarks

All generated files contain an inaudible watermark marking them as synthetic speech. This helps identify assets created by ToonVox if distributed publicly. While invisible to listeners, it serves as a digital signature for your production library.

You do not need to manually verify the watermark for every file, but be aware that it is present in every MP3, WAV, OPUS, FLAC, and PCM output delivered via the API.

Quality Assurance Steps

Run a quick sample test with a complex sentence containing multiple languages or rare phonemes. If the output is clear, proceed with bulk generation for your character lines.

Keep a log of which voice presets work best for specific character types. Consistency in tone is more important than perfection in individual lines. Use the language field to enforce correct pronunciation for non-English lines.

  • Test complex phonemes first
  • Log successful voice presets
  • Enforce language codes for Latin text

Scaling Your Voice Production

Sound wave illustration for: Scaling Your Voice Production

As your anime production scales, managing a single API key may become a bottleneck. Since each account holds only one active key with a 60 requests-per-minute limit, generating large batches of dialogue lines requires careful planning. You can issue a new key at any time to refresh your quota, though the old one stops immediately, so coordinate your workflow to avoid mid-generation interruptions.

Managing Multiple Keys

For high-volume studios, consider creating separate accounts for different projects or voice actors. This allows parallel generation streams without hitting the per-key rate limit. Since accounts are independent, you can distribute the load across multiple keys, ensuring that urgent lines are generated without waiting in the queue for earlier requests to finish.

  • Issue new keys anytime; old keys stop immediately.
  • Create separate accounts for parallel generation streams.
  • Monitor per-key limits to avoid queue delays.

Tracking Usage Costs

Each request costs $0.01 per 1,000 characters, including spaces. Monitor your balance regularly via the dashboard to ensure your production pipeline doesn't stall due to insufficient funds. Failed requests are free, so you can experiment with different voices or speeds without financial risk, but successful generations are charged immediately.

  • $0.01 per 1,000 characters.
  • Failed requests are free.
  • Balance does not expire.

Automating Top-Ups

Top-ups are processed via USDT on the TRON network (TRC-20) with a minimum of $5. While there is no automatic subscription, you can set up simple scripts to monitor your balance and trigger a transfer when credits run low. This ensures continuous voice generation for your animation studio without manual intervention.

  • USDT (TRC-20) only.
  • Minimum top-up: $5.
  • Credits credited within minutes.

Support and Resources

Sound wave illustration for: Support and Resources

ToonVox provides comprehensive documentation to help you integrate our TTS API into your animation and game development pipelines efficiently. Our resources cover all essential endpoints, authentication methods, and formatting guidelines.

Documentation Links

Access the full API reference at /docs/ to explore endpoints, request shapes, and voice presets. The pricing details are available at /pricing/ to help you budget your production costs accurately.

  • Full API Reference
  • Pricing Guide
  • Voice Preset List

Contacting Support

For technical issues or billing questions, reach out via email only. We do not offer phone support or live chat, so please include relevant details like your API key and request IDs for faster resolution.

Community Guides

Explore community-driven tips for integrating ToonVox with Unity and Unreal Engine. These guides share practical workflows for batching dialogue and optimizing audio assets for game engines.

  • Unity Integration Tips
  • Unreal Engine Setup
  • Batching Workflows

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Voice casting in animation and game development demands consistency, but synthetic speech introduces unique challenges.

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 corpus (OpenSLR 141)
  3. openai-python on GitHub
  4. curl documentation
  5. Tether (USDT)
  6. LibriVox public-domain audiobooks
  7. W3C WAI: making audio and video accessible
  8. LibriTTS-R paper (arXiv 2305.18802)
  9. IETF RFC 7845: Ogg Opus
  10. Python documentation
  11. OpenAI API reference: create speech
  12. openai-node on GitHub

More on this site