API Documentation for Children’s Story Audio Generation

By StoryVoice editorial team · Updated 2026-11-19

This guide explains how to use the StoryVoice API to generate audio for children’s books and fairy tales. You will find clear instructions for authenticating with a Bearer token, calling the speech endpoint, and handling responses. The documentation covers all available voices, supported languages, and format options so you can integrate TTS into your startup’s workflow efficiently.

Readers will learn how to manage API keys, understand rate limits, and troubleshoot common errors. We include practical code examples in Python and cURL to help you start generating speech quickly. This reference is designed for developers building audio versions of stories who need reliable, straightforward integration without unnecessary complexity or external dependencies.

API Documentation for Children’s Story Audio Generation

Frequently asked questions

What is the API endpoint URL?

The API endpoint is POST https://api.mmrvip.info/v1/audio/speech. You send a JSON body containing your text, voice selection, and other parameters to this specific address to receive the generated audio file in response.

How do I authenticate requests?

Include your API key in the Authorization header using the format: Authorization: Bearer tts-... . Each account has one active key, which you can retrieve from your dashboard at /get-api-key/.

Which models are available?

Two models are available: tts-1 and tts-1-hd. Both use the same engine and pricing. You select the desired model in the request body to determine the audio quality.

Can I use the OpenAI SDK?

Yes, the official OpenAI SDKs work by changing the base_url to https://api.mmrvip.info/v1. Use your site-specific key, and the request shape matches the OpenAI speech endpoint exactly for easy integration.

What is the character limit per request?

Each request supports up to 4096 characters of input text. If your children's book text exceeds this limit, you must split it into parts, generate audio for each, and join the files.

How do I specify a voice?

Include the voice parameter in your JSON body with one of the eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. Each voice offers a distinct tone suitable for different story styles.

Can I set a specific language?

Yes, use the optional language parameter with an ISO code. If omitted, the system guesses the language, defaulting to English for Latin script. Explicitly setting it ensures accuracy for non-English stories.

What audio formats are supported?

Supported formats are mp3, wav, opus, flac, and pcm. Select your preferred format in the response_format field of the request body to receive the audio file in the desired encoding for your app.

What are the rate limits?

You are limited to 60 requests per minute per key. New accounts start with 10 requests per minute until the first top-up. Exceeding this may cause requests to wait in a queue.

How do I handle errors?

If synthesis fails, the charge is returned in full. Check your dashboard for usage logs and status. Ensure your text is within limits and your key is valid before retrying the request.

Is streaming supported?

No, streaming is not supported. The API returns the complete audio file after generation. You must wait for the full response before playing the audio, which typically takes a few seconds for short phrases and longer for longer texts.

Can I split long texts?

Yes, split texts into parts of up to 4096 characters. Generate audio for each part separately using the API, then join the resulting audio files to create the complete story audio for your users.

How do I check my balance?

Visit the /get-api-key/ page on this site. Your dashboard displays your current balance, trial status, characters left, and usage. Balance does not expire and is updated automatically after top-ups via USDT.

What happens if I exceed limits?

If you exceed the rate limit, requests may queue and process one after another. If you run out of credit, requests will fail. Failed requests are free, so no extra charge occurs for errors.

First request

curl

curl https://api.mmrvip.info/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.mmrvip.info/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.mmrvip.info/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

Authentication

Sound wave illustration for: Authentication

Authentication is handled via a Bearer token passed in the Authorization header. You receive one active key per account, which you can generate or rotate directly from the dashboard at /get-api-key/. This key grants access to all API endpoints described in this documentation.

Each API key is tied to your specific account balance and rate limits. Ensure you keep this key secure, as anyone with the token can consume your credit. If you suspect a leak, you can immediately issue a new key, which invalidates the old one instantly.

Bearer token usage

Bearer token usage

Include the header Authorization: Bearer tts-<your-key> in every request. The API validates this token before processing any synthesis job. Without a valid key, requests return a 401 Unauthorized error.

Use this format for all HTTP requests, whether you are using the OpenAI SDK, plain curl, or a custom client library.

  • Header: Authorization: Bearer tts-...
  • One active key per account
  • Invalidates immediately upon rotation

Generating your API key

Generating your API key

Navigate to /get-api-key/ and sign in with Google or your email. Your API key is displayed on the dashboard alongside your balance and character count.

Start with the free trial credit of $0.50, valid for 7 days, if you signed in with Google.

Rotating your key

You can generate a new key at any time from the dashboard. The previous key stops working immediately, ensuring no overlap.

This is useful if you suspect your key has been exposed or if you are moving credentials between development and production environments.

Endpoints

Sound wave illustration for: Endpoints

The API exposes three primary endpoints to manage voice synthesis and configuration. Use POST for generating audio from text, GET /v1/voices to list available presets, and GET /v1/models to confirm available engine versions.

Each endpoint returns structured JSON or binary audio data. Start by retrieving voice options, then send text payloads to generate child-friendly audio files efficiently.

POST /v1/audio/speech

Sends text up to 4096 characters and returns an audio file. Supports formats like MP3 and WAV. Use this for converting story chapters into listenable content for young audiences.

Specify the voice, speed, and language to match the narrative tone. The endpoint handles synthesis and returns the binary audio directly in the response body.

  • Input: JSON body with model, input, voice, and response_format
  • Output: Binary audio data or JSON error
  • Max input length: 4096 characters per request

GET /v1/voices

Returns a list of all available voice presets with metadata. Use this to select voices like Aria or Luna that suit children's stories.

Each voice entry includes ID, name, and description. Filter by voice type or language to find the best fit for your audio content.

  • Returns JSON array of voice objects
  • Includes voice ID, name, and description
  • No pagination required for full list

GET /v1/models

Lists available model versions, including tts-1 and tts-1-hd. Both use the same engine and price.

Check this endpoint to ensure compatibility with your integration. Select the model based on your budget and audio quality needs.

  • Returns JSON array of model objects
  • Includes model ID and name
  • tts-1 and tts-1-hd available

Request parameters

Sound wave illustration for: Request parameters

Configure the synthesis engine and input constraints before sending your text. Each request processes a single audio segment, so plan your payload carefully to stay within character limits while maintaining narrative flow for children's stories.

The API accepts standard JSON bodies. Ensure your text payload is valid UTF-8 and does not exceed the maximum length per single request to avoid immediate rejection.

Model selection (tts-1, tts-1-hd)

Both tts-1 and tts-1-hd use the same underlying engine and pricing. Both models use the same engine and price; choose based on your preference for audio quality. Both support all 23 languages and 8 voice presets.

The model parameter determines the audio quality but does not affect the voice characteristics. Select the model that best fits your cost-performance ratio for batch-generated story collections.

  • tts-1: Standard quality, consistent pricing.
  • tts-1-hd: Higher fidelity, same price.

Input text limit (4096 chars)

Each API call accepts up to 4,096 characters, including spaces and punctuation. For longer fairy tales, split your manuscript into chunks of this size and concatenate the resulting audio files sequentially.

This limit ensures consistent generation latency. Short phrases may take a few seconds, while longer texts approach real-time generation speeds. Manage queue delays by spacing out requests if processing many chapters simultaneously.

  • Maximum 4,096 characters per request.
  • Spaces and punctuation count toward the limit.
  • Split long texts manually for optimal results.

Voice and language settings

Select one of the 8 presets (e.g., luna for soft storytelling or aria for clear narration). Specify the language ISO code if using non-English Latin script to ensure correct pronunciation, as the API defaults to English for Latin text.

Voices are licensed from LibriVox recordings. Every generated file includes an inaudible watermark. If the language field is omitted, the system guesses based on the script, which may cause errors for mixed-language stories.

  • 8 voice presets available.
  • 23 supported languages.
  • Optional language parameter for disambiguation.

image]:

Response formats

Sound wave illustration for: Response formats

The API returns the synthesized audio directly in the response body, eliminating the need for intermediate storage or separate download steps. You specify the desired output format via the response_format parameter, which accepts mp3, wav, opus, flac, or pcm. This allows you to choose between compressed files for efficient storage and transmission or uncompressed formats for high-fidelity processing in children’s audio workflows.

MP3, WAV, Opus, FLAC, PCM

Selecting mp3 or opus reduces bandwidth usage while maintaining acceptable quality for most playback scenarios. WAV and FLAC provide lossless audio, suitable for high-quality playback or editing. PCM offers raw uncompressed data, useful for low-level audio processing pipelines.

Audio file in response body

The generated audio binary is embedded directly in the HTTP response body. There is no separate URL to fetch; the data is available immediately after the synthesis job completes. This simplifies integration, as your application can write the response stream directly to a file or memory buffer without additional API calls.

Error responses explained

If synthesis fails, the API returns a JSON error object with a specific code and message. Failed requests are free, so you are not charged for characters that did not generate audio. Always check the HTTP status code and parse the error body to determine if you need to retry or adjust your input text.

  • Invalid API key
  • Input text exceeds 4096 characters
  • Unsupported voice or language combination
  • Rate limit exceeded

Rate limits

Sound wave illustration for: Rate limits

The API enforces a rate limit of 60 requests per minute for each active key. This limit applies to all endpoints, including speech generation and voice listing. If you exceed this threshold, subsequent requests will receive a 429 Too Many Requests error until the window resets.

60 requests per minute

Each API key allows up to 60 requests per minute. This includes both successful and failed requests. Monitor your usage via the /get-api-key/ dashboard to stay within these bounds.

  • Limit is per key, not per account.
  • Counts reset every 60 seconds.

10 requests before top-up

New accounts without a top-up are limited to 10 requests per minute. This ensures fair usage during the initial testing phase. Once you top up, the limit increases to 60 requests per minute.

  • Applies only to accounts with zero balance.
  • Increases automatically after a valid top-up.

Handling queue delays

Requests are processed sequentially. Under high load, you may experience delays as your request waits in the queue. Typical generation speed is roughly real-time, but short phrases may take a few seconds. Implement exponential backoff in your retry logic to handle temporary delays gracefully.

  • Use exponential backoff for retries.
  • Check status codes for queue indicators.
Rate limits

OpenAI SDK integration

Sound wave illustration for: OpenAI SDK integration

The StoryVoice API mirrors the OpenAI speech endpoint structure, allowing you to leverage familiar SDKs with minimal configuration. By simply adjusting the base URL, your existing code can route requests to our infrastructure without rewriting core logic.

This compatibility ensures a smooth transition for startups already building audio features. You retain the convenience of standard libraries while accessing our specific voice presets optimized for children’s stories.

Changing base_url

Update the base_url parameter in your SDK client to https://api.mmrvip.info/v1. This directs all API calls to the StoryVoice endpoint instead of OpenAI’s servers.

Ensure your authorization header uses your unique tts-... key. The SDK will handle the rest, treating our service as a drop-in replacement for the standard speech endpoint.

  • Base URL: https://api.mmrvip.info/v1
  • Auth Header: Bearer tts-<your-key>
  • Endpoint: /v1/audio/speech

Using official SDKs

The official OpenAI Python and Node.js SDKs work with our API by changing the base_url. No custom client library is required. Simply point the SDK to our domain and use the standard audio.speech method.

This approach supports all standard parameters like model, voice, input, and response_format. You can continue using your preferred SDK version without waiting for a dedicated wrapper.

Code example in Python

```python import openai client = openai.OpenAI( base_url="https://api.mmrvip.info/v1", api_key="tts-your-api-key" ) response = client.audio.speech.create( model="tts-1", voice="luna", input="Once upon a time, there was a little star.", response_format="mp3" ) response.stream_to_file("story.mp3") ```

Curl example

Sound wave illustration for: Curl example

Use this curl command to generate audio for a children’s story snippet. Replace YOUR_API_KEY with your actual key from /get-api-key/.

Basic request structure

Send a POST request to the speech endpoint. Include the model, voice, input text, and desired response format in the JSON body.

  • Endpoint: https://api.mmrvip.info/v1/audio/speech
  • Method: POST
  • Content-Type: application/json

Required headers

Include your Bearer token in the Authorization header. This authenticates your request and links usage to your account balance.

Response handling

On success, receive the audio file directly in the response body. Save this binary data to a file for playback. Check status codes for errors.

Error handling

Sound wave illustration for: Error handling

API responses include standard HTTP status codes to indicate success or failure. Failed synthesis requests are free, and any charge is returned in full to your balance.

Always check the response body for specific error details. This ensures you understand why a generation failed and can adjust your parameters accordingly.

Common error codes

Use 400 for invalid parameters like an unsupported voice or model. Use 401 if your API key is missing or expired. Use 429 when you exceed the 60 requests per minute limit or the 10 requests per minute limit before your first top-up.

  • 400: Bad Request (invalid voice, model, or input)
  • 401: Unauthorized (invalid or expired API key)
  • 429: Too Many Requests (rate limit exceeded)
  • 500: Internal Server Error (temporary processing issue)

Retry logic

Implement exponential backoff for 429 and 500 errors. Wait briefly before retrying to avoid overwhelming the queue, especially since requests are processed sequentially and may delay under load.

  • Retry after 1-2 seconds for 429 errors
  • Retry after 2-5 seconds for 500 errors
  • Limit retries to prevent infinite loops

Checking balance

Monitor your balance via the /get-api-key/ dashboard. Failed requests are free, so your balance remains intact. Use GET /v1/voices to check current pricing and available voices.

  • Balance does not expire
  • Top-up via USDT (TRC-20) for automatic credit
  • No minimum spend or monthly plans

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. Node.js documentation
  3. IETF RFC 7845: Ogg Opus
  4. LibriTTS-R corpus (OpenSLR 141)
  5. curl documentation
  6. FFmpeg documentation
  7. openai-node on GitHub
  8. Creative Commons Attribution 4.0
  9. ISO 639 language codes
  10. LibriVox public-domain audiobooks
  11. TRON developer hub: TRC-20
  12. Tether (USDT)

More on this site