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

By CivicVoice editorial team · Updated 2026-11-18

A Text-to-Speech (TTS) API is a cloud service that converts written text into audio files. Instead of managing complex infrastructure, developers send a JSON request containing their text and receive a synthesized audio file in return. This model allows teams to generate clear, natural-sounding speech for multilingual communities without hiring voice actors or maintaining servers.

This page explains how the CivicVoice API works for government agencies and NGOs. We cover the technical requirements, such as API keys and JSON bodies, and outline practical use cases like accessibility and content repurposing. You will also learn about pricing, limitations, and how to make your first request to start converting plain text into audio efficiently.

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

Frequently asked questions

What is a text-to-speech API?

A cloud text-to-speech API converts text into audio files. You send a POST request with your text and receive an audio response. It uses standard endpoints compatible with OpenAI SDKs, allowing developers to integrate speech synthesis into applications without managing complex infrastructure or hardware.

How does a TTS API work?

Send a JSON POST request to the /v1/audio/speech endpoint. Include your text, voice selection, and format. The system processes the request and returns the audio file. For long texts, split input into 4096-character chunks and join the resulting audio files sequentially.

What are the benefits of a TTS API?

It provides instant audio generation for 23 languages using eight distinct voices. Requests are processed quickly, with typical speed matching real-time generation. The API supports multiple formats and allows speed adjustments, making it suitable for diverse accessibility needs and multilingual content delivery.

What are the limitations of a TTS API?

Input is limited to 4,096 characters per request. Voices are fixed presets without custom cloning or emotion tags. There is no streaming, SSML, or phoneme dictionary support. Audio is generated in full chunks, and requests are processed sequentially, which may cause queuing under load.

How do I integrate a TTS API?

Use the official OpenAI SDKs by changing the base_url to https://api.playfb7.com/v1. Authenticate with your Bearer token. Send a POST request to /v1/audio/speech with your text and parameters. Alternatively, use plain HTTP requests with the same JSON structure for flexibility.

What are the security features?

Each account has one active API key, which can be revoked instantly to issue a new one. Input text is used only for synthesis and not for training. Generated audio is returned in the response and not stored. Request metadata is kept solely for billing.

How does it compare to human reading?

Generated audio carries an inaudible watermark marking it as synthetic. The voices are based on licensed recordings from LibriTTS-R and LibriVox. While clear and consistent, it lacks the nuanced emotion and improvisation of human readers, offering a reliable, standardized alternative for consistent content delivery.

What languages are supported?

Our API supports 23 languages, including English, Spanish, French, German, Arabic, Chinese, Japanese, and Hindi. Any voice can speak any supported language. If the language parameter is omitted, the system guesses the language from the script, defaulting to English for Latin text. Unsupported languages include Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, and Bengali.

What audio formats are available?

You can choose from mp3, wav, opus, flac, and pcm formats. Select the format via the response_format field in your request. This allows flexibility for different playback environments, from web browsers to professional audio editing workflows, without additional conversion steps.

What is the cost?

The rate is $10 per 1 million characters ($0.01 per 1,000 characters), including spaces and punctuation. Failed requests incur no charge. There are no monthly plans, subscriptions, or minimum spends. We accept USDT on the TRON network (TRC-20) with a $5 minimum top-up. Accounts start with a $0.50 trial credit if you sign in with Google; email accounts begin with zero balance.

Is there a free trial?

Yes. Signing in with Google provides $0.50 of credit, valid for 7 days. Email-based accounts start without trial credit. This allows testing the API with approximately 50,000 characters. Top-ups are available via USDT, with balances that do not expire after the trial.

How do I get an API key?

Visit the /get-api-key/ page and sign up using Google or email. The dashboard displays your key, balance, and usage stats. Keys are unique per account. You can issue a new key at any time, which immediately invalidates the previous active key.

What is the rate limit?

The limit is 60 requests per minute per key. Before the first top-up, the limit is 10 requests per minute. Requests are processed sequentially, so high volume may cause queuing. Monitor your usage via the dashboard to stay within these constraints.

Is data used for training?

Input text is used only to produce the audio and is not used for training models. Generated audio is returned in the response and not stored. Request metadata, such as time and status, is kept for billing purposes only.

Definition of TTS API

Sound wave illustration for: Definition of TTS API

CivicVoice is a cloud-based text-to-speech API designed for government agencies and NGOs. It converts plain text into clear, human-like audio files, enabling teams to make digital content accessible for multilingual communities without complex infrastructure.

Text Input

The service accepts plain text strings via a simple JSON body. You can send up to 4,096 characters per request, which covers most standard paragraphs or short documents. Spaces and punctuation count toward this limit.

Audio Output

Synthesized audio is returned in standard formats including MP3, WAV, Opus, FLAC, or PCM. Each file contains an inaudible watermark marking it as synthetic speech. The output is ready for immediate playback or archival.

Cloud-Based Service

Processing happens on our servers, not locally. You send text via a POST request, and receive the audio file in response. This removes the need for local hardware upgrades or software installations, keeping infrastructure simple.

How It Works

Sound wave illustration for: How It Works

A Text-to-Speech API transforms written content into audible audio files through a straightforward cloud-based workflow. The process begins when an application sends a structured request to the API endpoint, specifying the text, voice model, and desired audio format. This submission initiates the conversion engine without requiring complex infrastructure on the client side.

The system then processes the input text, synthesizing it into audio at roughly real-time speed. Once generation is complete, the resulting audio file is delivered directly in the response. If synthesis fails, the character count is not charged, ensuring accurate billing for high-volume deployments.

Request Submission

Clients submit text via a POST request to the /v1/audio/speech endpoint. The JSON body includes the input text (up to 4096 characters), the chosen voice model (tts-1 or tts-1-hd), and the target audio format such as mp3 or wav. An authentication header with the API key validates the request.

For texts exceeding 4096 characters, the client must split the input into smaller segments, process each individually, and then join the resulting audio files to create a continuous track.

  • JSON payload with input text, voice, and format
  • Bearer token authentication via Authorization header
  • Optional language parameter for non-English Latin scripts

Processing

The API processes requests sequentially, synthesizing audio at roughly real-time speed (25 characters per second). Under load, requests may queue, meaning longer texts may take additional time to generate. Each request is evaluated independently, and failed synthesis results in a full refund of the character charge.

The engine supports 23 languages, allowing any voice preset to speak any supported language. If the language parameter is omitted, the system guesses based on the script, defaulting to English for Latin text.

  • Sequential processing with potential queuing under load
  • Real-time synthesis speed (~25 chars/sec)
  • Automatic language detection or explicit language code

Response Delivery

Upon successful synthesis, the API returns the audio file directly in the HTTP response. The file format matches the requested specification (mp3, wav, opus, flac, or pcm). Generated audio is not stored on the server, ensuring that input text is used only for the immediate conversion.

The response includes metadata such as the character count processed and the time taken. This data is retained for billing purposes but does not affect the audio content delivered to the client application.

  • Direct audio file return in response body
  • No server-side storage of generated audio
  • Metadata included for billing and debugging
How It Works

Use Cases

Sound wave illustration for: Use Cases

Text-to-speech APIs convert written content into audio files, enabling digital services to deliver information through sound rather than just text. By sending a JSON payload to a cloud endpoint, applications receive synthesized audio in formats like MP3 or WAV, making static content accessible to a broader audience without requiring complex infrastructure.

Accessibility

Government agencies and NGOs use TTS to make public documents, emergency alerts, and educational materials accessible to visually impaired users or those with reading difficulties. With support for 23 languages, including Arabic and Swahili, organizations can serve diverse linguistic communities effectively. The API handles language detection or allows explicit specification, ensuring accurate pronunciation across different scripts.

Content Repurposing

Teams can quickly convert blog posts, reports, or meeting notes into audio files for podcasts or internal newsletters. This workflow allows content creators to reach audiences who prefer listening while commuting or working. With a character limit of 4096 per request, longer texts are split and joined seamlessly, maintaining continuity without manual editing.

Language Learning

Educational tools leverage TTS to provide pronunciation examples for students learning new languages. Developers can integrate voices like Aria or Felix to demonstrate natural speech patterns. Since any voice can speak any supported language, learners can hear consistent quality across different languages without needing native speaker recordings for every topic.

Technical Requirements

Sound wave illustration for: Technical Requirements

To use CivicVoice, you need a stable internet connection and a valid API key. The service is cloud-based, so all processing happens on our servers. You do not need to install any local software or manage hardware infrastructure.

Internet Connection

A reliable internet connection is required to send requests and receive audio files. Since the synthesis happens in the cloud, your local machine only handles the input text and the final audio download.

API Key

Authentication is handled via a Bearer token in the Authorization header. You receive one active key per account, which you can retrieve from your dashboard. If needed, you can issue a new key, which immediately invalidates the old one.

JSON Body

Requests are sent as JSON to the POST https://api.playfb7.com/v1/audio/speech endpoint. You must include the model, input text, voice preset, and response_format. The input field accepts up to 4096 characters.

Benefits

Sound wave illustration for: Benefits

A TTS API transforms text into audio files via simple HTTP requests, eliminating the need for dedicated hardware. This cloud-native approach allows government agencies and NGOs to scale audio generation instantly, handling everything from daily briefing updates to large-scale accessibility projects without infrastructure bottlenecks.

Cost efficiency is driven by a transparent usage model: $0.01 per 1,000 characters. Failed requests are refunded entirely, ensuring you pay only for successful audio generation. With a $0.50 free trial and balance that does not expire, teams can test workflows without financial risk.

Scalability

The API handles variable workloads seamlessly. With a limit of 60 requests per minute per key, you can generate substantial audio volumes. If higher throughput is needed, issuing a new API key instantly activates a separate quota, allowing parallel processing without waiting for the previous key to reset.

  • Supports up to 4,096 characters per request
  • Process longer texts by splitting and joining audio files
  • Automated billing tracks usage for easy scaling

Cost Efficiency

Pricing is straightforward: $10 per million characters, or $0.01 per 1,000 characters. Spaces and punctuation count as characters. You can start with a free trial of $0.50 credit valid for 7 days. Top-ups via USDT (TRC-20) are processed automatically, and failed requests are refunded in full, ensuring you only pay for successful audio generation.

Balances never expire, and there are no monthly subscriptions or minimum spends. This model suits NGOs with fluctuating project cycles, allowing precise budgeting for specific accessibility initiatives or content repurposing campaigns.

  • $0.01 per 1,000 characters
  • Failed requests are free
  • No monthly plans or subscriptions

Flexibility

You can adjust speech speed between 0.25 and 4.0 to suit different listening contexts, from slow instructional guides to fast news briefs. The API offers significant flexibility through multiple audio formats and voice options.

Choose from eight distinct voices and five response formats (mp3, wav, opus, flac, pcm). This variety ensures compatibility with various digital platforms and accessibility standards, whether delivering content for web, mobile, or broadcast use.

  • 8 distinct voices for different tones
  • 5 audio formats for broad compatibility
  • Adjustable speed from 0.25x to 4.0x

Limitations

Sound wave illustration for: Limitations

While the API offers robust multilingual capabilities, it is not infinite. Users must work within specific technical boundaries regarding input size, request frequency, and supported linguistic scope to ensure reliable delivery.

Understanding these constraints helps teams plan their integration strategy effectively, avoiding unexpected errors or delays during high-volume processing periods.

Character Limits

Each request accepts a maximum of 4,096 characters. For longer texts, split the input into smaller parts and join the resulting audio files.

Spaces and punctuation count toward this limit, so plan your text segmentation accordingly to maximize efficiency.

Rate Limits

The API allows 60 requests per minute per key. Before the first top-up, this limit is lower at 10 requests per minute.

Requests are processed sequentially, so heavy loads may cause queuing delays. Failed requests incur no charge.

Language Constraints

CivicVoice supports 23 specific languages, including Arabic, Chinese, English, French, and Spanish. Voices can speak any supported language, but languages like Vietnamese, Thai, or Ukrainian are not yet available.

If the language is not specified, the system guesses from the script. For non-English Latin text, explicitly set the language code to avoid misidentification.

Integration

Sound wave illustration for: Integration

Integration relies on a standard RESTful API that accepts JSON bodies and returns audio files. You send text to the endpoint and receive the synthesized speech, making it easy to embed in existing workflows.

RESTful API

The endpoint is POST https://api.playfb7.com/v1/audio/speech. You submit a JSON body with the text, voice selection, and format. The service returns the audio file directly in the response.

  • Endpoint: POST /v1/audio/speech
  • Input: JSON with input, voice, model
  • Output: Audio file (mp3, wav, opus, flac, pcm)

SDK Support

We do not provide an official proprietary SDK. Instead, you can use the official OpenAI SDKs by changing the base_url to https://api.playfb7.com/v1. This allows you to use familiar libraries with your existing CivicVoice API key.

  • Use OpenAI SDKs
  • Change base_url to https://api.playfb7.com/v1
  • No custom mobile or WordPress SDKs

Webhooks

The API does not support webhooks for asynchronous notifications. Since requests are processed sequentially and return the audio file directly, you do not need a webhook callback to receive your result. This simplifies integration for immediate use cases.

Integration

Security

Sound wave illustration for: Security

Security and privacy are foundational to CivicVoice’s design for government and NGO workflows. We prioritize clear data handling practices that respect the sensitive nature of public sector communications, ensuring your team can trust the platform with multilingual content delivery.

API Key Security

Each account maintains one active API key, issued via the dashboard. You can generate a new key at any time, which immediately invalidates the previous one, ensuring strict access control without complex rotation procedures.

Data Privacy

Input text is used solely for audio synthesis and is not retained for training models. Generated audio is returned in the response and not stored. Only request metadata (time, characters, status) is kept for billing purposes.

Encryption

All data in transit is protected by standard industry encryption protocols. While we do not hold specific enterprise certifications like SOC 2 or HIPAA, the standard encryption protocols used are industry-standard for secure web communications.

Support

Sound wave illustration for: Support

Support is available exclusively via email. There is no phone number or live chat option, ensuring that all inquiries are documented and addressed systematically. This approach suits teams that prefer asynchronous communication and detailed written records of their support interactions.

Our public documentation serves as the primary technical resource. It includes a ready curl example to help you start quickly, along with reference materials for endpoints and parameters. This centralized hub ensures you have the specific details needed for integration without navigating multiple sources.

Email Support

All support requests are handled via email. This ensures a clear audit trail for your team’s communications and allows our engineers to provide detailed, written responses. There is no live chat or phone support, so expect asynchronous replies rather than immediate real-time assistance.

Documentation

The documentation provides a ready curl example to help you start quickly. It covers the standard request shape, endpoint details, and parameter descriptions. This centralized resource ensures you have the specific details needed for integration without navigating multiple sources or relying on community-contributed snippets.

Community

While we do not maintain an official community forum, developers often share their integration experiences using the standard OpenAI SDK. Since our API follows the same request shape, you can leverage existing community knowledge for troubleshooting and best practices.

The documentation provides a ready curl example to help you start quickly. It covers the standard request shape, endpoint details, and parameter descriptions. This centralized resource ensures you have the specific details needed for integration without navigating multiple sources or relying on community-contributed snippets.

  • No official forum or Slack channel.
  • Leverage OpenAI SDK community knowledge.
  • Asynchronous email communication only.

Comparison

Sound wave illustration for: Comparison

Comparing CivicVoice against alternatives clarifies its specific value for government and NGO workflows. Unlike local TTS engines that require dedicated server infrastructure and maintenance, CivicVoice operates as a cloud API, eliminating hardware overhead. While many providers offer similar REST endpoints, CivicVoice focuses on clarity and cost-efficiency for public sector use, charging only $0.01 per 1,000 characters with no monthly minimums or seat limits.

Vs. Local TTS

Local TTS solutions demand significant upfront investment in hardware and ongoing maintenance to handle updates and scaling. CivicVoice removes this burden by providing a cloud-based endpoint. You simply send text and receive audio, paying only for what you use. This model supports variable demand without the need to provision excess capacity for peak usage periods.

Vs. Other APIs

While many providers offer similar REST endpoints, CivicVoice focuses on clarity and cost-efficiency for public sector use. Unlike complex enterprise contracts, we offer a straightforward pay-per-character model with no hidden fees for streaming or SSML if you do not need them. Our API mimics the OpenAI structure, allowing easy integration with existing tools, while keeping data privacy strict by not using input text for training.

  • No monthly plans or seat limits
  • Standardized JSON request body
  • No data retention for training

Vs. Human Reading

Human narration provides emotional nuance but incurs higher costs and scheduling delays for every language or update. CivicVoice delivers consistent, clear audio instantly across 23 languages using eight distinct voice presets. While human readers excel in nuanced storytelling, our synthetic voices are optimized for clarity in informational content, ensuring consistent quality for accessibility materials and multilingual community updates without the logistical complexity of coordinating human talent.

Future Trends

Sound wave illustration for: Future Trends

CivicVoice delivers a stable, standards-compliant interface for government and NGO teams. We focus on reliable delivery of multilingual audio rather than chasing every experimental feature, ensuring your accessibility workflows remain consistent and predictable.

AI Improvements

We use established licensed recordings from LibriVox and LibriTTS-R. This means you get clear, consistent synthetic speech without the variability of newer, untested neural models. The voice quality remains stable as our infrastructure scales.

New Languages

We currently support 23 languages, including Arabic, Chinese, Hindi, and Spanish. We do not yet support Vietnamese, Indonesian, or Thai. If your community needs those, you may need a supplementary solution, as we do not add languages on a fixed schedule.

  • Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish

Custom Voices

Unlike platforms offering on-demand voice cloning, CivicVoice does not provide custom voice cloning or user-uploaded voice models. We stick to our eight presets (Aria, Nova, Luna, Sage, Felix, Milo, Atlas, Orion). This keeps costs predictable and infrastructure simple for public sector budgets.

Future Trends

Getting Started

Sound wave illustration for: Getting Started

Getting started with CivicVoice is designed for immediate usability. You can create an account using your Google credentials or a standard email and password. This process is quick and requires no complex onboarding steps, allowing your team to access the API dashboard within minutes.

Sign Up

Visit the /get-api-key/ page and choose your preferred authentication method. Google sign-ups include a $0.50 trial credit valid for seven days, allowing you to generate approximately 50,000 characters of audio immediately. Email-based accounts start without trial credit but offer the same full functionality.

Get Key

Once registered, your dashboard displays your unique API key and current balance. This key authenticates your requests to the endpoint. You can issue a new key at any time, which immediately invalidates the previous one, ensuring secure access management for your organization.

  • One active key per account
  • Instant key rotation available
  • Dashboard shows balance and usage

First Request

Send a POST request to https://api.playfb7.com/v1/audio/speech with a JSON body. Include your model (tts-1 or tts-1-hd), input text, and desired voice. The API returns the audio file directly. Use the official OpenAI SDKs by updating the base_url to integrate seamlessly.

  • Endpoint: POST /v1/audio/speech
  • Supported formats: mp3, wav, opus, flac, pcm
  • Max 4096 characters per request

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Simplify grant applications to empower indie developers navigating complex government and NGO funding landscapes effectively.

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. openai-node on GitHub
  3. ISO 639 language codes
  4. OpenAI API reference: create speech
  5. openai-python on GitHub
  6. curl documentation
  7. Python documentation
  8. Tether (USDT)
  9. Node.js documentation
  10. MDN: Web Speech API
  11. FFmpeg documentation
  12. LibriTTS-R paper (arXiv 2305.18802)

More on this site