Frequently asked questions
Can I convert any text to audio?
Yes, you can convert any text up to 4096 characters into audio. The API accepts standard text input and converts it into various formats like MP3 or WAV. If your script exceeds the limit, simply split it into smaller parts and join the resulting audio files for a seamless guided session.
How long does it take to generate audio?
Generation takes roughly real time, averaging 25 characters of text per second. Short phrases may take a few seconds, while longer texts process sequentially. Under load, requests may wait in a queue, but typical usage remains efficient for most meditation script lengths without significant delays.
Is the audio file high quality?
Audio is generated using either the tts-1 or tts-1-hd model. You can choose formats like MP3, WAV, FLAC, or Opus. Each file includes an inaudible watermark identifying it as synthetic speech, ensuring transparency while maintaining professional-grade clarity suitable for meditation and fitness applications.
Can I use the audio for commercial purposes?
Yes, you can use the generated audio commercially. The voices are based on licensed recordings from LibriTTS-R (CC BY 4.0) and LibriVox public-domain readings. You only pay for the characters you consume, making it cost-effective for scalable commercial products.
Do I need technical skills to use the API?
Basic technical skills help, but the API is designed for ease of use. It follows the same request shape as OpenAI, allowing you to use existing SDKs by changing the base URL. You can also use simple curl commands or standard HTTP requests to send text and receive audio.
Can I generate audio for multiple languages?
Yes, the API supports 23 languages, including English, Spanish, German, and Japanese. Any voice can speak any supported language. If the language is not specified, it guesses from the script, but you should set the language parameter explicitly for non-English Latin-script text to ensure accuracy.
What if I don't like the voice?
You have eight voice presets to choose from, including calm options like Luna or Sage. You can switch voices easily by changing the voice parameter in your API request. Each voice offers a distinct tone, allowing you to find the perfect match for your meditation or fitness content.
How do I handle long meditation scripts?
Split your script into parts of up to 4096 characters. Send each part as a separate request and join the resulting audio files. This ensures each request stays within limits while maintaining the flow of your guided session. The API processes requests sequentially, so plan your splits accordingly.
Is there a limit to how many files I can generate?
There is no limit to the total number of files you can generate. You are limited by your balance and rate limits. You can generate as much audio as your credit allows, with no monthly caps or minimum spend requirements, making it flexible for growing startups.
Can I change the speed of the generated audio?
Yes, you can adjust the speed between 0.25 and 4.0. This allows you to create slower, more meditative readings or faster, energetic fitness instructions. Simply set the speed parameter in your request to match the desired pace for your specific audience and content type.
Do I need to download the audio files?
The audio is returned directly in the API response, so you receive it immediately. You do not need to download files from a separate storage location. The generated audio is not stored by the API, so you must save it to your own infrastructure for future use.
How do I ensure the audio is calm?
Choose voices like Luna (soft, storytelling) or Sage (calm, instructional). You can also reduce the speed to below 1.0 for a more soothing effect. These settings help create a serene atmosphere ideal for meditation and mindfulness practices.
Can I use the API on my website?
Yes, you can integrate the API directly into your website. Use the standard HTTP endpoint or OpenAI-compatible SDKs to send text and receive audio. This allows you to generate audio on the fly, keeping your user experience seamless and scalable without relying on external voice actor workflows.
What happens if my script has special characters?
Special characters are treated as characters in the input. Spaces and punctuation count toward the 4096 character limit. The API handles standard text inputs reliably, so you can include common punctuation and symbols in your meditation scripts without affecting the generation process or audio quality.
Why Use TTS for Meditation
Text-to-speech offers meditation creators a reliable way to maintain auditory consistency across all guided sessions. Unlike hiring different voice actors for each new track, a single digital voice ensures your users hear the same calming tone every time they open your app. This uniformity builds trust and reinforces your brand’s serene identity without the logistical hassle of managing multiple contractors.
Consistency also simplifies content updates. When you refine a script or correct a subtle pacing issue, you can regenerate the audio instantly. There is no need to re-record entire sessions with an actor, allowing you to keep your library fresh and accurate with minimal effort.
Consistency Across Sessions
Using a fixed voice like Luna or Sage guarantees that every meditation session sounds cohesive. Users do not experience jarring shifts in tone or delivery style between episodes, which helps maintain a deep state of relaxation and focus throughout their practice.
This uniformity is crucial for meditation apps where auditory familiarity aids in mindfulness. Listeners become accustomed to the specific rhythm and cadence of your chosen voice, making the transition into a meditative state smoother and more natural.
- Same voice for all tracks
- Predictable pacing and tone
- No actor scheduling conflicts
Easy Content Updates
Meditation scripts often require minor tweaks for flow or accuracy. With an API, you can update a single paragraph and regenerate just that segment, rather than re-recording the entire hour-long session. This agility keeps your content library precise and up-to-date.
You can also easily A/B test different voice presets to see which resonates best with your audience. If Luna feels too soft or Sage too instructional, you can switch voices in minutes and deploy the new audio to your users immediately.
- Regenerate specific segments
- Quick A/B testing of voices
- Instant content correction
Cost Efficiency
Hiring professional voice actors for a growing library of meditations can become expensive quickly, especially when you need multiple variations or frequent updates. TTS eliminates these recurring production costs. You pay only for the characters you generate, making it highly scalable for startups.
With a rate of $10 per million characters, the cost is based on text length, not audio duration. This model allows you to offer a vast library of content without significant overhead, ensuring your margins remain healthy as your user base grows.
- Pay-per-character model
- No per-session recording fees
- Scalable for large libraries
Preparing Your Script
Before sending text to the API, ensure your meditation script fits within the 4096-character limit per request. Spaces and punctuation count toward this total, so a concise script helps avoid unnecessary fragmentation. This limit ensures stable generation and keeps processing times predictable for your users.
Clean your script by removing complex markdown or unsupported symbols that might confuse the synthesis engine. While the API handles standard punctuation well, stripping extra formatting guarantees that the voice models focus purely on the spoken words, resulting in clearer audio for your guided sessions.
Character Limit Check
Verify your total character count before API submission. The API charges $0.01 per 1,000 characters. Staying under the 4096-character limit per request helps manage costs and ensures you stay within the 60 requests per minute rate limit. Use a simple counter tool to trim redundant phrases without losing the calming tone essential for meditation content.
- Count all characters, including spaces and punctuation.
- Stay under 4096 characters per single request.
- Monitor usage to avoid rate limit hits (60 req/min).
Removing Special Characters
Strip out non-standard symbols, emojis, or complex markdown that the TTS engine cannot interpret. The API expects plain text; unexpected characters can cause errors or produce unnatural pauses. Removing these elements ensures the voice models deliver a smooth, uninterrupted reading experience, which is critical for maintaining a serene atmosphere in your meditation apps.
- Remove emojis and complex markdown.
- Ensure plain text format for compatibility.
- Prevents unnatural pauses in speech.
Segmenting Long Texts
If your script exceeds 4096 characters, split it into smaller segments. The API does not support long-form generation in a single call. You can programmatically split the text and join the resulting audio files later. This approach maintains audio quality and allows you to handle failures gracefully, ensuring each segment is generated successfully before combining them for the final output.
- Split text into chunks of 4096 characters.
- Generate audio for each segment individually.
- Join files programmatically for the final output.
Choosing the Right Voice
Selecting the correct voice preset ensures your meditation sessions feel authentic and aligned with the listener’s experience. MindfulSpeech offers eight distinct voices, each tuned for specific tonal qualities that enhance guided practices without requiring expensive voice actor contracts.
For narrative flows, Luna provides a soft, storytelling tone. For clear instructional guidance, Sage delivers a calm, instructional voice. For conversational check-ins, Milo offers a friendly, approachable style.
Luna for Storytelling
Luna is ideal for guided visualizations or narrative meditations. Her soft, storytelling tone creates a serene atmosphere, helping users relax into the session. Use her for longer, flowing scripts where continuity matters.
Sage for Instructions
Sage excels in structured sessions. Her calm, instructional voice is perfect for step-by-step breathing exercises or body scans. She provides clarity and neutrality, ensuring users focus on the technique rather than the voice's personality.
Milo for Conversations
Milo brings a friendly, conversational tone to shorter prompts or daily check-ins. His energetic yet warm delivery works well for motivational segments or quick mindfulness reminders within your fitness app.
Making the API Request
To convert your meditation script into audio, you need to send a POST request to the API endpoint. This involves structuring your request with the correct authentication header and a JSON body that defines the voice, model, and input text.
Setting Up the Header
Include an Authorization: Bearer tts-... header with your unique API key. This authenticates your request and ensures you are billed correctly against your account balance.
Defining the Body
The JSON body requires model ("tts-1" or "tts-1-hd"), input (your script, max 4096 characters), voice (e.g., "luna" or "sage"), and response_format (mp3 or wav). You can also set speed between 0.25 and 4.0.
Sending the POST Request
Send the request to https://api.bagan7login.com/v1/audio/speech. The API processes the text and returns the audio file directly in the response body.
Handling the Response
Once the API returns a successful 200 status, the response body contains the raw audio binary. Save this data directly to your server or cloud storage using the specified response_format (mp3, wav, opus, flac, or pcm). Ensure your application handles binary streams efficiently to avoid memory bottlenecks during bulk meditation script generation.
If the synthesis fails, the API returns an error code and returns the charge. Check the status code to determine if you need to retry or adjust parameters. Always log the request ID and error message for debugging, ensuring you can trace issues back to specific script segments or voice configurations without losing billing accuracy.
Saving the Audio File
Store the returned binary data immediately. Use the response_format parameter to ensure compatibility with your meditation app’s audio player. For guided sessions, MP3 offers the best balance of quality and file size.
Verify the file integrity before saving. If the audio is too short or silent, discard it and retry with adjusted speed or voice settings.
- Use
response_formatto match your app’s requirements - Store files securely with unique identifiers
Error Handling
The API returns standard HTTP error codes for failures. Failed requests are free, so you can retry without penalty. Check the error message for details on invalid voices or rate limits.
Implement exponential backoff for temporary errors. Log the error type and timestamp to identify patterns in script failures.
- Retry failed requests immediately
- Log error codes for debugging
Logging Usage
Track each request’s character count, voice, and duration. This data helps you monitor your $10 per 1 million characters pricing and plan future content batches. Store metadata like time and status for billing reconciliation.
Use these logs to optimize your content calendar. Identify which voices and speeds resonate best with your meditation users, allowing you to refine your audio library for better user experience.
- Track character counts for billing
- Monitor voice performance metrics
Optimizing for Meditation
Optimizing your meditation audio requires precise control over pacing and tone. Adjusting the speed parameter allows you to tailor the listening experience to specific session types.
Adjusting Speed
The speed parameter accepts values from 0.25 to 4.0. For guided meditation, set the speed between 0.75 and 0.9 to create a relaxed atmosphere. This subtle slowdown helps listeners breathe in sync with the narrator without distorting the voice quality.
Adding Pauses
The API does not support SSML tags for explicit pauses. To insert silence, add ellipses (...) or line breaks in your input text. These punctuation marks naturally create brief pauses, allowing listeners to reflect between instructions.
Ensuring Calm Tone
Choose voices known for calm delivery: Luna for storytelling and Sage for instructional segments. Avoid high-energy voices like Felix or Orion unless specifically required. Ensure the input text avoids exclamation marks, which can trigger a brighter, more assertive tone.
Testing Your Audio
Before publishing, listen to the generated MP3 or WAV file to ensure the voice matches your intended calm tone. Check that the pacing feels natural for a guided session and that no audio glitches occurred during synthesis.
Verify that the audio level is consistent and comfortable for listeners. While our API delivers clean audio, you may need to adjust volume normalization in your player to ensure it blends seamlessly with background music or ambient sounds.
Playthrough Check
Play the entire track from start to finish. Listen for unnatural pauses, abrupt cuts, or weird inflections that might distract users during meditation.
Ensure the selected voice (like Luna or Sage) maintains a soothing quality throughout the entire script without becoming fatiguing.
- Listen for natural breathing pauses
- Check for consistent tone
- Verify no audio artifacts
Volume Normalization
Generated audio may vary slightly in loudness. Use your app’s audio player to normalize levels, ensuring a smooth listening experience.
Consistent volume prevents jarring transitions between different meditation sessions or tracks.
Format Compatibility
The API supports MP3, WAV, OPUS, FLAC, and PCM. Choose MP3 or WAV for broad compatibility with most meditation apps.
Test playback on your target devices (iOS, Android, Web) to confirm the format plays correctly without issues.
- MP3 for small file size
- WAV for high quality
- Test on target devices

Integrating with Your App
Integrating your generated meditation audio into your fitness app requires a straightforward setup. Use the standard HTML5 <audio> element to play the MP3 or WAV files returned by the API. Ensure your player supports the formats you select, such as MP3 for smaller file sizes or WAV for lossless quality.
Audio Player Setup
Embed the player directly into your meditation session screens. Since the API returns the full audio file in the response, you can store it locally.
- Use HTML5
<audio>tags for compatibility. - Support MP3 and WAV formats.
- Store files locally for offline access.
Streaming Considerations
Our API does not support real-time streaming or WebSocket connections. Audio is generated and returned as a complete file. For long guided sessions, consider splitting the script into smaller segments to reduce latency during generation.
User Experience
Prioritize a serene interface. Use calm colors and simple controls. Ensure the audio plays smoothly without buffering delays. Provide clear feedback when the session ends or if an error occurs.
- Keep UI minimal and calm.
- Provide clear error messages.
- Ensure smooth playback transitions.
Common Pitfalls
Meditation scripts often contain subtle nuances that can be lost if technical constraints are ignored. Small oversights in rate limits or language settings can disrupt the serene flow your users expect, turning a calm session into a frustrating error loop.
By addressing these common pitfalls early, you ensure your audio generation remains consistent and reliable, preserving the mindful experience from script to playback.
Ignoring Rate Limits
Your API key is limited to 60 requests per minute. If you generate many short meditation cues rapidly, you may hit this cap quickly, especially with new accounts starting at just 10 requests per minute before the first top-up.
- Monitor your usage dashboard to stay under the 60 req/min limit.
- Batch longer scripts into segments to avoid hitting limits during bulk generation.
Misconfiguring Language
If you do not explicitly set the language field for non-English Latin-script text, the API defaults to English. This can cause awkward pronunciation in languages like Dutch or German, even if the voice model supports them.
- Always define the
languageISO code for clarity. - Verify supported languages: 23 options including Arabic, Chinese, and Japanese are available.
Overlooking Character Count
Each API request accepts up to 4096 characters. Exceeding this limit causes the request to fail, wasting no credit but requiring a retry. Long guided sessions must be split into manageable parts before sending.
- Count characters including spaces and punctuation.
- Split long scripts into segments under 4096 characters.
Scaling Your Library
Scaling your library involves moving from single script generation to systematic production. By batching requests, you can efficiently convert entire meditation series while staying within the 60 requests per minute limit. This approach ensures consistent audio quality across your catalog without manual intervention for each track.
Automation allows you to trigger audio generation directly from your content workflow. Combine this with a structured content calendar to schedule voiceovers for new guided sessions, ensuring your meditation library grows steadily and predictably as your startup expands its offerings.
Batch Processing
Group multiple scripts into a single workflow. Since each request handles up to 4096 characters, you can segment longer guided sessions and process them sequentially. This method reduces overhead and keeps your character count predictable.
Use the API’s consistent pricing of $0.01 per 1,000 characters to estimate costs for large batches. This helps you budget for weekly content drops without unexpected charges.
- Split long scripts into 4096-character chunks
- Process segments sequentially to respect rate limits
- Estimate costs using the per-character rate
Automating Generation
Integrate the API into your CMS or build script to auto-generate audio when a new meditation is published. This removes the need for manual uploads and ensures your app has audio ready for users immediately.
Leverage the simple POST request structure to connect with tools like Zapier or custom Python scripts. This keeps your tech stack lightweight and focused on delivering serene experiences.
- Connect API to your content management system
- Trigger audio generation on publication
- Use simple POST requests for integration
Content Calendar
Plan your meditation topics weeks in advance. Use the content calendar to schedule voice selections like Luna for storytelling or Sage for instructions, ensuring tonal variety.
Regularly update your audio library to keep users engaged. Consistent releases signal reliability, which is crucial for fitness startups looking to retain subscribers.
- Schedule voice types per topic
- Plan releases to maintain user engagement
- Update library regularly for freshness
Support and Updates
Monitoring usage keeps your meditation library running smoothly. The dashboard shows real-time character counts and request status, ensuring you stay within the 60 requests per minute limit without unexpected interruptions.
Monitoring Usage
Track your balance and character consumption directly from the /get-api-key/ page. This helps you anticipate when to top up via USDT (TRC-20), avoiding service pauses during peak generation times.
- View real-time balance and character usage
- Monitor request status for billing accuracy
- Set alerts for low balance thresholds
Updating Voices
You can switch voices like Luna or Sage at any time to refresh your content library. Since voices are presets, no retraining is needed; simply select a new voice in your next API request to apply it to new scripts.
Changing API Keys
Issue a new API key from your dashboard at any time. The old key stops immediately, enhancing security without downtime. This is ideal if you suspect unauthorized use or before sharing keys with development teams.
- Issue keys instantly from the dashboard
- Old keys stop immediately upon new issuance
- No downtime during key rotation
Final Checklist
Before publishing your guided meditation, ensure the text fits within the 4096-character limit and that special characters do not disrupt synthesis. Verify your API key is active and matches the current account credentials.
Script Validation
Check that the input text is under 4096 characters, counting spaces and punctuation. If your script is longer, split it into segments and join the resulting audio files later.
- Count characters including spaces and punctuation.
- Split long texts into 4096-character chunks.
- Remove unneeded special symbols.
API Key Verification
Confirm your Bearer token is correct and has not been revoked. Remember that issuing a new key immediately stops the old one, so update your app configuration accordingly.
- Use the key from /get-api-key/.
- Revoke old keys immediately upon rotation.
- Verify authorization header format.
Audio Quality Check
Play the generated MP3 or WAV file to ensure clarity. Listen for natural pacing with Luna or Sage, and confirm the speed setting aligns with your meditation style without sounding robotic.
- Test Luna for storytelling segments.
- Verify Sage for instructional parts.
- Check speed between 0.25 and 4.0.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Optimize your team's wellness to drive sustainable startup growth.
23 languages
Any voice speaks any of these languages.
Sources and further reading
- Wikipedia
- LibriTTS-R paper (arXiv 2305.18802)
- LibriTTS-R corpus (OpenSLR 141)
- IETF RFC 7845: Ogg Opus
- OpenAI API reference: create speech
- MDN: Web Speech API
- Tether (USDT)
- openai-python on GitHub
- W3C WAI: making audio and video accessible
- Node.js documentation
- LibriVox public-domain audiobooks
- ISO 639 language codes
