What is a Text-to-Speech API and How Does it Work?

By VoxPublic editorial team · Updated 2026-11-19

This guide explains how cloud text-to-speech APIs convert written text into audio files via simple HTTP requests, designed for public sector teams and non-profits evaluating large-scale audio generation. You will learn the technical workflow from input validation to audio delivery, covering model selection, voice presets, and language support mechanisms that ensure compliance and predictability for government services and NGOs.

Readers will understand how to integrate the API using standard OpenAI SDKs or cURL, calculate costs based on character usage, and manage rate limits for high-volume deployments. We detail data privacy policies, supported audio formats, and common use cases like multilingual announcements and accessibility compliance, helping your team make informed decisions about switching vendors without technical lock-in.

What is a Text-to-Speech API and How Does it Work?

Frequently asked questions

Is the API real-time or batch processed?

Requests are processed sequentially, not in real-time. Under load, requests may wait in a queue. Typical speed is roughly real-time for long texts, but short phrases take a few seconds.

Does the API support SSML tags?

No. The API accepts plain text input up to 4096 characters. It does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You must rely on the natural intonation of the selected voice preset for pacing and emphasis.

Can I customize the voice tone?

No. You select from eight fixed presets (e.g., aria, nova, felix). Each voice has a defined character, such as 'warm' or 'deep,' but you cannot adjust emotion tags, pitch, or tone parameters. The voice is determined by the model and preset.

Is the audio generation instantaneous?

No. Requests are processed one after another. Short phrases take a few seconds; long texts generate at roughly real-time speed. During high load, requests may queue, causing delays. Failed requests are free, but successful synthesis takes time to complete.

Do I need to install software on my server?

No. It is a cloud API. Send a POST request to the endpoint with your text and receive an audio file. You can use the official OpenAI SDKs by changing the base URL, or use plain HTTP. No local software is required.

How long does synthesis take for long texts?

Long texts are split into 4096-character parts and joined. Generation speed is roughly real-time (25 characters per second). Short phrases take a few seconds. Under load, requests queue, so total time depends on current server traffic and text length.

Is the API secure for government data?

Input text is used only for audio production and not for training. Generated audio is returned and not stored. Request metadata is kept for billing. However, there is no SLA, uptime guarantee, or specific certification (like SOC 2 or HIPAA) offered.

Can I use the API for commercial projects?

Yes. There are no restrictions on usage type. You pay $0.01 per 1,000 characters. Failed requests are free. You can use any of the eight voices for commercial purposes without additional fees.

What happens if the server is down?

There is no official SLA or uptime guarantee. If the server is unavailable, requests will fail. Failed requests are free, so you are not charged for unsuccessful attempts. You can retry later when the service is restored.

Is there a limit to the number of voices?

Yes. There are exactly eight voice presets available: aria, nova, luna, sage, felix, milo, atlas, and orion. You can switch between them in each request, but no other voices are available. Each voice can speak any of the 23 supported languages.

Do I need to pay for each voice used?

No. The price is $0.01 per 1,000 characters of input text, regardless of which voice you select. All eight voices use the same engine and pricing structure. There are no per-voice fees or minimum spend requirements.

Can I mix voices in one request?

No. Each request specifies a single voice preset. To use multiple voices, you must send separate requests for each segment and join the resulting audio files. The API does not support dynamic voice switching within a single audio generation.

Is the watermark visible in the audio?

No. Every generated file carries an inaudible watermark that marks it as synthetic speech. It is not visible or audible to the listener. It serves as a marker for synthetic content without affecting the audio quality or user experience.

Does the API support multiple languages in one text?

No. Each request supports a single language specified by the optional ISO code. If not set, Latin script defaults to English. You must split multilingual texts into separate requests for each language and join the audio files manually.

Definition of a Cloud TTS API

Sound wave illustration for: Definition of a Cloud TTS API

A Text-to-Speech API is a cloud service that converts written text into audible audio files. For public sector teams and non-profits, it provides a standardized way to generate large-scale audio from digital content without managing physical infrastructure.

The system accepts text input via a simple API call and returns a synthesized audio file. This eliminates the need for specialized hardware, allowing integration directly into existing web portals or internal communication systems.

Input Text to Audio Conversion

The core function is converting raw text into spoken audio. Users send a string of text, up to 4096 characters, to the endpoint. The service processes this input and returns an audio file in the requested format, such as MP3 or WAV.

RESTful Architecture

The API uses standard RESTful principles over HTTP. Requests are sent via POST to the speech endpoint, with parameters defined in JSON. This structure ensures compatibility with standard development tools and simplifies integration for technical teams familiar with web services.

Stateless Request Processing

Each request is processed independently. The server does not maintain session state between calls, meaning every synthesis task is self-contained. This design allows for easy scaling and predictable billing, as each character count is calculated individually per request.

How the Engine Generates Audio

Sound wave illustration for: How the Engine Generates Audio

The engine processes requests through a straightforward pipeline: validation, synthesis, and delivery. Clients select a model and voice preset, then submit text via JSON. The system generates audio files that are returned immediately upon completion.

Model Selection (tts-1 vs tts-1-hd)

Both "tts-1" and "tts-1-hd" use the same underlying engine and pricing. The choice affects only the output quality tier, not the processing logic or cost structure. Teams can switch models without changing their integration code.

Voice Preset Application

The API applies one of eight licensed voice presets to the input text. These voices are based on recordings from LibriTTS-R and LibriVox. Each preset provides a distinct tonal character suitable for specific public sector or non-profit use cases.

Synthesis Process

Text is converted into audio sequentially. Longer texts are split into 4,096-character segments and joined. The process is not real-time; generation typically matches real-time speed, meaning one second of audio takes approximately one second to produce.

Data Flow and Processing

Sound wave illustration for: Data Flow and Processing

The API processes input text through a strict validation step before synthesis begins. Text must not exceed 4,096 characters per request. If a document is longer, it must be split into multiple requests and the resulting audio files joined by the client application. This ensures predictable processing and avoids engine timeouts during large-scale batch jobs.

Each character, including spaces and punctuation, is counted toward the usage limit. The system validates the input format and checks for available balance before initiating the synthesis queue. Failed requests incur no charge, ensuring accurate cost tracking for government and NGO budgeting.

Text Input Validation

Text must not exceed 4,096 characters per request. If a document is longer, it must be split into multiple requests and the resulting audio files joined by the client application.

The system validates the input format and checks for available balance before initiating the synthesis queue.

Character Count Calculation

Each character, including spaces and punctuation, is counted toward the usage limit.

This precise counting ensures accurate cost tracking for large-scale audio generation projects.

Audio Output Return

Failed requests incur no charge, ensuring accurate cost tracking.

The API returns the generated audio file in the specified format, ready for immediate playback or archival.

Voice Models and Presets

Sound wave illustration for: Voice Models and Presets

VoxPublic provides eight distinct voice presets designed for public sector and non-profit applications, ensuring clear and professional audio output. Each voice is derived from licensed recordings, offering a reliable baseline for large-scale audio generation without the need for custom voice cloning.

Female Voice Options

The female voices cater to diverse communication styles, from warm narration to instructional clarity. Teams can select based on the specific tone required for announcements or educational content.

  • aria: warm, clear narrator
  • nova: bright, upbeat
  • luna: soft, storytelling
  • sage: calm, instructional

Male Voice Options

Male voices offer options ranging from energetic promotional styles to neutral news delivery. These presets are optimized for clarity and consistency across different language contexts.

  • felix: energetic, promo
  • milo: friendly, conversational
  • atlas: neutral, news
  • orion: deep, documentary

Tone and Style Differences

Each preset carries a distinct tonal character, allowing teams to match audio output to their brand or institutional voice. All voices support the full range of 23 languages, ensuring consistent quality regardless of the target audience.

Language Support Mechanisms

Sound wave illustration for: Language Support Mechanisms

A Text-to-Speech API converts written text into audible speech files via a simple API call. The process begins with input validation, where the system checks the character count and supported language scripts before initiating synthesis.

The engine applies the selected voice preset to the text, generating audio in the requested format. Results are returned immediately, allowing for seamless integration into public sector workflows and NGO content pipelines.

Automatic Script Detection

The API attempts to guess the language from the text script. Latin script defaults to English, while other scripts trigger their respective languages. This simplifies integration for common use cases.

Manual Language Specification

For non-English Latin text, set the language field explicitly to ensure accuracy. Supported languages include Arabic, Chinese, French, German, Hindi, Japanese, Korean, Spanish, and others across 23 total options. This prevents mispronunciation in multilingual documents.

Unsupported Languages

Voices cannot speak Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali, or languages outside the 23 supported options. If your content includes these, you must plan for external translation or different processing steps.

  • Vietnamese
  • Indonesian
  • Thai
  • Ukrainian
  • Romanian
  • Czech

Audio Format Options

Sound wave illustration for: Audio Format Options

Selecting the correct audio format is critical for balancing playback quality, file size, and compatibility across different public sector platforms. Our API supports MP3, WAV, OPUS, FLAC, and PCM, allowing teams to choose the optimal container for their specific infrastructure needs.

Understanding the trade-offs between compression and fidelity ensures efficient storage and delivery, especially when handling large volumes of accessibility content or multilingual announcements for diverse user bases.

MP3 for Web Delivery

MP3 is the standard for web-based audio players and mobile applications. It offers a consistent balance between file size and acceptable audio quality, making it ideal for general public announcements, website accessibility widgets, and on-demand listening experiences.

This format is widely supported across all modern browsers and devices, requiring minimal additional codec configuration for end-users.

  • Ideal for general web playback
  • Small file size reduces bandwidth costs
  • Universal device compatibility

WAV for Archival

WAV provides uncompressed, lossless audio, preserving the full fidelity of the generated speech. This format is best suited for long-term archival, high-quality broadcasting, or integration with legacy government systems that require pristine audio data.

While files are larger, the absence of compression artifacts ensures the voice remains clear and distinct during future processing or re-mastering.

  • Lossless, uncompressed quality
  • Best for archival storage
  • Higher bandwidth usage

OPUS for Bandwidth Efficiency

OPUS is a highly efficient codec designed for minimal bandwidth consumption. It is particularly useful for mobile applications or regions with limited internet connectivity where data usage is a primary concern.

This format maintains good audio quality at significantly smaller file sizes compared to WAV, making it cost-effective for large-scale distribution.

  • High compression efficiency
  • Low bandwidth consumption
  • Suitable for constrained networks

Rate Limiting and Concurrency

Sound wave illustration for: Rate Limiting and Concurrency

Rate limits are enforced per API key, not per account or IP. This ensures fair usage across concurrent workers in large deployments.

60 Requests per Minute

Standard accounts process 60 requests per minute. New keys start at 10 requests per minute until the first top-up is confirmed. This cap prevents sudden bursts from overwhelming the synthesis engine.

  • Limit: 60 req/min per key
  • New key limit: 10 req/min
  • Reset: Real-time sliding window

Queue Processing Order

Requests are processed sequentially within the limit. Under heavy load, additional requests wait in a queue. This ensures order but may introduce latency during peak usage periods.

Impact on Large Teams

Large teams should distribute keys across different worker processes. Each key has its own 60 req/min limit. Splitting traffic across multiple keys allows higher aggregate throughput without hitting individual limits.

  • Use multiple keys for parallel processing
  • Monitor usage in the dashboard
  • Top-up increases reliability

Cost Calculation Method

Sound wave illustration for: Cost Calculation Method

Understanding the cost structure is essential for budgeting large-scale audio generation in public sector projects. Our API uses a transparent, per-character billing model that eliminates unexpected charges. You pay only for the text successfully converted into audio, with clear visibility into your usage via the dashboard.

This approach ensures cost predictability, allowing teams to forecast expenses accurately. Whether generating short announcements or lengthy document narrations, the pricing remains consistent and straightforward.

Per Character Billing

The standard rate is $10 per 1 million characters, which equals $0.01 per 1,000 characters. This uniform pricing applies regardless of voice selection or model choice. You can monitor your balance and character consumption in real-time through the account dashboard.

  • Rate: $10 per 1,000,000 characters

Space Inclusion

Every character in your input text counts toward the total, including spaces and punctuation marks. For example, a simple phrase like 'Hello world' includes the space between the words in the character count. This ensures accurate billing without hidden fees for formatting elements.

Failed Request Credits

If a synthesis request fails due to server errors, you receive a full refund for that request. Failed requests do not consume your credit balance. This protects your budget from technical issues during high-volume processing.

Integration with Existing Systems

Sound wave illustration for: Integration with Existing Systems

VoxPublic’s API is designed for immediate adoption by government teams already using standard libraries. By setting the base URL to https://api.ic555.info/v1, your existing OpenAI SDK clients can route requests without code refactoring, ensuring a smooth transition from evaluation to production deployment.

For teams preferring lightweight solutions, simple cURL scripts handle POST requests efficiently. This approach bypasses complex dependency trees, allowing quick integration into legacy internal systems or automated batch processing pipelines that generate audio files for public announcements or accessibility updates.

OpenAI SDK Compatibility

The API mirrors the request shape of the OpenAI speech endpoint. This means you can reuse existing authentication logic and client configurations, reducing the learning curve for engineering teams managing large-scale audio generation workflows.

Changing the base_url to https://api.ic555.info/v1 allows immediate use of official OpenAI SDKs, ensuring consistent error handling and retry logic without requiring custom middleware development.

  • Same JSON body structure as OpenAI speech endpoint
  • Supports standard OpenAI SDK clients
  • No custom client library required (uses OpenAI SDKs)

cURL Scripting

For lightweight integration, standard cURL commands can send text and receive audio files directly. This is ideal for simple automation tasks, such as converting static text into audio for daily briefings or emergency alerts.

The JSON body includes fields like model, input, voice, and response_format, allowing precise control over output characteristics without needing a full SDK dependency in your deployment environment.

Webhook vs Polling

Since requests are processed sequentially, long texts may require splitting into parts under 4096 characters. The API returns audio files directly in the response.

For batch processing, teams can poll the status of individual synthesis tasks if needed, but the synchronous response model simplifies debugging and ensures immediate audio delivery for most public sector applications.

Data Privacy and Usage

Sound wave illustration for: Data Privacy and Usage

VoxPublic’s API is designed for public sector and non-profit teams that need clear data boundaries. When you send text for synthesis, that input is used strictly to produce the audio file. It is not stored after delivery, nor is it used to train our voice models. This ensures that sensitive announcements or internal documents remain private during processing.

Input Text Retention

Input text is processed only to generate the audio and is not retained for training purposes. While the text itself is not stored long-term, we keep request metadata—including timestamp, character count, and status—for billing and audit verification. This ensures transparency in usage without compromising the content of your documents.

  • Input text is used only to produce the audio and is not stored.
  • Metadata (time, characters, status) is kept for billing.
  • No long-term retention of original document content.

Audio Storage Policy

Generated audio files are returned directly in the API response. We do not store the resulting audio files on our servers after delivery. You retain full ownership of the output, and no copies are kept for internal use or model improvement. This eliminates vendor lock-in concerns regarding your generated assets.

  • Audio is returned in the response only.
  • No storage of generated audio files.
  • Full ownership of output assets.

Training Data Exclusion

Unlike some consumer-grade TTS services, we do not use your input text or generated audio to improve our models. Your data remains yours. This policy supports compliance requirements for government and non-profit entities that need to ensure their proprietary or sensitive text is not ingested into training datasets.

  • Input text is not used for training.
  • Generated audio is returned in the response and not stored.
  • Supports data privacy requirements.

Common Use Cases

Sound wave illustration for: Common Use Cases

Text-to-Speech APIs enable public sector teams and non-profits to convert large volumes of text into audio efficiently, supporting compliance and engagement goals.

By leveraging cloud-based synthesis, organizations can distribute audio content across multiple languages and accessibility standards without maintaining complex infrastructure.

The API’s character-based billing and predictable costs make it suitable for high-volume usage scenarios typical in government and NGO sectors.

Multilingual Announcements

Public services often need to communicate with diverse populations. Our API supports 23 languages, allowing teams to generate announcements in Arabic, Chinese, Spanish, Hindi, and other languages without hiring multiple voice actors.

Each voice preset can handle any supported language, ensuring consistent quality across different regions. For example, the 'aria' voice provides clear narration for emergency alerts in English, while 'nova' offers an upbeat tone for community updates in Japanese.

  • Support for 23 languages including Arabic, Chinese, Spanish, Hindi, and more.
  • Consistent audio quality across all supported languages.
  • Ideal for emergency alerts, community updates, and public service announcements.

Accessibility Compliance

Accessibility standards like WCAG require digital content to be accessible to users with visual impairments or reading difficulties. A TTS API allows organizations to convert text-based content into audio format, ensuring compliance with these regulations.

By integrating the API into their websites and applications, teams can provide audio alternatives for text content, improving accessibility for a broader audience.

The API’s ability to generate audio in various formats (MP3, WAV, OPUS) ensures compatibility with different assistive technologies and devices.

  • Converts text to audio for WCAG compliance.
  • Compatible with various assistive technologies and devices.
  • Supports multiple audio formats for diverse use cases.

Content Localization

Non-profits and government agencies often operate in multiple regions, requiring content to be localized for different audiences. The API simplifies this process by allowing teams to generate audio content in multiple languages quickly and cost-effectively.

With a character-based billing model, organizations can scale their localization efforts without worrying about high fixed costs. This makes it feasible to produce audio content for a wide range of languages and dialects.

The API’s stateless request processing ensures that each translation is generated independently, allowing for flexible and scalable localization workflows.

  • Cost-effective localization for multiple languages.
  • Scalable workflows with character-based billing.
  • Independent generation of audio content for each language.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This means the audio files themselves do not accumulate in our long-term storage, reducing the attack surface for potential data breaches.

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. MDN: Web Speech API
  3. FFmpeg documentation
  4. openai-python on GitHub
  5. LibriTTS-R corpus (OpenSLR 141)
  6. Node.js documentation
  7. Tether (USDT)
  8. Python documentation
  9. W3C WAI: making audio and video accessible
  10. openai-node on GitHub
  11. TRON developer hub: TRC-20
  12. LibriVox public-domain audiobooks

More on this site