Frequently asked questions
What is the Web Speech API?
The Web Speech API is a browser standard allowing JavaScript to synthesize speech directly in the client. FlowSpeak offers a compatible cloud alternative via a standard HTTP API. You can use the official OpenAI SDK by changing the base URL to https://api.hd44live.cc/v1.
Is Web Speech API accessible?
Browser-based speech synthesis varies by platform and often lacks consistent voice quality or language support. FlowSpeak provides reliable, license-safe voices with consistent audio quality across all devices. This ensures a predictable accessibility experience for users with dyslexia or visual impairments, independent of the user’s specific browser or OS version.
Why use a cloud TTS API?
Cloud APIs like FlowSpeak offer consistent voice quality, broader language support, and predictable performance independent of the user’s device capabilities. You send text via JSON and receive audio files directly. This approach simplifies development, ensures uniform user experience, and handles complex audio generation server-side without relying on local browser resources.
How to split long text?
The API limits input to 4096 characters per request. For longer texts, split your text into chunks of this size and send multiple requests. Join the resulting audio files client-side. This ensures reliable synthesis without truncation or errors, maintaining audio continuity across the generated segments for a seamless listening experience.
Can I control speed in JS?
Yes, include a speed parameter in your JSON request body. Values range from 0.25 to 4.0, allowing precise control over playback rate. This feature integrates directly into the standard API call, enabling you to adjust audio pacing dynamically within your JavaScript application without needing external audio processing libraries.
Does it work on mobile?
Yes, the API works on any device with internet access and a browser supporting standard HTTP requests. Since audio is generated in the cloud, device performance does not affect synthesis quality. You can integrate it into mobile web apps or hybrid frameworks using the same JavaScript code used for desktop browsers.
What audio format to use?
You can choose from mp3, wav, opus, flac, or pcm via the response_format field. MP3 is recommended for general web use due to its small file size and broad compatibility. WAV offers uncompressed quality, while Opus provides efficient compression. Select the format that best fits your application’s bandwidth and playback requirements.
How to handle errors?
Check the HTTP status code and response body for error details. Failed requests are free, with charges returned in full. Implement retry logic for transient network issues. Ensure your text stays within the 4096-character limit and that your API key is valid. Handle errors gracefully to maintain a smooth user experience in your app.
Is caching allowed?
Yes, you can cache generated audio files to reduce API usage and improve load times. Since audio is deterministic for identical inputs, caching is efficient. Store generated files locally or on a CDN. Note that input text is not stored by FlowSpeak, so caching relies on your application’s logic to manage audio assets.
What about SSR?
You can generate audio on the server side by making API requests from your Node.js or backend environment. This reduces client-side load and ensures audio is ready before rendering. Simply send the text via HTTP POST to the API endpoint and handle the returned audio file in your server code.
Does it support TypeScript?
Yes, since FlowSpeak uses the same request shape as the OpenAI API, you can use the official OpenAI TypeScript SDK. Just update the base_url to https://api.hd44live.cc/v1. This provides full type safety and autocompletion for parameters like model, voice, input, and response_format within your TypeScript projects.
Can I use React?
Yes, integrate FlowSpeak into React apps using standard fetch or the OpenAI SDK. Create a utility function to handle API calls and manage state for audio playback. You can trigger synthesis on user actions, handle loading states, and display audio players using the returned audio data or URLs from the API response.
How to pause playback?
Pause playback using standard HTML5 Audio API controls, not the TTS API itself. The API returns an audio file. Use the pause() method on the HTMLMediaElement instance.
Is it free to use?
New accounts signing in with Google receive a $0.50 free trial valid for 7 days. Email-based accounts start without credit. After the trial, usage costs $10 per million characters. Failed requests are free. You can top up using USDT on the TRON network. There are no monthly plans or minimum spends.
Why use a cloud API?
Cloud TTS ensures consistent audio rendering across all browsers, eliminating the inconsistencies found in native Web Speech API implementations. By offloading synthesis to a reliable API, you guarantee that your accessibility features work uniformly for every user, regardless of their device or browser version.
Browser consistency
Native browser engines vary in how they handle text-to-speech parameters and voice selections. A cloud API standardizes the output, ensuring that a generated audio file sounds identical whether the user is on Chrome, Firefox, or Safari. This consistency is critical for accessible web applications where predictable behavior is required.
Voice quality
FlowSpeak provides clear voices based on licensed recordings. You can choose from eight distinct presets, such as Aria for narration or Felix for promos, ensuring the audio tone matches your app’s specific accessibility needs without sounding robotic or overly synthetic.
No native dependency
Your application does not rely on the user’s operating system having specific voice packs installed. Since synthesis happens on the server, you avoid issues where a voice disappears after an OS update or is missing on older devices. This removes the complexity of managing native dependencies and ensures your TTS feature remains stable over time.
Web Speech API vs Cloud TTS
The Web Speech API relies on the browser’s built-in engine, which varies by device and OS. Cloud TTS uses a dedicated server, ensuring consistent voice quality and behavior across all environments. This consistency is critical for accessibility tools where predictable output matters.
Latency comparison
Cloud synthesis typically takes a few seconds for short phrases, as requests are processed sequentially. While not instant like local speech synthesis, the latency is acceptable for most web applications. Long texts are split into chunks to manage processing time effectively.
- Local: Instant playback, but engine varies by browser.
- Cloud: A few seconds for short phrases; queues under load.
- Consistent timing regardless of user’s device hardware.
Voice variety
Browser engines offer limited voice options, often just one or two per language. FlowSpeak provides 8 distinct presets (e.g., Aria, Nova, Felix) supporting 23 languages. Each voice has a specific tone, from warm narration to energetic promos, independent of the user’s OS.
- 8 unique voice presets with distinct tonal qualities.
- Support for 23 languages with any voice.
- No dependency on installed system voices.
Control granularity
Cloud APIs allow precise control over speed (0.25–4.0) and output format (MP3, WAV, etc.). You can specify language codes to avoid guessing errors. The Web Speech API offers limited speed adjustment and fewer format options, restricting customization for accessible web apps.
- Adjustable speed from 0.25x to 4.0x.
- Explicit language code support.
- Multiple audio format outputs.
Implementation Steps
Converting text to speech in JavaScript involves three core steps: extracting the text, sending it to the API, and playing the result. This workflow ensures your app remains responsive while leveraging cloud processing power.
Below is the practical sequence to integrate FlowSpeak into your web application.
Fetch text from DOM
Select the target element using standard DOM methods like document.getElementById or querySelector. Extract the textContent property to ensure you get clean, unformatted text. This string becomes the input payload for the API request.
- Use
textContentinstead ofinnerHTMLto strip HTML tags.
Call API endpoint
Send a POST request to https://api.hd44live.cc/v1/audio/speech with your JSON body. Include your Authorization: Bearer key and specify parameters like model and voice. The API returns the audio file directly in the response body.
- Set
response_formattomp3orwavfor broad compatibility.
Play audio element
Create a new Blob from the response body and generate an object URL using URL.createObjectURL(). Assign this URL to an <audio> element's src attribute. Call audio.play() to start playback immediately.
Handling Long Text
The API accepts a maximum of 4096 characters per request. For longer texts, you must split the input string into smaller chunks before sending them sequentially.
Each chunk generates a separate audio file. Your application needs to concatenate these files to create a single continuous playback experience for the user.
Split into chunks
Divide your input text into segments of 4096 characters or less. Ensure you do not split words in the middle to maintain natural speech flow.
- Check string length before each API call
- Preserve word boundaries during splitting
- Handle punctuation gracefully
Concatenate audio
Receive audio blobs from each request. Use the Web Audio API or HTML5 Audio elements to sequence these files. Ensure seamless transitions by removing silence gaps between chunks.
- Use AudioContext for precise timing
- Decode audio buffers efficiently
- Play files sequentially without delay
Manage memory
Long texts can generate many audio files. Revoke object URLs for processed chunks to prevent memory leaks.
- Revoke object URLs after playback
- Process chunks in batches
- Monitor memory usage in dev tools
Accessibility Features
Integrating text-to-speech into web apps requires more than just audio playback; it demands seamless interaction for users relying on assistive technologies. FlowSpeak’s API enables developers to build accessible interfaces where audio generation complements standard navigation patterns without disrupting the user experience.
By focusing on clear, predictable audio outputs, you ensure that content remains consumable regardless of the user’s primary input method. This section outlines practical steps to enhance keyboard and screen reader compatibility.
Keyboard navigation
Ensure that the TTS trigger buttons are fully accessible via the Tab key. Assign explicit tabindex attributes and ensure focus order matches the visual layout. When a user activates speech synthesis, visually indicate the active state so keyboard users know which element is controlling playback.
Use standard ARIA roles like button or link to allow navigation via Enter or Space keys. This ensures that users who cannot use a mouse can still initiate audio generation and manage playback states effectively.
- Tab index must follow visual reading order.
- Enter key triggers speech synthesis.
- Space key toggles playback states.
Screen reader tags
Announce the start and end of audio generation using aria-live regions. This ensures screen readers notify users when speech is being processed or when the audio file is ready to play. Avoid announcing the raw character count; instead, provide context like 'Audio generated for section title.'
Use aria-label on controls to describe their function clearly, such as 'Play narration' or 'Pause audio.' This prevents confusion for users who rely on audio cues rather than visual inspection of the interface.
- Use aria-live='polite' for status updates.
- Label buttons with clear action verbs.
- Announce completion of long texts.
Pause/Resume controls
Provide explicit controls to pause and resume audio playback. Ensure these controls are distinct from the play button and maintain their state correctly. This allows users to review content at their own pace without losing their place.
Support keyboard shortcuts for pause and resume, such as the Spacebar or arrow keys, if not already used for navigation. Consistency in control behavior helps users build muscle memory and reduces cognitive load when navigating complex content.
- Pause button must be tab-accessible.
- Resume restores playback position.
- Maintain state during navigation.
Performance Tips
Improving TTS integration in JavaScript apps often comes down to reducing wait times and minimizing API calls. By strategically managing how audio is requested and stored, you can ensure a smoother user experience, especially for accessibility-focused web applications that rely on consistent audio feedback.
Leveraging browser caching and preloading techniques helps keep your app responsive. Since FlowSpeak generates audio on demand, smart request handling prevents unnecessary network overhead while keeping memory usage low for longer text sequences.
Preload audio
Use the <audio> element’s preload attribute to fetch audio files before they are needed. This reduces initial latency when a user triggers speech synthesis, particularly useful for interactive elements like buttons or navigation aids.
For short phrases, consider preloading common voice outputs during idle time. This ensures instant playback without waiting for the generation to complete.
- Set
preload="auto"on audio elements for critical UI sounds. - Preload short, frequently used phrases during window idle events.
Cache responses
Store generated audio URLs in localStorage or IndexedDB if the same text is likely to be repeated. Since FlowSpeak does not store audio server-side, caching locally avoids redundant API calls and saves your character quota.
Implement a simple cache key based on the text input, voice, and format. This ensures that identical requests return the cached file instantly, improving perceived performance for users with dyslexia who may re-read the same content.
- Cache audio files keyed by text+voice+format.
- Use IndexedDB for larger audio blobs to avoid storage limits.
- Invalidate cache when voice or format settings change.
Optimize requests
Batch text into single requests under the 4096-character limit to reduce the number of API calls. Since requests are processed sequentially, fewer requests mean less queueing time under load.
Avoid redundant requests by checking if the text has already been synthesized. Use the 60 requests-per-minute limit wisely by prioritizing user-initiated actions over background tasks.
Consider using fetch with cache: 'force-cache' or cache: 'only-if-cached' for known static content to bypass the network entirely when appropriate.
- Combine text segments under 4096 characters per request.
- Monitor the 60 requests/minute limit to avoid throttling.
- Use
fetchwith cache headers for repeated content.
Error Recovery
Reliable error handling ensures your TTS feature degrades gracefully when things go wrong. Since requests are processed sequentially, temporary delays are normal, but persistent failures require clear user feedback.
Network failures
If the user loses connectivity, the fetch request will reject. Catch these errors and display a simple message indicating that audio generation is temporarily unavailable. Do not spam the endpoint; wait for the connection to restore before retrying.
Rate limits
The API enforces a limit of 60 requests per minute per key. New accounts start with 10 requests per minute. If you exceed this, the API returns a 429 status code. Your application should detect this response and pause further requests until the window resets.
- Monitor the 'Retry-After' header if provided.
- Display a 'Wait a moment' indicator to users.
- Avoid immediate re-requests in a tight loop.
Retry logic
Implement exponential backoff for transient errors. Start with a short delay (e.g., 1 second) and double it for each subsequent attempt up to a maximum of three retries. This prevents overwhelming the server during brief outages or high load periods.

Code Example
This example demonstrates a minimal, accessible interface for converting text to speech. It ensures keyboard navigation works by allowing users to focus the input field and trigger generation via the Enter key or button click.
The script handles the API call, processes the audio response, and manages playback state. It includes basic error handling for network issues and rate limits, ensuring a smooth experience for indie developers building accessible web apps.
HTML structure
The interface consists of a <textarea> for input text and a <button> to trigger synthesis. An <audio> element is used to play the generated speech, ensuring standard browser controls are available for pause and volume adjustment.
- Use
aria-labelfor accessibility. - Include
placeholdertext for guidance. - Add
disabledstate during loading.
JavaScript logic
The script sends a POST request to https://api.hd44live.cc/v1/audio/speech with the text and voice parameters. It handles the binary response by creating a blob URL and assigning it to the audio element's src attribute.
- Set
Authorizationheader with your key. - Handle
429rate limit errors. - Reset audio
srcon new generation.
CSS styling
Simple, clean styles ensure the interface remains unobtrusive. Focus states are clearly defined for keyboard users, and the audio controls are styled to match the app's theme without overriding native browser accessibility features.
Browser Support
The FlowSpeak API is a standard REST endpoint, meaning it works in any JavaScript environment that supports fetch. Browser support depends entirely on the Web Audio API and HTML5 <audio> elements used to play the returned files.
Chrome/Firefox
Both Chromium-based browsers and Firefox fully support the required HTML5 audio elements and Web Audio API. They handle mp3, wav, opus, and flac formats.
Safari compatibility
Safari supports mp3 and wav formats reliably. The opus format may require a polyfill or format fallback in older versions, while flac support is consistent in recent releases. Ensure your player handles format fallbacks gracefully.
Mobile browsers
Mobile browsers on iOS and Android support the same web standards. However, audio autoplay policies may require a user gesture before playing the synthesized speech. Test playback interactions on actual devices to ensure smooth user experience.
- Use user gestures to trigger audio playback
- Test mp3 and wav formats on mobile
- Verify autoplay policies on iOS Safari
Testing Strategy
Testing your text-to-speech integration ensures reliability across different environments. Since FlowSpeak returns audio files via HTTP, validation focuses on response integrity and character counting rather than subjective audio quality.
A robust strategy combines automated checks for API behavior with manual verification of the user experience. This ensures that both the technical endpoint and the accessibility features function correctly under load.
Unit tests
Verify that the JavaScript logic correctly formats the JSON request body, including the model, voice, and input text fields. Ensure that the character count calculation matches the API’s definition, where spaces and punctuation are included. Validate that the response parser correctly handles different audio formats like mp3 or wav.
Check that the speed parameter is clamped between 0.25 and 4.0. Confirm that the code correctly extracts the audio blob from the response and prepares it for the audio element source.
- Validate JSON structure before sending
Integration tests
Simulate the full workflow: sending a POST request to https://api.hd44live.cc/v1/audio/speech and receiving the audio file. Verify that the correct Authorization header is used with the Bearer token. Ensure that the audio plays correctly in the browser without CORS issues.
Test edge cases such as empty input, maximum character limits (4096 characters), and invalid voice names. Confirm that failed requests do not consume balance and that the error messages are handled gracefully.
User testing
Have users with screen readers verify that the audio controls are accessible via keyboard. Test the pause and resume functionality to ensure it works as expected. Gather feedback on voice clarity and language support for specific use cases.
Common Pitfalls
Adding text-to-speech to JavaScript apps seems straightforward, but small oversights can break the experience. Developers often hit invisible walls regarding character counts, encoding nuances, and format compatibility that aren't immediately obvious in the console.
This section highlights three frequent pitfalls specific to the FlowSpeak API to help you avoid common integration errors early in development.
Character limits
The API enforces a strict 4096-character limit per request. If your input exceeds this, the request will fail silently or return an error depending on your error handling. Remember that spaces and punctuation count toward this total. For longer texts, you must split the input into chunks before sending them to the endpoint.
Be aware that splitting text arbitrarily can cut sentences in half, leading to awkward audio playback. Always split at sentence boundaries or whitespace to ensure natural pausing between generated audio files.
- Max 4096 characters per request
- Spaces and punctuation count
- Split at sentence boundaries
Encoding issues
Ensure your text is UTF-8 encoded before sending it in the JSON body. Special characters, emojis, or non-Latin scripts like Arabic or Chinese may cause silent failures or garbled audio if the encoding is incorrect. The API does not auto-detect encoding errors.
If you are fetching text from external sources, verify the character set matches the API expectations. Mismatched encoding can result in incorrect character counts or rendering issues in the final audio output.
- Use UTF-8 encoding
- Verify special characters
- Check external source encoding
Audio formats
Choose your response_format wisely. MP3 is widely supported but may introduce compression artifacts. WAV and FLAC offer lossless quality but result in larger file sizes and slower transfer times. PCM is raw and uncompressed.
Consider the trade-offs between file size and quality. For web apps, MP3 is usually sufficient, but for high-fidelity requirements, FLAC might be preferable. Ensure your audio player supports the selected format to avoid playback issues.
- MP3 for web compatibility
- FLAC for lossless quality
- PCM for raw data
Future Proofing
FlowSpeak maintains backward compatibility, but you should monitor the /v1/models endpoint for structural changes. Since we do not provide a proprietary SDK, your integration relies on standard HTTP requests, making version checks straightforward without external dependencies.
SDK updates
As the community adopts the OpenAI-compatible format, third-party wrappers may update. We recommend pinning your dependency versions to avoid unexpected breaking changes during routine updates.
- Pin library versions
- Monitor community repos
API changes
We version the API at /v1. Future endpoint additions will not disrupt existing /v1/audio/speech calls. Check the documentation for any new optional parameters like enhanced language codes.
Voice updates
The eight current voices are stable. If we add new presets, they will appear in the /v1/voices list without changing existing voice IDs, ensuring your code remains valid.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Failed requests are free, ensuring you only pay for successful synthesis.
23 languages
Any voice speaks any of these languages.
