How to Generate Natural Voice for Children’s Stories with API?

By StoryVoice editorial team · Updated 2026-11-19

This guide shows startups how to use the StoryVoice API to generate clear, expressive audio for children’s books. You will learn to select voices like Luna for storytelling or Sage for educational segments, prepare text under 4096 characters, and send POST requests to produce MP3 or WAV files. The steps cover constructing JSON bodies, handling responses, and optimizing your workflow for efficiency.

Designed for teams building audio versions of fairy tales, this page provides practical, step-by-step instructions. You will see how to split long chapters and manage rate limits using real code examples. By the end, you will know how to integrate the API, monitor usage, and start generating natural-sounding speech for young listeners without needing custom voice cloning or complex infrastructure.

How to Generate Natural Voice for Children’s Stories with API?

Frequently asked questions

What is a natural voice generator?

It is a cloud API that converts text into audio files. You send a POST request with your text and receive an audio file in return. The system uses licensed recordings from LibriTTS-R to generate synthetic speech.

How does TTS work for children's stories?

Send your story text to the /v1/audio/speech endpoint. The API synthesizes the audio using voices like Luna or Aria, optimized for young listeners. You receive the audio file directly in the response, ready to be integrated into your app or website without complex infrastructure.

Which voice is best for fairy tales?

Luna is ideal for storytelling with a soft, narrative tone. Aria offers a warm, clear narrator style suitable for children’s books. Both voices support all 23 languages and can be adjusted with speed settings to match the pacing of your specific story content.

How do I split long texts?

Split your text into parts of up to 4096 characters. Send each part as a separate request to the API. Then, join the resulting audio files in your application. This ensures each request stays within the character limit while maintaining a continuous story experience.

What is the character limit?

Each API request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer stories, divide the text into chunks of this size and process them sequentially, then combine the audio outputs to create the final story file.

Can I use the API in a mobile app?

Yes, you can integrate the API into mobile apps using standard HTTP requests or the OpenAI SDK. Since there is no official mobile SDK, you handle the API calls directly from your app code using standard HTTP or the OpenAI SDK. Ensure you manage your API key securely within your mobile environment.

How do I handle multiple languages?

The API supports 23 languages including English, Spanish, and French. Set the optional 'language' field with an ISO code for non-English Latin text to ensure accurate pronunciation. If omitted, the system guesses the language, defaulting to English for Latin script text.

What is the cost per story?

Pricing is $0.01 per 1,000 characters. For example, a 10,000-character story costs $0.10. Failed requests are free. You pay only for successful synthesis, making it affordable for startups producing multiple audio versions of children’s books and fairy tales efficiently.

Do I need a developer to use this?

A basic understanding of API integration is helpful but not strictly required. You can use the provided curl examples or the OpenAI SDK to send requests. For complex workflows involving text splitting or audio joining, a developer will streamline the integration process effectively.

Is the API reliable for production?

The API processes requests sequentially with a rate limit of 60 requests per minute. Under load, requests may queue. There is no SLA or uptime guarantee, but the service is designed for steady generation. Plan your batch processing to stay within the per-minute limits.

Can I customize the voice speed?

Yes, you can adjust the speed between 0.25 and 4.0. This allows you to slow down narration for younger listeners or speed up content for older audiences. The speed parameter is part of the standard request body sent to the speech endpoint.

What audio formats are best for apps?

You can choose from mp3, wav, opus, flac, or pcm. MP3 is recommended for apps due to its small file size and wide compatibility. OPUS is also efficient for small file sizes. Select the format that best fits your app’s storage and playback requirements.

How do I test the API for free?

Sign in with Google to receive $0.50 in free trial credit, valid for 7 days. This covers about 50,000 characters. You can test voice selection, speed, and format options without entering payment details. Email-based accounts do not receive this trial credit.

Who provides the voice recordings?

Voices are based on licensed recordings from LibriTTS-R, derived from LibriVox public-domain audiobook readings. Each generated file contains an inaudible watermark marking it as synthetic speech. The voices are presets like Aria, Nova, and Luna, optimized for clear and expressive narration.

Understanding natural voice generation

Sound wave illustration for: Understanding natural voice generation

Text-to-speech (TTS) technology converts written text into audible speech using cloud APIs. Instead of hiring voice actors for every project, your system sends a JSON request with your script and receives an audio file. This approach removes the logistical friction of studio booking and editing, allowing you to generate content on demand.

Why it matters for kids' content

Children’s stories rely heavily on expressive delivery to maintain engagement. The API provides eight distinct presets, such as Luna for soft storytelling or Nova for upbeat scenes, ensuring the tone matches the narrative’s mood. Consistent, clear audio helps young listeners follow the plot without distraction.

Benefits of automation

Automation enables rapid iteration. You can test different voice styles or adjust scripts without re-recording. Requests are processed one after another, so under load a request may wait in a queue.

Choosing the right voice

Sound wave illustration for: Choosing the right voice

Selecting the correct voice preset ensures your audio aligns with the narrative tone. Our API offers eight distinct voices, allowing you to maintain consistency across your children’s book library.

Luna for storytelling

Luna provides a soft, storytelling tone ideal for classic fairy tales. Her warm delivery captures the gentle pacing required for bedtime stories, keeping young listeners engaged without overwhelming them with energy.

  • Best for: Narrative chapters, lullabies, and calm scenes.
  • Tone: Soft, warm, and immersive.

Nova for upbeat scenes

Nova delivers a bright, upbeat delivery perfect for active sequences. Use her voice for adventure segments or moments where characters are excited, adding dynamic energy to the audio experience.

  • Best for: Action scenes, cheerful songs, and high-energy dialogue.
  • Tone: Bright, energetic, and lively.

Sage for educational parts

Sage offers a calm, instructional voice suitable for educational interludes. Her clear articulation ensures that moral lessons or informational segments are easy for children to understand and retain.

  • Best for: Moral lessons, educational breaks, and clear instruction.
  • Tone: Calm, clear, and instructive.

Preparing your text

Sound wave illustration for: Preparing your text

Before sending text to the API, ensure each input string does not exceed 4,096 characters. Spaces and punctuation count toward this limit, so even short stories with rich descriptions can hit the cap quickly. Accurate character counting prevents silent truncation and ensures your fairy tale scenes remain intact during synthesis.

Limit to 4096 characters

Each API request accepts a maximum of 4,096 characters. This constraint applies to the entire input field, including spaces, punctuation, and special characters. If your children’s book excerpt exceeds this length, the API will reject the request.

Split long chapters

For longer fairy tales, split your text into chunks of up to 4,096 characters. Generate audio for each chunk separately, then join the resulting audio files. This approach maintains narrative flow while respecting API limits. Use consistent voice settings across chunks to ensure seamless listening experiences for young audiences.

  • Divide text by natural pauses or paragraph breaks.
  • Keep voice and speed settings consistent across all parts.
  • Join audio files sequentially to preserve story continuity.

Handle punctuation

Punctuation directly affects voice pacing and naturalness. Use commas, periods, and ellipses to control rhythm. For children’s stories, clear punctuation helps voices like Luna or Sage deliver expressive storytelling. Avoid excessive exclamation marks, which may cause unnatural emphasis in synthesized speech.

Making the API call

Sound wave illustration for: Making the API call

Generating audio requires a single POST request to the speech endpoint. You send your story text in a JSON body, specifying the model, voice, and desired audio format. The API processes this request and returns the final audio file.

This direct approach fits well with batch processing workflows, allowing you to generate chapters sequentially or in parallel, depending on your rate limit strategy. Ensure your text respects the 4096-character limit per request.

Constructing the JSON body

Include the input text, model (tts-1 or tts-1-hd), voice preset (e.g., luna for storytelling), and response_format. The speed parameter can adjust pacing for young listeners, ranging from 0.25 to 4.0.

  • model: "tts-1" or "tts-1-hd"
  • voice: "luna", "nova", etc.
  • input: string up to 4096 chars
  • response_format: mp3, wav, opus, flac, or pcm

Setting headers

Set the Content-Type to application/json. Most importantly, include your API key in the Authorization header as a Bearer token to authenticate the request and charge your balance correctly.

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

Sending the POST request

Send the request to https://api.mmrvip.info/v1/audio/speech. The response contains the audio file directly. If synthesis fails, you receive an error object, and the charge is returned.

  • Endpoint: POST /v1/audio/speech
  • Response: Audio file or error JSON

Processing the response

Sound wave illustration for: Processing the response

The API returns the synthesized audio directly in the response body as a binary file. You can choose from mp3, wav, opus, flac, or pcm formats depending on your playback needs. This direct delivery means you receive the final audio asset immediately without waiting for a separate download link.

Receiving the audio file

Upon a successful request, the response contains the raw audio data. Ensure your client handles binary streams correctly to preserve audio integrity. The format you specified in the response_format field determines the file type received.

  • Supported formats: mp3, wav, opus, flac, pcm
  • Binary data returned in the response body

Saving the file

Write the received binary data to a local file or your cloud storage. Since generated audio is not stored by the API, you are responsible for keeping the files. Name them clearly, such as story_chapter_1_luna.mp3, to track which voice and chapter they belong to.

Handling errors

If synthesis fails, the API returns an error code and message. Failed requests are free, so no charge is applied to your balance. Always check the HTTP status code and handle network errors gracefully to avoid losing progress in your automation pipeline.

Optimizing for performance

Sound wave illustration for: Optimizing for performance

Performance optimization ensures your children's book API integration runs smoothly without hitting bottlenecks. By understanding rate limits and managing request volumes, you can maintain consistent audio generation speeds even during peak usage periods.

Efficient batching and caching strategies reduce redundant API calls, saving both time and credits.

Managing rate limits

Your API key allows 60 requests per minute once funded, but only 10 per minute initially. Monitor your usage dashboard to avoid throttling during high-volume story generation.

If you exceed limits, requests queue automatically. Adjust your client-side retry logic to handle temporary delays gracefully without losing data.

  • Start with 10 requests/minute until first top-up
  • Upgrade to 60 requests/minute after funding
  • Monitor usage via /get-api-key/ dashboard

Batching requests

Split long texts into 4096-character chunks and process them sequentially. This prevents timeout issues and ensures coherent audio output for each segment.

Combine small audio files server-side to create complete stories. This reduces the number of individual API calls needed for final assembly.

  • Split text into 4096-character segments
  • Process segments sequentially to avoid queue delays
  • Join audio files server-side for final output

Caching results

Store generated audio files locally or in object storage to avoid regenerating identical content. Since input text determines output, duplicate requests for the same text can be served from cache.

Implement a simple hash-based cache keyed on input text and voice parameters. This saves credits and reduces latency for repeated story reads.

  • Cache based on input text hash
  • Store generated MP3/WAV files locally
  • Reduce redundant API calls for repeated content

Testing your integration

Sound wave illustration for: Testing your integration

Testing ensures your integration handles audio generation reliably before scaling. Use the provided curl command to verify connectivity and basic synthesis. This step confirms your API key works and returns valid audio data without wasting credits on broken workflows.

Proper testing prevents common integration errors and ensures consistent output quality for your children’s stories. Focus on verifying file integrity and character limits to maintain smooth operations.

Using the curl example

Copy the ready-made curl command from the dashboard. Replace the placeholder with your actual API key. Send the request to verify connectivity and receive an audio file.

This command demonstrates the correct JSON structure. It confirms your key is active and the endpoint responds as expected.

  • Replace YOUR_API_KEY with your actual key
  • Send the POST request to /v1/audio/speech
  • Check for a valid audio file in response

Verifying audio quality

Listen to the returned audio file. Ensure the voice sounds clear and natural for young listeners. Check that pacing matches your story’s tone.

Verify that the audio format matches your selected response_format. This ensures compatibility with your player or distribution platform.

Checking character counts

Confirm the input text stays within 4096 characters. Each request processes this limit strictly. Exceeding it causes failure.

Count spaces and punctuation. They count toward the limit. Adjust your text splitting logic if needed to stay under the threshold.

Testing your integration

Scaling your solution

Sound wave illustration for: Scaling your solution

As your library of children’s stories grows, you will need a strategy to process multiple audio files efficiently. Since requests are processed sequentially, batching long texts into segments under 4,096 characters helps maintain steady throughput without overwhelming the queue.

Handling multiple stories

Organize your scripts by chapter length. Use the character limit to split larger fairy tales into manageable chunks, then join the resulting audio files. This ensures consistent quality and prevents timeouts during generation.

Managing API keys

Each account holds one active key. If you suspect a leak or need to rotate credentials, you can issue a new key immediately. The old key stops working at once, so update your integration code promptly to avoid downtime.

Monitoring usage

Track your balance and character consumption regularly. Since billing is based on characters processed, keep an eye on your TRC-20 top-ups. Failed requests are free, so verify error responses to avoid unnecessary spending.

  • Check the dashboard for real-time balance updates
  • Review character counts after each batch
  • Monitor key rotation status

Common pitfalls

Sound wave illustration for: Common pitfalls

Even with clear scripts, TTS systems may mispronounce words if the language is ambiguous. Latin-script text defaults to English, so non-English languages like Dutch or Greek require explicit codes. Without this, voices sound unnatural or break mid-sentence.

Another common error is ignoring the 4096-character limit per request. Sending longer chapters without splitting causes failures or truncation. Always chunk your text before sending, and join the resulting audio files to maintain continuity.

Ignoring language codes

If you skip the language field for non-English Latin text, the API guesses English. This leads to awkward pronunciation for words like 'nouveau' or 'straße'. Always specify the ISO code to ensure correct intonation and rhythm for your target audience.

This applies to all 23 supported languages. For example, sending French text without language: 'fr' results in an English accent, which disrupts immersion for young listeners.

  • Set language for any non-English Latin text
  • Default guess is English
  • Prevents awkward pronunciation

Exceeding character limits

Each request accepts up to 4096 characters. Exceeding this limit causes the request to fail silently or truncate, wasting credits. Split your stories into smaller segments before sending them to the API.

Remember that spaces and punctuation count toward the limit. A 5000-character chapter will fail. Use your application logic to chunk text, then concatenate the returned audio files.

  • Limit: 4096 characters
  • Includes spaces and punctuation
  • Split and join audio files

Not handling errors

API requests can fail due to rate limits or temporary issues. If a request fails, the charge is returned, but your app must handle the response correctly. Ignoring error codes leads to missing audio files or broken story sequences.

Always check the HTTP status code. If you receive a 429 (rate limit), wait before retrying. Implementing basic error handling ensures your startup’s audio pipeline remains robust under load.

  • Check HTTP status codes
  • Handle 429 rate limits
  • Verify charge returns on failure

Best practices for startups

Sound wave illustration for: Best practices for startups

Startups should begin with short texts to verify voice quality and integration speed before scaling. This approach helps identify any pacing issues early without consuming excessive credits on large batches.

Utilizing the free trial allows teams to test the API’s performance with zero risk. It provides initial credit to validate workflows, ensuring the solution fits your technical requirements before committing to paid usage.

Start with short texts

Begin with simple, short stories to test voice clarity and timing. This method allows quick iteration on narration style without large character consumption.

Use the free trial

Sign up with Google to receive $0.50 in credit, valid for seven days. This provides approximately 50,000 characters to test the API’s capabilities without financial commitment.

Monitor your balance

Track your usage via the dashboard to avoid unexpected costs. The API charges $0.01 per 1,000 characters, so keeping an eye on your balance ensures predictable spending as you scale your children's book library.

Support and resources

Sound wave illustration for: Support and resources

The API reference documentation provides a complete guide to endpoints, parameters, and error codes, helping you integrate the speech generation service into your children’s book workflow efficiently.

For technical issues or account questions, our support team is available via email only. We do not offer live chat, phone support, or SLA guarantees, so please include your API key and request details in your message for faster resolution.

Documentation link

Visit the /docs/ page for detailed explanations of the /v1/audio/speech endpoint, voice options, and pricing. The docs include ready-to-use cURL examples and SDK instructions for changing the base URL to our API endpoint.

Email support

Send questions to [email protected]. Since we do not host an official community forum or offer phone support, email is our primary channel for assistance. You can reach us at any time, and we aim to respond within one business day.

Community forums

Next steps

Sound wave illustration for: Next steps

Start by creating an account on /get-api-key/ using Google or email. You will receive $0.50 in trial credit, valid for seven days, allowing you to generate approximately 50,000 characters of audio without immediate payment.

Once registered, locate your unique API key on the dashboard. This key authenticates your requests to the StoryVoice API, enabling your startup to begin integrating voice capabilities into your children's content pipeline immediately.

Sign up for an account

Visit the /get-api-key/ page to register using your Google account or email and password. Accounts are specific to this site, and signing up provides instant access to your personal dashboard and usage statistics.

  • Sign up with Google or email
  • Instant access to dashboard
  • Receive $0.50 trial credit

Generate your API key

Your dashboard displays your active API key, which you must include in the Authorization header as Bearer tts-.... You can generate a new key at any time, which instantly invalidates the previous one for security.

  • Copy key from dashboard
  • Use Bearer token format
  • Regenerate key anytime

Build your first story

Use the provided curl example to send a POST request to the speech endpoint. Start with a short text under 4096 characters, selecting a voice like Luna for storytelling, and verify the audio file returns correctly.

  • Use curl example
  • Send POST request
  • Select Luna voice

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. It works well for vocabulary lessons, science explanations, or guided reading exercises where accuracy and clarity outweigh dramatic flair.

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

More on this site