Frequently asked questions
What is TTS in WordPress?
Text-to-speech converts your written content into audio files via an API. Instead of relying on built-in features, you send text to https://api.ub150.net/v1/audio/speech and receive an audio file. This allows you to add audio playback to any post or page, enhancing content consumption for your readers.
Do I need a plugin for TTS?
No, you do not need a plugin. You can integrate the API directly using standard HTTP requests or the OpenAI SDK. This keeps your WordPress installation lightweight and avoids plugin conflicts. You control the integration code, ensuring it fits your specific workflow without extra bloat.
How do I integrate the API?
Send a POST request to https://api.ub150.net/v1/audio/speech with your text and API key. Use the OpenAI SDK by changing the base_url. The endpoint accepts JSON bodies with model, input, and voice parameters, returning an audio file you can embed directly into your WordPress posts.
Is PHP required for WordPress?
PHP is required for your WordPress theme and core, but not strictly for the TTS integration. You can generate audio on the client side using JavaScript or via a simple PHP script. This flexibility allows you to choose the best method for your specific WordPress setup.
Can I use JavaScript for TTS?
Yes, you can use JavaScript to call the API directly from the browser or a custom script. Use the OpenAI SDK with the base_url set to https://api.ub150.net/v1. This allows audio generation within your WordPress theme without needing server-side PHP processing for every request.
How do I store generated audio?
The API returns the audio file in the response but does not store it. You must save the file to your WordPress media library or a static directory. This gives you full control over file management, caching, and delivery without relying on external storage services.
Does TTS affect site speed?
TTS generation happens on our servers, not your WordPress host. The API processes requests in roughly real time on long texts. Once you receive the audio file, it loads like any other media. Your site speed depends on your hosting and how you deliver the generated audio files.
Is TTS good for accessibility?
Yes, adding audio to text improves accessibility for visually impaired users or those who prefer listening. Our API supports 23 languages, including English, Spanish, and German. You can generate clear, natural-sounding speech for your posts, making your content more inclusive and easier to consume on the go.
How much does TTS cost in WordPress?
Pricing is $0.01 per 1,000 characters. You pay only for what you use, with no monthly fees. Failed requests are free. You can start with a $0.50 trial credit. Top-ups via USDT are processed automatically, making it easy to budget for your WordPress content generation needs.
Can I cache TTS audio?
Yes, since you store the generated audio files, you can cache them using your WordPress caching plugins or CDN. This avoids repeated API calls for the same text. Caching significantly reduces costs and improves load times.
How do I handle long posts?
Split your text into chunks of up to 4096 characters. Send each chunk to the API and join the resulting audio files. This ensures stable processing and avoids hitting character limits. You can automate this split and join process in your WordPress theme or custom script.
What format is best for web?
MP3 is a compatible format for web browsers and works well with WordPress audio players. You can also choose WAV, OPUS, FLAC, or PCM. MP3 offers a good balance of quality and file size, ensuring smooth playback across different devices and browsers for your WordPress audience.
Can I use this on any WordPress theme?
Yes, because the integration is done via API calls, it works with any WordPress theme. You just need to add the code to your theme’s functions.php or a custom template. The audio file is embedded as standard media, so it displays correctly regardless of your theme’s design.
Do I need to update the code?
No, you do not need to update the code for API changes. The endpoint structure remains stable. You only need to update your code if you change voices, models, or formats. The API key is the only variable you manage, ensuring a consistent integration over time.
Why Avoid Plugins?
Plugins often bloat your WordPress installation with unnecessary code, slowing down page loads and complicating updates. By using the ReadAloud Freelance API directly, you keep your site lightweight and fast, ensuring that text-to-speech functionality doesn't become a performance bottleneck.
Direct API integration gives you full control over how audio is generated, styled, and delivered. You aren't tied to a plugin's rigid settings or deprecated features; you can tailor the experience exactly to your blog's design and your clients' needs.
Lighter Site Speed
Every plugin adds HTTP requests, JavaScript bundles, and database queries. A direct API approach removes this overhead. Your WordPress theme stays clean, and users experience faster load times, which is critical for retaining readers and improving SEO rankings.
- No extra JavaScript libraries for basic TTS
- Reduced DOM size for faster rendering
- Cleaner database with no plugin tables
Full Control
With the API, you decide exactly when and how audio is generated. You can integrate custom logic, such as triggering synthesis only when a user clicks a button, or pre-generating audio for long blog posts during off-peak hours.
- Custom audio player design
- Flexible caching strategies
- Direct control over voice and language parameters
API Integration Steps
Start by visiting https://ub150.net/get-api-key/ to sign in with Google or your email. The dashboard displays your unique API key, initial balance, and a ready-to-use cURL example. This key authenticates your requests to the API base URL.
Get API Key
Navigate to the /get-api-key/ page on ub150.net. Sign in using Google or your email credentials to retrieve your single active key. Copy this key immediately; it authenticates all subsequent requests to the API base URL https://api.ub150.net/v1.
- Sign up via Google or email/password
- Retrieve your unique Bearer token
- Copy key before leaving the dashboard
Create Endpoint
Configure your WordPress theme or a custom plugin to handle POST requests to https://api.ub150.net/v1/audio/speech. Structure the JSON body with the required model, input, voice, and response_format fields. Ensure your server securely stores the API key to prevent exposure in client-side code.
- Use POST to /v1/audio/speech
- Include model, input, voice, format
- Securely store the Bearer token
Code Implementation
Direct integration eliminates plugin bloat, keeping your WordPress core lean. By calling the TTS API directly, you retain full control over request formatting, error handling, and audio delivery without relying on third-party updates or conflicting scripts.
PHP cURL
Use PHP cURL to send a POST request to https://api.ub150.net/v1/audio/speech from your server. Pass the text, voice, and format in the JSON body. Include your Authorization: Bearer header to authenticate. The API returns the audio file directly, which you can save or play.
- Set CURLOPT_POST to 1 and define the JSON payload.
- Include the Bearer token in CURLOPT_HTTPHEADER.
- Handle the response stream to save the audio file locally.
JavaScript Fetch
For client-side generation, use the Fetch API to call the endpoint. Send the text and voice parameters in the request body. The response contains the audio blob, which you can assign to an HTML5 audio element for immediate playback in the user's browser.
- Construct a POST request with the required JSON body.
- Parse the response as an array buffer or blob.
- Create an object URL from the blob for the audio player.
Audio Playback
Once your API returns the audio file, the HTML5 <audio> tag is the most reliable way to embed it directly into your WordPress posts or pages. This approach requires no third-party libraries or heavy plugin scripts, keeping your page load times minimal while providing native browser controls for play, pause, and volume.
By passing the generated audio URL directly into the src attribute, you ensure immediate compatibility across all modern devices. This method allows you to integrate the TTS output seamlessly into your existing content structure without disrupting the user experience or adding unnecessary DOM elements.
HTML5 Audio Tag
Use the standard <audio controls> element to render the player. You can dynamically generate this HTML via your PHP or JavaScript integration, ensuring the correct audio source is always linked to the specific voice and text generated by your API call. This ensures a clean, semantic markup that search engines and screen readers can easily interpret.
The native controls provide a familiar interface for users, including progress bars. This eliminates the need for custom JavaScript event listeners for basic playback functionality.
- <audio controls src="https://api.ub150.net/v1/audio/generated.mp3"></audio>
- Add
preload="metadata"to save bandwidth - Use
autoplaycautiously to avoid policy blocks
Player Styling
Customize the player’s appearance using CSS to match your WordPress theme’s color scheme. Since native browser styles vary, you might choose to hide default controls and build a lightweight custom interface using divs and JavaScript, or simply style the native controls for consistency. This ensures the audio player feels like a native part of your blog’s design.
Targeting the <audio> element with CSS allows you to adjust heights, margins, and border radii. For a professional look, ensure the player scales correctly on mobile devices, maintaining readability and touch-friendly button sizes without requiring heavy JavaScript frameworks for simple visual adjustments.
- Set
width: 100%for responsive design - Use
::-webkit-media-controlsfor fine tweaks - Match
background-colorto your theme
Caching Strategy
Text-to-speech generation takes time and costs credits. Caching generated audio files on your server or CDN prevents redundant API calls for identical text inputs. This approach significantly reduces latency for returning visitors and lowers your monthly character consumption.
Store Generated Audio
Generate a unique hash from the input text and voice settings. Save the resulting MP3 or WAV file with this hash as the filename. Map the hash to the original content URL in your database or file structure.
- Use content hashes for consistent filenames
- Store files in a dedicated /tts-audio/ directory
- Include voice and speed in the hash logic
Reduce API Calls
Check for an existing audio file before sending a POST request to the API. Serve the cached file directly if it exists, bypassing the need for repeated API calls. This keeps your site responsive and your balance intact.
- Check cache before API request
- Invalidate cache when source text changes
- Monitor character usage in your dashboard
Accessibility Benefits
Adding TTS directly to WordPress via API gives you precise control over how audio is delivered, ensuring it integrates seamlessly with your site’s existing accessibility features. Unlike bulky plugins that might conflict with your theme, a lightweight custom implementation ensures that audio plays exactly where you need it, enhancing the experience for users who rely on assistive technologies.
This approach allows you to tailor the audio output to specific content types, ensuring that critical information is always accessible. By managing the integration yourself, you avoid the bloat and potential bugs of third-party solutions, keeping your site fast and your accessibility features reliable.
Screen Reader Aid
Custom TTS integration ensures that audio content is properly labeled and accessible to screen readers. You can add ARIA attributes to your audio players, making it clear to users that they are interacting with spoken content. This direct control helps maintain a consistent and predictable user experience, especially for complex layouts where plugin-generated audio might not align with your site’s structure.
By handling the audio generation yourself, you can ensure that the text-to-speech output is synchronized with the visual content. This synchronization is crucial for users who rely on screen readers to navigate your site, as it provides a clear and coherent audio narrative that complements the visual experience.
- Add ARIA labels for clear identification
- Synchronize audio with visual content
- Ensure consistent navigation experience
Dyslexia Support
For users with dyslexia, listening to content can significantly reduce the cognitive load of reading. By providing high-quality TTS, you offer an alternative way to consume information, which can be particularly helpful for those who struggle with text-heavy content. This feature can make your WordPress site more inclusive and user-friendly.
Custom TTS allows you to choose voices that are clear and easy to understand, which is essential for users with dyslexia. You can also control the speed and tone of the audio, ensuring that it is comfortable and accessible for your audience. This level of customization is often not possible with standard plugins.
- Reduce cognitive load for readers
- Choose clear and understandable voices
- Control audio speed and tone
Performance
WordPress sites can suffer from heavy payloads when audio files are embedded directly. By generating speech on demand, you keep your HTML lean and your initial page load fast. This approach ensures that your site remains snappy for visitors, regardless of the number of articles or blog posts you publish.
Implementing lazy loading and asynchronous generation prevents the browser from blocking while audio files are created or downloaded. This keeps the user interface responsive and improves the overall experience for readers, especially those on slower connections.
Lazy Loading
Defer audio file downloads until the user scrolls near the content or clicks play. This reduces initial bandwidth usage and improves Time to Interactive (TTI) scores significantly.
Only fetch the audio URL after the user interacts, ensuring that static content like text and images loads immediately without waiting for synthesis to complete.
- Use
loading="lazy"on audio elements. - Trigger fetch only on click or scroll proximity.
Async Generation
Send the synthesis request in the background without blocking the main thread. WordPress handles the request via a background process or AJAX call, allowing the page to render fully while the audio is being generated.
This method is ideal for long texts where generation might take several seconds. The user sees the text immediately and receives the audio link once processing is complete.
Since requests are processed sequentially under load, async handling prevents UI freezes. Monitor the queue status to inform users if generation is delayed.

Security
Securing your API key is the first line of defense. Since ReadAloud Freelance uses a single active key per account, exposing it in client-side code allows anyone to consume your balance. Keep the key out of public view, especially when integrating with WordPress themes or custom plugins, and rotate it immediately if you suspect unauthorized access.
Rate limiting protects your account from unexpected spikes. With a limit of 60 requests per minute per key, exceeding this threshold halts generation until the window resets. Implementing local caching or queuing mechanisms ensures you stay within these bounds, preventing wasted calls and ensuring consistent delivery for your blog or accessibility features.
Key Protection
Your API key is the sole credential for your account. Store it in environment variables or secure configuration files rather than hardcoding it into your theme’s PHP or JavaScript files. If you issue a new key, the old one stops instantly, so rotate it promptly after any suspected exposure to safeguard your remaining balance.
Be mindful of where your key travels. When using PHP cURL or JavaScript fetch, ensure the key is not logged in browser developer tools or visible in page source unless intentionally exposed for specific client-side use cases.
- Store keys in environment variables, not hardcoded in files.
- Rotate keys via the dashboard if exposure is suspected.
- Avoid logging the full key in client-side scripts.
- Use HTTPS for all API requests.
Rate Limiting
The API allows 60 requests per minute per key. If you exceed this, subsequent requests will fail until the window resets. For WordPress sites generating audio on demand, implement a queue or cache system to batch requests or store generated audio files locally, reducing the need for repeated API calls.
Start with a lower limit of 10 requests per minute until you top up your account. Monitor your usage via the dashboard to adjust your caching strategy accordingly, ensuring you never hit the limit unexpectedly during high-traffic periods.
- Limit: 60 requests/minute after top-up; 10/minute initially.
- Implement caching to store generated audio files.
- Queue requests if traffic exceeds the limit.
- Monitor usage via the dashboard to stay within bounds.
Maintenance
Maintaining your TTS integration is straightforward but requires attention to key lifecycle and error states. Since each account holds only one active API key, you must manage rotation carefully to avoid service interruption.
Robust error handling ensures your WordPress site remains functional even when the TTS API experiences brief outages or rate limits, preventing broken audio players for your visitors.
Key Rotation
Generate a new key via the dashboard whenever needed. The old key stops instantly, so update your WordPress configuration files immediately to ensure continuous service without downtime.
Since support is email-only, plan rotations during low-traffic periods to avoid delays if issues arise during the transition.
- Revoke old key instantly upon issuing new one
- Update WP config files before generating new key
- Use environment variables to store the key securely
Error Handling
Implement logic to catch HTTP errors (429 for rate limits, 5xx for server issues) and display a user-friendly message instead of a broken audio tag.
Retry logic should respect the rate limit of 60 requests per minute, waiting before re-trying failed synthesis requests.
- Catch 429 Too Many Requests errors
- Implement exponential backoff for retries
- Log errors for debugging via email support
Cost Management
Managing your API budget is straightforward because billing is transparent and usage-based. You pay $0.01 per 1,000 characters, so you can precisely forecast costs for your WordPress blog posts or client projects. Failed requests are free, ensuring you only pay for successful audio generation.
Monitor Usage
Track your character consumption directly from your dashboard. The interface shows your remaining balance and character count. This visibility helps you avoid unexpected service interruptions during active projects.
- Check balance and character count in real-time
- Receive notifications for low balance thresholds
- View detailed usage logs per request
Optimize Text
Reduce costs by trimming unnecessary whitespace and punctuation, as these count toward your character limit. Pre-process your WordPress content to remove redundant phrases before sending them to the API. This simple step can significantly lower your monthly spend, especially for high-volume blog content.
- Remove extra spaces before API calls
- Trim redundant introductory phrases
- Consolidate short sentences where possible
Troubleshooting
When integrating TTS into WordPress without plugins, you will occasionally hit API limits or format errors. Understanding the root cause saves hours of debugging. Most issues stem from rate limits or incorrect character counting in your input text.
Common Errors
The most frequent issue is hitting the 60 requests per minute limit. If your script processes large texts without splitting them correctly, you may receive 429 Too Many Requests errors. Another common error is exceeding the 4096 character limit per request, which causes synthesis failure.
- 429 Too Many Requests: You have exceeded 60 requests/minute.
- 400 Bad Request: Input text exceeds 4096 characters.
- 401 Unauthorized: Invalid or expired API key.
Debugging Steps
Start by checking your API key validity and balance. Use the provided curl examples to test connectivity directly from your server. Verify that your text encoding matches the API expectations, especially for non-Latin scripts.
- Check API key status via the dashboard.
- Log request payloads and response headers.
- Verify character count before sending requests.
Future Proofing
The API structure remains compatible with standard OpenAI SDKs, so your integration code stays stable even as we upgrade the underlying engine. You can simply update your base URL when new models arrive without rewriting your entire workflow.
API Updates
We maintain the same request shape for POST /v1/audio/speech, ensuring that existing scripts continue to work. Major changes to the endpoint structure are rare, allowing you to focus on content rather than debugging API calls.
Voice Changes
Voice presets like Aria or Nova may receive subtle updates to their neural models to improve clarity. We list all available voices at GET /v1/voices, so you can easily check for new options or deprecated presets in your dashboard.
- Check
GET /v1/voicesfor new options - No impact on existing audio files
- Simple model name changes
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. For content creators working with diverse audiences, language support is critical.
23 languages
Any voice speaks any of these languages.
