How Does Our Text-to-Speech API Convert Text to Audio?

By Audibook editorial team · Updated 2026-11-18

This page details how the Audibook TTS API converts text into production-ready audio files for audiobook publishers. We provide a cloud-based service where you send input text and receive a synthesized audio file via a simple programmatic interface. The process handles voice synthesis, language detection, and audio formatting automatically, allowing you to integrate audio generation directly into your self-publishing workflow without managing infrastructure.

You will find the exact request structure, supported voices, and language handling rules. The guide covers character limits, speed adjustments, and available audio formats like MP3 and WAV. It also explains error states, billing impacts, and data usage policies. This information helps you implement reliable audio generation for long-form content, ensuring accurate character counting and seamless integration with your existing publishing pipelines.

How Does Our Text-to-Speech API Convert Text to Audio?

Frequently asked questions

Is TTS the same as voice cloning?

No. We do not offer custom voice cloning or uploading your own voice. Our service uses eight licensed voice presets derived from LibriTTS-R and LibriVox recordings. These are fixed synthetic voices, not clones of specific individuals or custom-trained audio samples.

Can I generate audio instantly?

Short phrases take a few seconds. Long texts generate at roughly real-time speed, about 25 characters per second. Requests are processed sequentially, so under load, your request may wait in a queue before synthesis begins.

Do I need a microphone?

No. The API converts text input into audio files directly. You send a JSON payload with the text, and receive an audio file in your chosen format. No hardware or microphone input is required for generation.

Is the audio copyrighted?

Generated audio carries an inaudible watermark marking it as synthetic speech. The underlying voices are based on licensed recordings (LibriTTS-R, CC BY 4.0) and public-domain readings.

Can I use the API offline?

No. This is a cloud API. You must send POST requests to https://api.playtk66.com/v1/audio/speech over the internet. There is no local SDK or offline installation option available for this service.

Does the API support emojis?

The API accepts text up to 4096 characters, including emojis. Spaces and punctuation count toward the character limit. The engine processes the input string and generates corresponding audio without requiring special handling for emoji characters.

How accurate is the pronunciation?

Pronunciation follows the voice preset’s standard delivery. You can specify a language ISO code to guide the engine, which defaults to English for Latin script. Accuracy depends on the clarity of the input text and language setting.

Can I adjust the pitch?

No. The API supports a speed parameter (0.25–4.0) but does not offer pitch adjustment, SSML, or phoneme dictionaries. You can only control speed and voice selection for the generated audio output.

Is the API real-time?

No. There is no streaming or WebSocket support. You send a request and wait for the complete audio file in the response. Processing is sequential, so latency depends on queue length and text length.

Do I need a developer?

Yes. The API uses standard JSON over HTTP. You need to send POST requests with authentication headers and parse the audio response. While OpenAI SDKs work, basic programming knowledge is required to integrate the service.

Can I generate multiple languages?

Yes. The API supports 23 languages, including English, Spanish, German, and Japanese. Any voice can speak any supported language. You should set the language field for non-English Latin text to ensure correct pronunciation.

Is the API expensive for large books?

Pricing is $10 per 1 million characters. There are no monthly plans or hidden fees. Failed requests are free. For large books, split text into 4096-character chunks to manage processing efficiently and costs predictably.

What is a voice preset?

A voice preset is one of eight fixed synthetic voices (e.g., aria, nova, atlas). They are based on licensed recordings from LibriVox. You select a preset by name in the API request to determine the voice characteristics.

Does the API handle punctuation?

Yes. Punctuation is processed as part of the input text and counts toward the character limit.

Definition

Sound wave illustration for: Definition

Our Text-to-Speech API is a cloud-based service designed for audiobook production and self-publishing workflows. It converts written text into synthetic audio files via a standard RESTful endpoint. The system processes requests sequentially, ensuring consistent output quality without requiring local infrastructure management.

The API accepts plain text input and returns generated audio files. This programmatic approach allows publishers to integrate TTS directly into their content pipelines, automating the conversion process from manuscript to audio format.

Cloud-based conversion

The synthesis engine runs on our servers, eliminating the need for local hardware. You send a JSON payload via HTTP POST, and the system handles the computation. This model supports high-volume publishing workflows without infrastructure overhead.

Input text, output audio

You provide raw text as the input parameter. The API processes this text through one of eight preset voices. The result is a downloadable audio file in your chosen format, ready for distribution or further editing.

Programmatic access

Access is entirely API-driven using standard HTTP methods. You can use the official OpenAI SDKs by pointing them to our base URL, or use any HTTP client. This ensures seamless integration with existing publishing tools and scripts.

  • Standard JSON request format
  • Bearer token authentication
  • RESTful endpoint design

Request Structure

Sound wave illustration for: Request Structure

The API accepts text synthesis requests as a JSON payload sent to the speech endpoint. This structure mirrors standard OpenAI compatibility, allowing direct use of existing client libraries by adjusting the base URL. The request body defines the core parameters for generating the audio asset.

Every request must include specific identifiers to ensure correct processing. The system validates these fields before initiating synthesis, ensuring the model and voice are correctly mapped to the input text.

JSON body format

The request is a standard JSON object submitted via HTTP POST. It contains keys for model selection, input text, voice ID, output format, and optional speed adjustments. This structure ensures compatibility with common SDKs and simplifies integration into existing publishing pipelines.

Required fields

Three fields are mandatory for every synthesis request. The model field accepts either tts-1 or tts-1-hd, both using the same engine and pricing tier. The input field carries the text string to be converted, which must not exceed 4096 characters. The voice field specifies one of the eight available presets, such as aria or atlas, determining the vocal characteristics of the output.

Optional parameters

Additional fields allow fine-tuning of the output. The response_format parameter selects the audio codec (mp3, wav, opus, flac, or pcm). The speed parameter adjusts playback rate between 0.25 and 4.0. The language field accepts an ISO code to override automatic detection, which defaults to English for Latin script text. If omitted, the system attempts to guess the language from the script used.

Request Structure

Voice Selection

Sound wave illustration for: Voice Selection

The API provides eight distinct voice presets, each designed for specific audiobook genres and narration styles. Publishers can select voices based on narrative requirements, ensuring consistent tone across chapters.

Voice selection is straightforward: choose from four female and four male presets. Each voice offers a unique character profile, from warm narrators to energetic promo styles, without requiring custom design.

8 preset voices

Our library includes eight licensed voices derived from public-domain and CC BY 4.0 recordings. These presets cover a range of tones suitable for fiction, non-fiction, and instructional content.

Each voice is engineered for clarity and endurance, making them ideal for long-form audiobook production where consistency matters more than dramatic variation.

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Luna: Soft, storytelling
  • Sage: Calm, instructional
  • Felix: Energetic, promo
  • Milo: Friendly, conversational
  • Atlas: Neutral, news
  • Orion: Deep, documentary

Gender and tone

Voices are categorized by gender and tonal quality. Select Aria or Luna for softer, narrative-driven texts. Choose Atlas or Orion for neutral or deep documentary styles.

Tone selection directly impacts listener engagement. Match the voice to your book’s genre to maintain immersion without altering the base engine.

Voice ID mapping

Use the voice name (e.g., 'aria', 'nova') as the voice parameter in your JSON request. The API accepts these human-readable IDs directly.

No complex mapping is required. The same voice ID works across all supported languages, as each preset can speak all 23 supported languages natively.

Language Handling

Sound wave illustration for: Language Handling

The API supports 23 specific languages. You can explicitly set the language using an ISO code in the request. This ensures consistent pronunciation regardless of the voice selected or the input text’s origin.

Automatic detection works by analyzing the input script. If you omit the language field, the system guesses the language from the characters. This simplifies requests for single-language content but requires explicit setting for mixed or non-English Latin text.

ISO code support

Specify any of the 23 supported languages using standard ISO codes. This guarantees the engine uses the correct phonetic rules for that language, ensuring accurate output.

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

Automatic detection

The system analyzes the input text’s script to determine the language. This works well for monolingual content where the expected language matches the script. However, for mixed languages, explicit codes are required.

Latin script default

Latin-script text defaults to English if no language is specified. For non-English Latin-script text (e.g., German or French), you must set the language field. Otherwise, the engine will pronounce it with an English accent.

Audio Generation

Sound wave illustration for: Audio Generation

The synthesis engine processes your text input and returns the generated audio file directly in the response. This cloud-based conversion ensures that infrastructure overhead is managed entirely by the API, allowing you to focus on content creation rather than server maintenance. The process is deterministic, producing consistent audio quality for identical inputs across all requests.

Generated audio files are returned immediately upon successful synthesis, with no intermediate storage of the audio itself. Only request metadata, including timestamp, character count, and status, is retained for billing purposes. This ensures that your input text is used solely for production and not for training models, preserving the integrity of your proprietary content.

Synthesis engine

The synthesis engine converts text into audio using licensed recordings from LibriTTS-R and LibriVox. It handles the entire processing pipeline, from text normalization to waveform generation, ensuring high-fidelity output suitable for audiobook production.

Each request is processed sequentially, which means under heavy load, a request may wait in a queue. This sequential processing ensures consistent resource allocation and predictable performance for long-form content generation.

  • Uses licensed recordings from LibriTTS-R (CC BY 4.0), from LibriVox public-domain audiobook readings.
  • Processes requests sequentially to ensure consistent resource allocation.
  • Returns audio file directly in the response without intermediate storage.

Watermark inclusion

Every generated audio file includes an inaudible watermark that marks it as synthetic speech. This watermark is embedded during the synthesis process and cannot be removed without affecting audio quality.

The presence of the watermark helps identify the origin of the audio as synthetic, providing transparency for publishers and self-publishers who distribute their content across various platforms.

  • Inaudible watermark embedded in every generated file.
  • Marks audio as synthetic speech for transparency.
  • Cannot be removed without affecting audio quality.

Real-time generation

Audio generation typically takes time proportional to the length of the text, with a typical speed of about 25 characters of text per second of generation for long texts. Short phrases may take a few seconds to process.

For texts longer than 4096 characters, the API splits the input into parts, generates audio for each part, and joins the files. This splitting strategy ensures that large texts are handled efficiently without exceeding character limits.

  • Typical speed: ~25 characters per second of generation for long texts.
  • Short phrases take a few seconds to process.
  • Splitting strategy for texts >4096 characters.
  • Files are joined after individual synthesis.

Character Limits

Sound wave illustration for: Character Limits

The API accepts input text up to 4096 characters per request. This limit applies to the raw character count, including spaces and punctuation. Requests exceeding this threshold are rejected, requiring clients to implement splitting logic before submission.

4096 char max

Each synthesis request is capped at 4096 characters. Exceeding this limit results in an immediate error, ensuring predictable processing behavior. Publishers handling long chapters must segment their text files accordingly before invoking the endpoint.

Splitting strategy

Clients should divide longer texts into chunks of 4096 characters or fewer. Optimal splitting occurs at sentence boundaries to preserve audio continuity.

Joining audio files

After receiving individual audio files for each segment, the client is responsible for concatenating them into a single file. The API does not handle multi-part assembly. Standard audio libraries can merge the returned MP3 or WAV streams seamlessly.

Character Limits

Speed Control

Sound wave illustration for: Speed Control

The API accepts a speed parameter to adjust playback velocity within the 0.25–4.0 range. This allows precise synchronization of audio output with pacing requirements for audiobook chapters or instructional materials without reprocessing the entire text.

0.25x to 4.0x

Values outside this range are rejected. The engine processes each request sequentially, so extreme speeds may slightly alter total generation time, though the output remains consistent in character count.

Normal speed

Default behavior applies when the field is omitted. This ensures standard narration pacing suitable for general audiobook consumption, matching the typical listening experience of published commercial titles.

Adjustable rate

Publishers can generate multiple versions of the same text at different velocities. This supports accessibility needs or allows editors to verify content flow before finalizing long-form audio assets.

  • Supports values like 1.5x for faster reviews or 0.75x for detailed listening.

Formats Available

Sound wave illustration for: Formats Available

The API supports four audio formats to balance file size and quality for different audiobook distribution channels. Each format is selected via the response_format parameter in the request body.

Choosing the right format depends on your delivery platform’s requirements. MP3 offers broad compatibility, WAV ensures lossless fidelity, and Opus provides efficient compression for streaming.

MP3 compression

MP3 is the standard for most audiobook platforms. It provides a good balance between file size and audio quality, making it ideal for distribution where storage and bandwidth matter.

Use this format for general listeners who expect common compatibility across devices and apps.

  • Widely supported by all major audiobook platforms

WAV quality

WAV is one of the available formats. This format preserves the full fidelity of the synthetic voices, which is useful for archival purposes or high-end production workflows.

Choose WAV when you need the highest possible quality without any compression artifacts.

  • Lossless, uncompressed audio

Opus efficiency

Opus provides efficient compression. This is beneficial for reducing storage costs and improving download speeds.

Use Opus for modern streaming applications or when minimizing data transfer is a priority.

  • Highly efficient compression
  • Smaller file sizes than MP3

Error States

Sound wave illustration for: Error States

The API provides explicit error responses to help you handle edge cases during audio generation. Understanding these states ensures your workflow remains robust when requests encounter issues or exceed system limits.

Proper error handling allows for automatic retries or fallback mechanisms, maintaining audio production continuity without manual intervention for common transient issues.

Synthesis failure

If the synthesis engine cannot process a request, the API returns an error status. The charge is returned in full.

This ensures you are not billed for audio that was not successfully delivered.

  • Failed requests result in a full credit refund.
  • Error details are returned in the response body.
  • No audio file is generated for the failed request.

Rate limiting

Requests are limited to 60 per minute per key. If you exceed this limit, the API returns a 429 status code.

New accounts start with a lower limit of 10 requests per minute until the first top-up is processed.

  • Limit: 60 requests per minute.
  • Pre-top-up limit: 10 requests per minute.
  • Exceeding the limit returns a 429 error.

Invalid input

Requests with missing required fields or invalid character encoding will fail immediately. Ensure the input text does not exceed 4096 characters.

Incorrect voice IDs or unsupported response formats will also trigger an error response without consuming balance.

  • Maximum input length: 4096 characters.
  • Required fields: model, input, voice.
  • Invalid formats return an error without charge.

Billing Impact

Sound wave illustration for: Billing Impact

Billing is strictly character-based, calculated from the text input length including spaces and punctuation. Each request costs $0.01 per 1,000 characters, with no hidden fees for processing time or format selection. Failed requests are free.

Your account balance deducts the exact character count multiplied by the rate. Unused credit remains valid indefinitely, supporting long-tail publishing workflows without expiration pressure.

Chars counted

Every character in the input text, including spaces and punctuation, contributes to the total. A 4096-character request consumes exactly that amount from your balance, regardless of the resulting audio duration.

  • Spaces and punctuation count as characters
  • 4096 characters max per request
  • Rate: $0.01 per 1,000 characters

Free failures

If synthesis fails due to engine errors or invalid input, the character count is not deducted from your balance. The full amount is returned immediately, ensuring no cost for wasted computation.

  • Full refund on synthesis failure
  • No deduction for invalid input
  • Instant balance update

Balance deduction

Deductions occur only upon successful audio generation. Your balance decreases by the exact character count multiplied by the unit rate. USDT top-ups are credited automatically within minutes, with no monthly subscriptions or minimum spend requirements.

  • No monthly subscriptions
  • Balance does not expire.
  • USDT (TRC-20) only
Billing Impact

Data Usage

Sound wave illustration for: Data Usage

Our text-to-speech API is engineered for efficiency and privacy. Input text is processed solely to generate the requested audio file and is not used for model training. This ensures that your published content remains distinct from our training datasets, preserving the integrity of your library.

Generated audio is returned in the response and not stored on our servers. Only request metadata required for billing and rate limiting is retained. This minimal data footprint aligns with the needs of publishers who require predictable, transparent workflows without long-term data obligations.

No training use

Input text is used exclusively to produce the audio file for that specific request. It is never ingested into our training data, ensuring your content does not influence future model generations. This separation is critical for publishers who want to maintain exclusive rights over their voice assets.

The engine uses licensed recordings from LibriTTS-R (CC BY 4.0) and public-domain audiobook readings. Your input text is not combined with these base recordings for future training purposes, keeping your voice outputs distinct from our core model improvements.

No storage of audio

Audio files are generated on-the-fly and returned directly in the API response. We do not persist the resulting audio files on our servers after delivery. This reduces storage costs and ensures that your generated audiobooks exist only where you save them.

If you need to archive your audio, you must download and store it yourself. This approach keeps our infrastructure lightweight and focused purely on synthesis speed and reliability, rather than long-term content hosting.

Metadata retention

We retain request metadata including timestamp, character count, voice used, and status for billing accuracy and rate limit tracking. This data is used solely to calculate charges and manage your API key limits.

No personal identifiable information beyond your account key is stored with the audio metadata. The retention period is limited to what is necessary for financial reconciliation and operational troubleshooting of the synthesis pipeline.

  • Timestamp of request
  • Character count billed
  • Voice and format used
  • Request status (success/failure)

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Empower authors to share their stories and build lasting careers through direct reader engagement.

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

More on this site