Python Text-to-Speech API for Medical Patient Guides

By MedSynth editorial team · Updated 2026-11-19

VoxMedix provides a Python-friendly Text-to-Speech API designed for health-tech startups generating clear, compliant audio from medical documentation. Our solution turns clinical text into accessible patient guides with minimal engineering overhead, avoiding the complexity of enterprise contracts. Use standard libraries to convert EHR data into onboarding audio or procedure explanations instantly.

This page outlines how to integrate our OpenAI-compatible endpoint into your Python workflows for batch processing and automated patient education. We offer transparent character billing, strict data privacy, and support for 23 languages. Get started with a free trial key (available with Google sign-in) and generate your first medical audio guide.

Python Text-to-Speech API for Medical Patient Guides

Frequently asked questions

Is this an offline TTS engine?

No, this is a cloud-based API. You send text via HTTP POST requests to the endpoint and receive an audio file in return. It requires an internet connection and relies on the provider’s servers for synthesis, rather than running locally on your device or server.

Does it work with Python 3.10?

Yes. The API uses the same request shape as the OpenAI speech endpoint. You can use the official OpenAI Python SDK by changing the base_url to https://api.heybhaji.cc/v1. This allows Python 3.10 environments to integrate seamlessly using standard HTTP libraries or the compatible SDK.

Can I use it for HIPAA patient guides?

The product does not offer a HIPAA certification or specific enterprise contract for healthcare compliance. While input text is not used for training, request metadata is kept for billing. There is no explicit guarantee of HIPAA compliance, so you should verify if this meets your specific regulatory needs.

How many languages are supported?

The API supports 23 languages, including English, Spanish, French, German, Arabic, Chinese, Japanese, Hindi, and others. Any voice can speak any of these languages. If the language is not specified, it is guessed from the script, defaulting to English for Latin text.

What is the character limit per request?

Each request accepts up to 4096 characters of text. For longer documents, you must split the text into parts of this size and join the resulting audio files. Spaces and punctuation count toward this character limit.

Are voices customizable for medical terms?

No, there is no custom voice cloning or phoneme dictionary support. You cannot upload specific pronunciation rules for medical terms. The eight preset voices (e.g., aria, atlas) are fixed, and pronunciation depends on the model’s standard behavior for the given text input.

Is there a Python SDK?

There is no official Python SDK specific to VoxMedix. However, because the endpoint matches the OpenAI speech API shape, you can use the official OpenAI Python SDK by setting the base_url to https://api.heybhaji.cc/v1 and using your API key for authentication.

How is pricing calculated?

Pricing is $10 per 1 million characters, or $0.01 per 1,000 characters. Spaces and punctuation count as characters. Failed requests are free, with the charge returned in full. There are no monthly plans, seats, or minimum spend requirements.

What happens if a request fails?

If synthesis fails, the charge is returned in full. You are not billed for failed requests. This ensures you only pay for successfully generated audio files. You can retry the request or adjust parameters like speed or voice as needed.

Can I generate audio in bulk?

Yes, but you must handle splitting texts into 4096-character chunks and joining the audio files. The API processes requests sequentially, so under load, requests may wait in a queue. The rate limit is 60 requests per minute per key.

Is the audio stored after generation?

No, generated audio is returned in the response and not stored by the provider. Input text is used only to produce the audio and is not used for training. Only request metadata (time, characters, status) is kept for billing purposes.

Does the API support SSML?

No, the API does not support SSML (Speech Synthesis Markup Language). You cannot use SSML tags to control pauses, emphasis, or pronunciation. You must rely on the plain text input and the eight preset voices for audio generation.

Can I clone a doctor's voice?

No, custom voice cloning is not offered. You cannot upload your own voice or design a new voice. The API provides eight fixed preset voices based on licensed recordings from LibriVox. Each generated file carries an inaudible watermark marking it as synthetic speech.

What payment methods are accepted?

Payments are accepted via USDT on the TRON network (TRC-20) only. The minimum top-up is $5, and credits are added automatically within minutes. There are no credit cards, PayPal, subscriptions, or invoices with VAT. Balance does not expire.

First request

curl

curl https://api.heybhaji.cc/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 Python for Medical Audio?

Sound wave illustration for: Why Python for Medical Audio?

Python’s simplicity allows health-tech teams to transform clinical documentation into accessible audio without complex infrastructure. By leveraging standard libraries, developers can build reliable pipelines that convert text into speech programmatically, ensuring consistent output quality for patient materials.

This approach removes the overhead of enterprise contracts while maintaining the flexibility needed for rapid iteration. Teams can script entire workflows, from data extraction to audio generation, ensuring that patient guides are updated dynamically as medical guidelines evolve.

Scriptable workflows for batch processing

Scriptable workflows for batch processing

Batch processing becomes straightforward with Python’s request handling. You can split large texts into 4096-character chunks and merge the resulting audio files automatically. This ensures that lengthy medical records or detailed procedure explanations are delivered as a single, coherent audio file without manual intervention.

  • Automated splitting and joining of audio segments
  • Consistent character counting for accurate billing
  • Error handling for failed synthesis requests

Integrate with EHR data pipelines

Extract text from Electronic Health Records (EHR) systems and feed it directly into the TTS API. Python’s ecosystem offers robust libraries for connecting to various healthcare databases, allowing you to generate patient-specific guides automatically. This integration ensures that the audio content remains synchronized with the patient’s current medical data.

  • Direct API integration via JSON bodies
  • Secure authentication with Bearer tokens
  • Support for multiple languages including English, Spanish, and French

Automate patient onboarding audio

Streamline the onboarding process by generating audio introductions and instructions automatically. When a new patient is registered, Python scripts can trigger the creation of personalized audio files. This reduces the time staff spend on manual explanations and provides patients with a consistent, clear introduction to their care plan.

  • Trigger generation upon patient registration
  • Support for 23 languages for diverse populations
  • Fast generation speed for near real-time delivery

Clinical Voices for Patient Education

Sound wave illustration for: Clinical Voices for Patient Education

Medical audio requires distinct tonal qualities depending on the content. Sage provides a calm, instructional baseline ideal for post-procedure instructions, while Luna’s soft storytelling style helps contextualize chronic care management. These presets ensure patient guides are both clear and engaging without requiring custom voice design.

Sage: Calm, instructional tone for procedures

Sage is optimized for clarity and neutrality, making it suitable for detailed medical instructions. Its steady pace ensures patients can follow complex steps without distraction, reducing cognitive load during critical information delivery.

  • Ideal for discharge instructions
  • Clear articulation of dosage schedules
  • Neutral tone reduces patient anxiety

Luna: Soft storytelling for chronic care

Luna offers a warmer, more narrative approach to long-form educational content. This voice style helps maintain patient engagement when explaining the progression of chronic conditions or lifestyle adjustments over time.

  • Engaging narrative structure
  • Soft tone for sensitive topics
  • Reduces listener fatigue

Atlas: Neutral, clear news-style delivery

Atlas delivers neutral, precise articulation similar to professional news broadcasting. This preset is effective for delivering standardized clinical updates or regulatory information where exact wording and neutral delivery are prioritized over emotional nuance.

  • High clarity for dense text
  • Standardized delivery format
  • Neutral professional tone

Support for 23 Languages

Sound wave illustration for: Support for 23 Languages

VoxMedix supports 23 languages, allowing health-tech startups to generate patient guides for diverse populations without managing multiple voice models. Every voice can speak any supported language, ensuring consistent quality across your global user base.

For non-English Latin-script text, explicitly set the language parameter. Without it, the API guesses the language, defaulting to English for Latin scripts.

English, Spanish, French, German, Arabic

Core markets are covered with high-fidelity synthesis. Sage delivers clear, instructional tones ideal for procedural explanations in English, while Luna provides soft storytelling for chronic care narratives in Spanish and French.

  • Arabic script support included
  • Latin script defaults to English if language is unset

Chinese, Japanese, Korean, Hindi

Support for complex scripts ensures accurate pronunciation in high-demand Asian and South Asian markets. The API handles character limits and encoding seamlessly, allowing you to generate guides in Mandarin, Japanese, Korean, and Hindi using the same Python workflow.

Portuguese, Russian, Turkish, and more

Expand into additional regions with support for Portuguese, Russian, Turkish, and 19 other languages. All 8 voice presets are available across all 23 languages, giving you flexibility in tone regardless of the target audience.

  • No support for Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, or Bengali

Developer-First Architecture

Sound wave illustration for: Developer-First Architecture

VoxMedix is built for developers who want a straightforward, Python-friendly API for generating medical audio. We support standard HTTP requests and provide an OpenAI-compatible interface, allowing you to leverage existing SDKs with minimal configuration changes.

OpenAI SDK compatibility

Use the official OpenAI Python SDK by simply pointing it to our base URL. This allows you to generate speech using familiar code structures without learning a new library from scratch.

JSON body requests via POST

Send text to POST https://api.heybhaji.cc/v1/audio/speech with a simple JSON body. Specify the model, voice, and language to receive an audio file directly in the response.

Simple base_url configuration

Configure your SDK client with base_url=https://api.heybhaji.cc/v1 and your API key. The request shape matches the standard OpenAI speech endpoint, ensuring a smooth integration into your existing health-tech pipelines.

Transparent Character Billing

Sound wave illustration for: Transparent Character Billing

Our billing model is strictly based on character count, including spaces and punctuation, at a flat rate of $0.01 per 1,000 characters. This predictable structure allows health-tech startups to accurately forecast costs for patient guide generation without worrying about variable pricing tiers or hidden fees associated with specific voice models.

$0.01 per 1,000 characters

Each request is charged based on the exact length of the input text. Since medical documentation often requires precise terminology, every character contributes to the total, ensuring transparency in your monthly expenses.

  • Spaces and punctuation count as characters
  • Flat rate applies to all models and voices

Failed requests are free

If synthesis fails due to server issues or invalid parameters, the charge is returned in full. You only pay for successfully delivered audio files, reducing risk during integration testing.

No hidden per-voice fees

All eight voice presets, from the calm instructional tone of Sage to the deep documentary style of Orion, are priced identically. There are no extra costs for premium voices or language variants.

Transparent Character Billing

Data Privacy & Compliance

Sound wave illustration for: Data Privacy & Compliance

VoxMedix ensures that input text is used exclusively for audio synthesis. We do not store the generated audio files, meaning your patient data remains ephemeral after delivery. Only request metadata—such as timestamp, character count, and status—are retained for billing purposes.

Unlike many competitors, we do not use your input data to train our models. This guarantees that your proprietary medical documentation stays private. Additionally, every generated audio file includes an inaudible watermark, clearly marking it as synthetic speech for compliance transparency.

Text used only for synthesis

Your medical text is processed solely to generate the audio file. Once the synthesis completes, the audio is returned in the response and not stored on our servers. This minimizes the data surface area, ensuring that sensitive patient information does not linger in long-term storage.

No training on input data

We do not use your input text to improve or train our TTS engines. Your patient guides remain your intellectual property, with no risk of your specific clinical phrasing becoming part of our general model training data. This approach supports stricter internal compliance requirements for health-tech startups.

  • No data retention for model improvement
  • Input text is ephemeral after synthesis
  • Supports HIPAA-friendly data handling workflows (no certification provided)

Synthetic watermarking included

Every audio file generated through our API carries an inaudible digital watermark. This marker identifies the file as synthetic speech, aiding in content provenance and regulatory compliance. It provides an additional layer of transparency for patients and auditors without affecting audio quality.

Technical Limits & Speed

Sound wave illustration for: Technical Limits & Speed

The API enforces a strict 4,096-character limit per request. For longer medical documents, split the text into chunks and concatenate the resulting audio files seamlessly.

4096 characters per request

Each synthesis call accepts up to 4,096 characters, including spaces and punctuation. Handle longer patient guides by splitting input and joining the output audio files.

60 requests per minute limit

Standard keys support 60 requests per minute (10 before the first top-up). Requests process sequentially, so high-volume batches may queue briefly during peak usage.

Real-time generation speed

Generation approximates real-time speed (≈25 characters per second). Short phrases take a few seconds; long texts generate at live pace, ensuring efficient pipeline integration.

Formats for Medical Apps

Sound wave illustration for: Formats for Medical Apps

Medical applications have varying bandwidth and fidelity requirements. Our API supports multiple audio formats to match your specific deployment environment, from lightweight web players to archival storage systems.

MP3 for web streaming

Use MP3 for patient guides delivered via web interfaces. It offers a good balance of file size and quality, ensuring quick load times on mobile devices without sacrificing clarity for audio instructions.

WAV for high fidelity

Choose WAV when uncompressed audio is critical, such as in diagnostic tools or high-end accessibility features. The raw format preserves the full detail of the synthetic speech without compression artifacts.

OPUS and FLAC for storage

For long-term archival or offline distribution, OPUS provides excellent compression with high quality, while FLAC offers lossless storage. These formats minimize storage costs while maintaining audio integrity for medical records.

Start with Python Today

Sound wave illustration for: Start with Python Today

VoxMedix provides a Python-friendly API designed specifically for health-tech startups generating patient guides. You can integrate TTS directly into your EHR data pipelines or automate onboarding workflows with minimal overhead.

The API accepts standard JSON bodies, allowing you to use existing OpenAI SDKs by simply changing the base URL. This ensures a familiar developer experience without learning a new client library.

Get API key in minutes

Sign up at /get-api-key/ using Google or email. Your unique API key is issued immediately, allowing you to start sending synthesis requests to https://api.heybhaji.cc/v1 without delay.

  • Google or email signup
  • Immediate key activation
  • Single active key per account

Use standard HTTP libraries

Send POST requests to the /v1/audio/speech endpoint with your JSON payload. The API handles model selection, voice preset, and format encoding natively.

No custom SDK required. Use Python’s requests library or any standard HTTP client to manage headers and audio responses efficiently.

  • OpenAI-compatible JSON structure
  • Standard HTTP POST
  • No proprietary SDK needed

Test with free trial credit

Start with $0.50 of free trial credit (valid for 7 days) when signing in with Google. This covers approximately 50,000 characters, allowing you to validate audio quality and integration logic before committing.

Failed requests are free, ensuring you only pay for successful synthesis. Balance does not expire.

  • $0.50 trial credit
  • 50,000 characters included
  • 7-day validity

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. You do not need to install specialized medical audio libraries or custom wrappers.

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. FFmpeg documentation
  3. MDN: Web Speech API
  4. Node.js documentation
  5. ISO 639 language codes
  6. IETF RFC 7845: Ogg Opus
  7. LibriVox public-domain audiobooks
  8. Tether (USDT)
  9. TRON developer hub: TRC-20
  10. Python documentation
  11. LibriTTS-R corpus (OpenSLR 141)
  12. W3C WAI: making audio and video accessible

More on this site