Python Integration for Synthetic Speech Generation

By VocalByte editorial team · Updated 2026-11-18

This page outlines how indie developers can integrate synthetic speech generation into their applications using a Python-first API. You will find clear examples of simple integration using the OpenAI SDK, transparent character-based pricing, and the technical limits that define our lightweight architecture. We focus on open standards so you can ship voice features faster without enterprise overhead.

Designed specifically for startups, this guide covers our eight voice presets, 23 supported languages, and straightforward request formats. Whether you are building an IVR system or game narration, you will learn how to send text, receive audio files, and manage your account balance efficiently using our Python-compatible endpoint.

Python Integration for Synthetic Speech Generation

Frequently asked questions

What is the text to speech in python API?

VocalByte is a cloud TTS API that accepts text and returns audio files via a standard HTTP endpoint. It uses the same request shape as the OpenAI speech endpoint, allowing you to send POST requests with JSON bodies containing your text, voice selection, and desired audio format settings.

How much does it cost to use text to speech in python?

Pricing is $10 per 1 million characters, or $0.01 per 1,000 characters. Spaces and punctuation count toward the total. Failed requests are free, with charges returned in full if synthesis fails. There are no monthly plans, seats, or minimum spend requirements for your account.

Does the API support Russian language in python?

Yes, Russian is one of the 23 supported languages. Any of the 8 voice presets can speak Russian. You should explicitly set the language parameter to Russian in your request to ensure accurate synthesis, as the system guesses the language from the script by default.

What is the character limit per request?

Each API request supports up to 4096 characters of input text. For longer texts, you must split the content into parts of this size and join the resulting audio files. Spaces and punctuation are included in this character count limit per request.

How does the rate limit work for python requests?

You are limited to 60 requests per minute per API key. New accounts without top-ups start with a lower limit of 10 requests per minute. Requests are processed sequentially, so under load, your requests may wait in a queue before being synthesized.

Can I use the OpenAI SDK with this API?

Yes, the API uses the same request shape as the OpenAI speech endpoint. You can use the official OpenAI SDK by changing the base_url to https://api.2222bdcasino.com/v1 and providing your VocalByte API key. This allows for easy integration into existing Python workflows.

What audio formats are supported?

The API supports mp3, wav, opus, flac, and pcm response formats. You specify the desired format in the request body. The generated audio files are returned directly in the API response, allowing you to save them locally.

Is the voice cloning feature available?

No, custom voice cloning is not available. You cannot upload your own voice or design custom voices. The API uses eight preset voices based on licensed recordings from LibriTTS-R and LibriVox. Each generated file includes an inaudible watermark marking it as synthetic speech.

How long does it take to generate audio?

Generation is roughly real-time on long texts, averaging about 25 characters per second of audio. Short phrases may take a few seconds. Since requests are processed sequentially, high load times may increase if requests wait in a queue before being synthesized.

Do I need to pay for failed requests?

No, failed requests are free. If the synthesis process fails for any reason, the charge is returned in full to your account balance. You only pay for successfully generated audio files that are returned in the API response.

What happens if I exceed the rate limit?

Requests will likely queue or return an error if you exceed 60 requests per minute. New accounts without top-ups are limited to 10 requests per minute. You can monitor your usage and rate limits via the dashboard or API responses to avoid delays.

Can I use this for commercial projects?

Yes, the API is designed for startups and indie developers to ship voice features. The voices are based on licensed recordings, and generated audio is not stored or used for training. You can integrate the audio into your commercial products.

How do I top up my balance?

Top-ups are done via USDT on the TRON network (TRC-20) only. The minimum top-up amount is $5. Credits are automatically added to your balance within minutes after the transfer is confirmed. There are no credit cards, PayPal, or subscriptions for payments.

Is there a free trial available?

Yes, signing in with Google provides a $0.50 trial credit, valid for 7 days, which covers about 50,000 characters. Accounts created with email and password do not receive trial credit. You can start generating audio immediately after signing up and receiving your API key.

First request

curl

curl https://api.2222bdcasino.com/v1/audio/speech \
  -H "Authorization: Bearer $TTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","voice":"aria","input":"Hello from the API.","response_format":"mp3"}' \
  --output hello.mp3

Why Indie Developers Choose This API

Sound wave illustration for: Why Indie Developers Choose This API

VocalByte bridges the gap between indie ambition and enterprise-grade voice capabilities. By mirroring the OpenAI speech endpoint structure, you can integrate synthetic speech generation into your Python stack without learning a proprietary protocol or rewriting existing integration patterns.

OpenAI-Compatible SDK Integration

OpenAI-Compatible SDK Integration

Use the official OpenAI Python SDK by simply swapping the base_url to https://api.2222bdcasino.com/v1. This reduces integration time to minutes, leveraging familiar tools like the OpenAI Python client without vendor lock-in or custom client libraries.

  • Compatible with OpenAI speech endpoints
  • Standard JSON request/response shape
  • No custom client library required

Simple Python Integration

Start with a single POST request to receive an audio file. The API accepts standard text inputs and returns audio in common formats like MP3 or WAV, making it trivial to pipe audio directly into web players or game engines.

  • Minimal code footprint
  • Standard HTTP/JSON interface
  • Works with existing async frameworks

Transparent Character Pricing

Pay only for what you use at $0.01 per 1,000 characters. There are no monthly subscriptions, hidden fees, or tiered pricing models. Failed requests are refunded in full, ensuring you never pay for wasted compute cycles.

  • $0.01 per 1,000 characters
  • No monthly minimums
  • Refunds on failed requests

Voice Library & Languages

Sound wave illustration for: Voice Library & Languages

VocalByte offers eight voice presets tailored for clear, synthetic speech generation. Each voice is derived from licensed recordings, ensuring high-quality audio output without the overhead of custom voice design. The selection covers a range of tones, from warm narration to energetic promos, allowing you to match the audio to your product’s specific context.

All voices support 23 languages, including English, Spanish, Chinese, and German. Any voice can speak any of these languages, providing flexibility for global products. If the language is not specified, the system guesses it from the script, though setting it explicitly is recommended for non-English Latin text.

8 Distinct Voice Presets

The library includes four female and four male voices. Options range from aria, a warm narrator, to felix, an energetic promo voice. Other presets include nova (bright), luna (soft storytelling), sage (calm instructional), milo (friendly conversational), atlas (neutral news), and orion (deep documentary).

These voices are based on licensed recordings from LibriTTS-R and LibriVox, ensuring a consistent and professional sound. Every generated file includes an inaudible watermark to identify it as synthetic speech.

  • 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

23 Supported Languages

The API supports 23 languages, including Arabic, Danish, Dutch, Finnish, French, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. It does not support Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, or Bengali.

Each voice can speak any of these languages. For non-English Latin-script text, explicitly setting the language field is recommended to avoid incorrect guessing.

Custom Speed Control

You can adjust the playback speed between 0.25 and 4.0. This allows you to fine-tune the audio for different use cases, such as slower speech for clarity or faster speech for quick notifications. The speed parameter is applied directly during synthesis, ensuring consistent timing across all voices.

Technical Specifications

Sound wave illustration for: Technical Specifications

The API endpoint accepts standard JSON payloads compatible with the OpenAI speech endpoint, allowing you to use existing OpenAI SDKs by simply adjusting the base URL. You send text up to 4,096 characters per request, selecting from eight voice presets and adjusting speed between 0.25x and 4.0x.

The service supports five audio formats: mp3, wav, opus, flac, and pcm. Requests are processed sequentially, so under load a request may wait in a queue. Long texts are handled by splitting input into character limits and joining the resulting audio files.

Request Format & Limits

Send a POST request to /v1/audio/speech with the model, input text, voice, and optional language or speed parameters. The input text is limited to 4,096 characters per request; exceed this by splitting your content into multiple calls.

Authentication uses a Bearer token. Ensure your key is included in the header. The request shape mirrors the OpenAI standard, so no custom client library is required for integration.

  • Model: tts-1 or tts-1-hd
  • Max input: 4,096 characters
  • Speed range: 0.25–4.0
  • Auth: Bearer token in header

Audio Formats Available

You can choose between mp3, wav, opus, flac, or pcm based on your storage and latency needs. The API returns the audio file directly in the response, ready for immediate playback or download.

All generated files contain an inaudible watermark indicating synthetic origin, which helps distinguish AI-generated speech from human recordings without affecting audio quality.

Rate Limits & Queuing

Your API key is limited to 60 requests per minute once funded, with a lower limit of 10 requests per minute during the free trial phase. Requests are processed sequentially, meaning high-volume bursts may experience queuing delays.

Under load, a request may wait in a queue before synthesis begins. This ensures fair usage but may increase latency for short phrases.

How It Works

Sound wave illustration for: How It Works

The API follows a simple request-response pattern. You send a JSON payload with your text and voice preference, and receive a direct audio file in return. This works seamlessly with the official OpenAI Python SDK by adjusting the base URL, making integration immediate for existing workflows.

There is no streaming or WebSocket support. You specify the desired output format (mp3, wav, opus, etc.) and receive the complete file in the response body, ready for immediate playback or storage in your application.

Send Text, Receive Audio

Integration is straightforward: POST your text to the speech endpoint. The API returns the synthesized audio file directly. This standard approach ensures compatibility with existing Python libraries and simplifies debugging without needing custom client-side logic.

  • JSON input payload
  • Direct audio file response
  • OpenAI SDK compatible

Long Text Handling

For texts exceeding 4096 characters, split the input into smaller chunks. Generate audio for each segment individually, then join the resulting files. This ensures consistent quality and avoids truncation limits.

  • 4096 character limit per request
  • Split and join workflow

Synthetic Watermarking

Every generated audio file contains an inaudible watermark. This marks the file as synthetic speech, providing transparency without affecting audio quality or playback experience.

Use Cases for Startups

Sound wave illustration for: Use Cases for Startups

VocalByte enables indie startups to integrate voice features without heavy infrastructure. By leveraging the OpenAI-compatible SDK, you can replace static audio files with dynamic, synthesized speech in minutes using simple Python code.

IVR Systems

Replace rigid, pre-recorded phone menus with natural-sounding voice prompts that adapt to user input. Our API handles language detection and multiple voices, allowing you to create multilingual support systems without managing separate audio assets for every language variant.

  • Dynamic menu updates without re-recording
  • Support for 23 languages
  • Consistent brand voice across regions

Audiobook Snippets

Generate short audiobook samples or chapter previews from your text database instantly. With a 4096-character limit per request and transparent character pricing, you can offer listeners a taste of your content without incurring high upfront production costs.

  • Fast turnaround for marketing materials
  • No minimum spend required
  • Trial credit available for testing

Game Narration

Inject narrative depth into your indie games with customizable voice presets like Aria or Felix. You can adjust speed and select from eight distinct voices to match character personalities, all delivered as standard audio files ready for immediate playback.

  • Eight distinct voice presets
  • Adjustable speed (0.25–4.0x)
  • Multiple audio formats (mp3, wav, opus)
Use Cases for Startups

Getting Started

Sound wave illustration for: Getting Started

Start by creating your account via the /get-api-key/ page. Signing in with Google provides an immediate $0.50 trial credit (approx. 50,000 characters), valid for seven days. This allows you to test the API without entering payment details or waiting for a top-up.

Once registered, you will receive a unique API key. Unlike traditional enterprise contracts, there are no monthly seats or minimum spends. Your key grants access to the full voice library and language support immediately upon creation.

Sign Up with Google

Navigate to the sign-up page and select the Google authentication option. This method instantly provisions your account and activates the trial credit. No credit card is required at this stage, making it risk-free to evaluate the service quality.

  • Instant account creation
  • $0.50 trial credit activated automatically
  • No payment method required upfront

Get Your API Key

Your API key is displayed on the dashboard after login. Use this key in the Authorization: Bearer header for all requests. You can regenerate the key at any time; the old key stops working immediately, ensuring secure access control.

  • Single active key per account
  • Instant revocation on regeneration
  • Compatible with OpenAI SDKs

First Request Demo

Use the provided curl example on your dashboard to send your first request. Point your base_url to https://api.2222bdcasino.com/v1. The system processes requests sequentially, so long texts may queue briefly, but short phrases return audio files within seconds.

  • Endpoint: POST /v1/audio/speech
  • Supports tts-1 and tts-1-hd models
  • Returns mp3, wav, opus, flac, or pcm

Pricing Overview

Sound wave illustration for: Pricing Overview

Billing is calculated strictly by character count, including spaces and punctuation. The rate is $10 per one million characters, or $0.01 per 1,000 characters. Failed requests incur no charge, with the amount returned to your balance immediately.

Pay Per Character

There are no monthly subscriptions, seat licenses, or minimum spend requirements. You only pay for the characters you actually generate, making it easy to scale costs directly with usage.

No Monthly Fees

Top-ups are handled via USDT on the TRON network (TRC-20). The minimum deposit is $5, and credits are added automatically within minutes. There are no invoices or VAT charges.

Free Trial Credit

Signing in with Google provides $0.50 in trial credit, valid for 7 days. This allows you to generate approximately 50,000 characters before committing to a top-up.

Data & Privacy

Sound wave illustration for: Data & Privacy

VocalByte treats your input data with strict operational boundaries. The text you send is processed solely to generate the corresponding audio file and is not used for model training or improving our voice engines. This ensures that your unique content remains distinct from our dataset improvements.

No Training on Input

Your input text is used exclusively for the immediate synthesis task. We do not ingest your strings to refine our underlying neural models, ensuring your proprietary copy stays separate from our core technology.

No Audio Storage

Generated audio files are returned directly in the API response and are not stored on our servers after delivery. The generated audio is returned in the response and not stored.

Metadata Retention

We retain request metadata including timestamp, character count, and status for billing accuracy and troubleshooting. This minimal data allows us to verify usage against your balance without retaining the actual content of your voice outputs.

Support & Contact

Sound wave illustration for: Support & Contact

We do not offer phone lines or live chat agents waiting to answer your call. Support is handled exclusively via email, ensuring every query is documented and traceable without the noise of real-time conversations.

Email Support Only

Our team monitors a single support inbox and responds directly to your tickets. This approach keeps overhead low, which helps us maintain our simple, transparent pricing model without passing enterprise support costs to you.

No Live Chat

There is no floating chat widget interrupting your workflow. If you need immediate assistance during development, refer to the API documentation first. For complex issues, email is the fastest way to get a thorough, written response from our engineers.

Documentation Access

The most reliable support is self-service. Our /docs/ page contains the complete API reference, Python SDK examples, and error code explanations. Most integration issues are resolved by reviewing the request format or rate limit details provided there.

  • Full API reference with curl and Python examples
  • List of all 8 voice presets and language codes
  • Explanation of rate limits (60 req/min) and queue behavior

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Once the audio is delivered to your application, we do not store the generated audio files.

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. OpenAI API reference: create speech
  4. openai-python on GitHub
  5. TRON developer hub: TRC-20
  6. IETF RFC 7845: Ogg Opus
  7. ISO 639 language codes
  8. openai-node on GitHub
  9. Tether (USDT)
  10. LibriTTS-R paper (arXiv 2305.18802)
  11. Python documentation
  12. MDN: Web Speech API

More on this site