Generate Audio with Our Text-to-Speech API

By Toonify editorial team · Updated 2026-11-18

This guide helps animation creators and cartoonists generate professional voice-overs for their animated content using our simple, OpenAI SDK-compatible API. You will learn how to convert text into high-quality audio files quickly, leveraging 8 expressive voices and 23 languages without hiring voice actors.

We cover the complete workflow, from obtaining your API key to making your first request. You will find clear examples for configuring voices, handling limits, and integrating with existing tools, ensuring you can power your cartoon projects with synthetic speech.

Generate Audio with Our Text-to-Speech API

Frequently asked questions

What is the endpoint for speech synthesis?

Send a POST request to https://api.wk77apk.com/v1/audio/speech. The JSON body mirrors the OpenAI speech endpoint structure, allowing you to specify the model, input text, voice, response format, and speed parameters in a single request.

How do I set the language for non-English text?

Include the optional 'language' field with the ISO code in your request body. If omitted, the system guesses the language, defaulting to English for Latin script. Explicitly setting it ensures accurate pronunciation for non-English languages like French or German.

Can I use the OpenAI SDK with your API?

Yes, the request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.wk77apk.com/v1 and providing your site-specific API key in the Authorization header.

What is the maximum text length per request?

Each request supports up to 4096 characters of input text. For longer scripts, split your text into parts of this size and join the resulting audio files to create a complete voice-over for your animation.

How do I handle rate limits in my script?

The limit is 60 requests per minute per key (10 before the first top-up). Implement exponential backoff or queuing in your script to handle delays, as requests are processed sequentially and may wait in a queue under load.

Does the API support streaming audio?

No, the API does not support streaming, WebSocket, or real-time partial audio. It returns the complete audio file in the response after synthesis is finished, which typically takes time proportional to the text length.

What happens if I exceed the character limit?

The API accepts up to 4096 characters per request. If your text exceeds this, you must split it into smaller chunks yourself. Each chunk generates a separate audio file that you can concatenate later.

How do I regenerate a failed request?

Simply resend the same POST request with the same parameters. Failed requests are free, so there is no cost penalty for retrying. The system will process the text again and return a new audio file.

Is there a limit on requests per minute?

Yes, you are limited to 60 requests per minute per API key. Before your first top-up, this limit is 10 requests per minute. Exceeding this may result in temporary delays as requests queue up.

Can I change my API key if it leaks?

Yes, you can issue a new key at any time from your account dashboard. When you generate a new key, the old one stops working immediately, ensuring your leaked key can no longer be used.

What audio formats are available?

You can choose from mp3, wav, opus, flac, and pcm formats by setting the 'response_format' field. These options allow you to select the best balance between quality and file size for your animation project.

How do I specify a different speed?

Use the 'speed' parameter in your request body, accepting values between 0.25 and 4.0. This allows you to adjust the pacing of the voice-over to match the timing and mood of your animated scenes.

Does the API support SSML tags?

No, the API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You control pacing and emphasis primarily through the speed parameter and by structuring your input text with appropriate punctuation and line breaks.

How do I detect the language automatically?

If you do not specify the 'language' field, the system guesses the language from the script. Latin script text defaults to English, so you must explicitly set the language for non-English Latin-script text to ensure accuracy.

First request

curl

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

Python (openai)

from openai import OpenAI

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

Get Your API Key

Sound wave illustration for: Get Your API Key

To kickstart your animation voice-over workflow, head to the /get-api-key/ page to create your account. This is the first step in accessing the Toonify TTS API, which powers professional audio generation for cartoonists and content creators without the need to hire voice actors.

Sign up on the /get-api-key/ page

Sign up on the /get-api-key/ page

Visit the dedicated registration page to initialize your API access. Creating an account here grants you the credentials needed to start generating audio files via our endpoint.

Use Google or email authentication

Use Google or email authentication

You can authenticate securely using either Google or an email and password combination. Accounts created via email start without trial credit, while Google sign-ins include a $0.50 free trial valid for 7 days, giving you immediate capacity to test our 8 expressive voices.

Copy your Bearer token from dashboard

Once registered, navigate to your dashboard to view your unique API key. Copy this token, as you will need it to authorize your API requests. This key is the single active credential for your account, allowing you to generate audio for your animated projects.

Make Your First Request

Sound wave illustration for: Make Your First Request

Send a POST request to https://api.wk77apk.com/v1/audio/speech with a JSON body containing your text, selected voice, and model. This endpoint processes your input and returns the synthesized audio file directly in the response.

Use POST method to /v1/audio/speech

Direct your HTTP client to the speech endpoint using the POST method. The API accepts standard JSON payloads, making it easy to integrate into your existing animation pipelines or content generation scripts.

Include model, input, and voice parameters

Specify the model as either tts-1 or tts-1-hd. Provide your script in the input field (max 4096 characters) and select one of the 8 expressive voices like aria or nova. You may also set a language code if the script is not English.

  • model: 'tts-1' or 'tts-1-hd'
  • input: your text string
  • voice: e.g., 'nova', 'atlas'

Receive audio file in response

Upon successful processing, the API returns the audio file directly. Supported formats include MP3, WAV, Opus, FLAC, and PCM. Failed requests are free, ensuring you only pay for usable audio.

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

The API supports multiple audio formats to suit different production workflows, from web playback to professional editing. Each format balances file size, quality, and compatibility for your animation projects.

Choose the format that best fits your delivery pipeline. All generated audio files are returned directly in the API response, ready for immediate use in your content creation process.

MP3 for web streaming and uploads

MP3 is a common choice for web-based animations and social media uploads. It offers excellent compression while maintaining clear audio quality, ensuring your voice-overs load quickly on any platform.

Use MP3 when you need small file sizes without sacrificing intelligibility. It is widely supported by modern browsers and video editing software.

  • Universal compatibility across web players
  • Optimized file size for fast uploads
  • Clear audio for voice-over narration

WAV for high-quality editing

WAV provides uncompressed, high-fidelity audio suitable for professional post-production. Use this format if you plan to apply effects, equalization, or noise reduction in your editing suite.

The raw audio data ensures no quality loss during multiple edits. It is a common choice for animators who need high-quality sound tracks for final render.

  • Uncompressed high-quality audio
  • Ideal for professional editing workflows
  • No quality loss during processing

FLAC and Opus for specific needs

FLAC offers lossless compression, preserving every detail of the synthetic voice while reducing file size compared to WAV. Use it for archival purposes or when storage is a concern but quality is paramount.

Opus provides efficient compression with good quality, suitable for real-time applications or bandwidth-constrained environments. It is less common but valuable for specific technical integrations.

  • FLAC: Lossless compression for archival
  • Opus: Efficient bandwidth usage
  • Support for niche technical requirements

Configure Voice and Speed

Sound wave illustration for: Configure Voice and Speed

Choose from eight expressive voices designed for animation, ranging from the warm narration of Aria to the deep documentary tone of Orion. Each voice is based on licensed recordings, ensuring consistent quality across your projects without needing to hire multiple actors.

Adjust the playback speed between 0.25x and 4.0x to perfectly match your animation’s timing. This flexibility allows you to create energetic promos with Felix or calm storytelling with Luna, ensuring the audio syncs precisely with your visual cues.

Select from 8 preset voices

Our API offers eight distinct voice presets tailored for different cartoon styles. You can select Aria for clear narration, Nova for upbeat scenes, Luna for soft storytelling, or Sage for instructional content. Male options include Felix for energetic promos, Milo for conversational tones, Atlas for neutral news, and Orion for deep documentary styles.

All voices support natural intonation and are ready to use immediately via the API. There is no need for custom voice design or cloning; simply pick the preset that fits your character’s personality and start generating audio.

  • Female: Aria, Nova, Luna, Sage
  • Male: Felix, Milo, Atlas, Orion
  • All voices support all 23 languages
  • Based on licensed LibriTTS-R recordings

Adjust speed between 0.25 and 4.0

The speed parameter allows precise control over audio duration, ranging from 0.25 to 4.0 times the normal rate. This is essential for syncing voiceovers with specific animation frames or adjusting pacing for comedic effect.

Slower speeds enhance clarity for complex dialogue, while faster speeds create urgency or excitement. The API processes requests sequentially, so longer texts at high speeds may queue, but short phrases generate quickly.

  • Range: 0.25 to 4.0
  • Syncs with animation timing
  • Adjusts for comedic or urgent tones

Set language code for non-English text

While the API guesses language from script, explicitly setting the language parameter ensures accuracy for non-English Latin-script text. Supported languages include Arabic, Chinese, French, German, Hindi, Japanese, Korean, Spanish, and 17 others.

Any of the eight voices can speak any of the 23 supported languages, allowing you to dub characters consistently across different regions. Unsupported languages like Vietnamese or Thai will not synthesize correctly.

This flexibility enables global content creation without needing separate voice actors for each language, streamlining your production workflow for international audiences.

  • 23 supported languages
  • Any voice speaks any language
  • Set language for non-English Latin text
  • Not supported: Vietnamese, Indonesian, Thai

Handle Errors and Limits

Sound wave illustration for: Handle Errors and Limits

To ensure reliable generation, your API key is limited to 60 requests per minute. New accounts start with a lower limit of 10 requests per minute until the first top-up is processed. This allows you to test integration without immediate throttling.

Rate limit of 60 requests per minute

The rate limit resets every minute. If you exceed this threshold, the API returns a 429 error. You can monitor your usage directly on the dashboard after signing in.

Text limit of 4096 characters per call

Each API request accepts a maximum of 4,096 characters for the input text. Spaces and punctuation count toward this limit. If your script exceeds this, the request will fail.

Split long texts into chunks manually

For longer scripts, split your text into parts of up to 4,096 characters. Generate audio for each chunk separately, then join the resulting files to create your final animation voice-over.

Handle Errors and Limits

Use OpenAI SDK with Us

Sound wave illustration for: Use OpenAI SDK with Us

Leverage your existing animation pipelines by simply redirecting the OpenAI SDK to our endpoint. This allows you to generate voice-overs for cartoons without rewriting your integration logic.

Change base_url to our API endpoint

Update your SDK configuration to point to https://api.wk77apk.com/v1. This single change routes all speech requests to our infrastructure while maintaining the standard request shape.

Use official OpenAI SDKs seamlessly

The API mirrors the OpenAI speech structure, so standard libraries work out of the box. You can continue using your preferred language SDKs without learning a new client.

Replace your API key with ours

Swap your OpenAI key for your unique tts-... token in the Authorization header. This key is specific to your account and enables access to our eight expressive voices.

Authentication Details

Sound wave illustration for: Authentication Details

Authentication secures your API access using a single Bearer token. Pass this token in the Authorization header of every request to verify your account and track usage against your balance.

Pass token in Authorization header

Include the header Authorization: Bearer <token> in all HTTP requests. This ensures the API recognizes your account for billing and rate limit tracking.

Format: Bearer tts-<your-key>

Your key starts with tts-. The full header value is Bearer tts-<your-key>. Ensure no extra spaces or quotes are included in the token string.

One active key per account

Each account holds one active key. Issuing a new key immediately invalidates the previous one. Revoke or replace keys anytime via the dashboard.

Test with Curl Example

Sound wave illustration for: Test with Curl Example

This section provides a practical, ready-to-use cURL command to generate your first audio file. It demonstrates the exact request shape required by the API, ensuring you can immediately verify your API key and integration setup without writing additional code.

The example uses the tts-1 model with the nova voice, generating a short English phrase. This concrete starting point helps animation creators quickly test voice quality and format options.

Copy ready-to-use curl command

Use this command to send a simple text request to the API. It includes the necessary headers and JSON body structure for immediate testing.

```bash curl -X POST https://api.wk77apk.com/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello, world! This is a test.", "voice": "nova", "response_format": "mp3"}' \ --output speech.mp3 ```

Replace YOUR_API_KEY placeholder

Before running the command, replace YOUR_API_KEY with the actual Bearer token from your dashboard. Ensure the key starts with tts- and is active. This token authenticates your request and tracks usage against your balance.

If you are using the OpenAI SDK, set base_url to https://api.wk77apk.com/v1 and pass the same key. The request structure remains identical, allowing seamless integration into existing workflows.

Download generated audio file

The --output speech.mp3 flag saves the response directly to your local file system. This MP3 file can be immediately imported into your animation software or video editor. For higher quality, change response_format to wav or flac in the JSON body.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Since the same voice preset is used across all supported languages, your audience will recognize the character's tone and timbre regardless of the language.

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. MDN: Web Speech API
  3. LibriTTS-R corpus (OpenSLR 141)
  4. LibriTTS-R paper (arXiv 2305.18802)
  5. OpenAI API reference: create speech
  6. openai-node on GitHub
  7. TRON developer hub: TRC-20
  8. openai-python on GitHub
  9. Tether (USDT)
  10. LibriVox public-domain audiobooks
  11. W3C WAI: making audio and video accessible
  12. Node.js documentation

More on this site