Generate Audio with Our Cloud Text-to-Speech API

By MedVoice API editorial team · Updated 2026-11-18

This guide walks you through integrating MedVoice’s cloud text-to-speech API into your health tech application. You will learn how to generate clear, compliant audio guides from medical text using standard HTTP requests or the familiar OpenAI SDK. We cover authentication, rate limits, voice configuration, and error handling to help you build reliable patient education workflows.

Designed for developers, this documentation provides concrete examples and technical specifics. You will find ready-to-use cURL commands, SDK setup instructions, and details on supported languages and audio formats. Follow these steps to turn your medical content into natural-sounding speech without managing complex infrastructure.

Generate Audio with Our Cloud Text-to-Speech API

Frequently asked questions

How do I get an API key?

Sign up on our /get-api-key/ page using Google or an email and password. Your account key is displayed immediately on that page. You can issue a new key at any time, which stops the old one instantly. This key is used for authentication via the Authorization header.

What is the endpoint URL?

Send POST requests to https://api.cc77play.com/v1/audio/speech. Use the JSON body format compatible with the OpenAI speech endpoint. Other endpoints include GET /v1/voices for voice details and GET /v1/models for model information. Ensure your base URL is set correctly if using SDKs.

Can I use the OpenAI SDK?

Yes, the official OpenAI SDKs work perfectly. You only need to change the base_url to https://api.cc77play.com/v1 and use your MedVoice API key. The request shape matches the OpenAI speech endpoint exactly, allowing you to integrate our TTS service into your existing OpenAI-based workflows easily.

What audio formats are supported?

You can choose from mp3, wav, opus, flac, or pcm by setting the response_format field. These formats are available for all voice models. Select the format that best fits your application’s requirements for file size and quality. The generated audio is returned directly in the response.

How do I set the language?

Include the optional language field with an ISO code. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, explicitly set the language to ensure accurate synthesis across the 23 supported languages.

What is the rate limit?

The limit is 60 requests per minute per key. If you have not topped up your account, the limit is 10 requests per minute. These limits apply to your API key. Monitor your usage via the dashboard to avoid hitting these thresholds during high-volume generation.

What happens if I hit the rate limit?

Requests are processed sequentially, so you may experience queueing under load. If you exceed the limit, requests are rejected. Failed requests are free, so you will not be charged for audio that fails to generate due to rate limiting or other errors.

How do I handle errors?

Check the response status code and body for error details. If synthesis fails, the charge is returned in full. Ensure your input text is within the 4096 character limit and your API key is valid. Use standard HTTP error handling in your integration code.

Is the API synchronous?

Yes, the API is synchronous. You send a POST request and receive the audio file in the response. Requests are processed one after another, so under load, a request may wait in a queue. There is no WebSocket or streaming endpoint.

Can I stream the audio?

No, streaming is not supported. The API returns the complete audio file in a single synchronous response. If you need streaming, you must download the full file and handle playback on the client side.

What is the character limit per request?

Each request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For texts longer than 4096 characters, you must split the text into parts, generate audio for each part, and join the resulting audio files.

How do I split long texts?

Split your text into chunks of up to 4096 characters. Send each chunk as a separate POST request to the speech endpoint. Collect the returned audio files and join them in your application. This ensures all text is synthesized without exceeding the per-request limit.

Do I need a specific SDK version?

No specific version is required. The standard OpenAI SDK works by changing the base_url. You can use any version that supports the OpenAI speech endpoint structure. Ensure your SDK is configured to send JSON bodies with the correct fields like model, input, and voice.

How do I regenerate my API key?

Issue a new key from your account dashboard at any time. When you generate a new key, the old one stops working immediately. This ensures security if a key is compromised. You can have only one active key per account at any given time.

First request

curl

curl https://api.cc77play.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

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.cc77play.com/v1", api_key="tts-...")

with client.audio.speech.with_streaming_response.create(
    model="tts-1", voice="nova", input="Hello from Python.", response_format="mp3"
) as response:
    response.stream_to_file("hello.mp3")

Node.js (openai)

import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({ baseURL: "https://api.cc77play.com/v1", apiKey: process.env.TTS_API_KEY });
const res = await client.audio.speech.create({ model: "tts-1", voice: "milo", input: "Hello from Node.js." });
fs.writeFileSync("hello.mp3", Buffer.from(await res.arrayBuffer()));
voice
ariafemale
novafemale
lunafemale
sagefemale
felixmale
milomale
atlasmale
orionmale
language
arالعربية
zh中文
daDansk
nlNederlands
enEnglish
fiSuomi
frFrançais
deDeutsch
elΕλληνικά
heעברית
hiहिन्दी
itItaliano
ja日本語
ko한국어
msBahasa Melayu
noNorsk
plPolski
ptPortuguês
ruРусский
esEspañol
swKiswahili
svSvenska
trTürkçe

Get your API key

Sound wave illustration for: Get your API key

To start using MedVoice API, create an account on our /get-api-key/ page. This is where you manage your credentials and billing for medical text-to-speech generation.

Your account is tied to this specific site. Once registered, you will have access to a dashboard where your API key and usage metrics are displayed.

Sign up on /get-api-key/

Navigate to the registration page to begin. You can sign up using your Google account or by providing an email and password. Accounts are created per site, so ensure you are on cc77play.com.

Use Google or email authentication

Choose your preferred authentication method. Google sign-in provides immediate access, while email registration creates a standard account. Both methods are secure and allow you to manage your API key effectively.

  • Google authentication for quick setup
  • Email and password for standard accounts

Copy your active key from the dashboard

After signing in, go to your dashboard to view your active API key. This key starts with 'tts-' and is required for authenticating your requests. Copy it carefully to use in your application.

  • Key format: tts-...
  • One active key per account

Test with cURL

Use the provided cURL example to verify your key works. Replace 'YOUR_API_KEY' with your actual key. This simple test sends a short text and returns an audio file, confirming your setup is correct.

  • Replace YOUR_API_KEY
  • Verify audio output

Make your first request

Sound wave illustration for: Make your first request

Send a POST request to https://api.cc77play.com/v1/audio/speech with your bearer token in the Authorization header. The endpoint accepts JSON payloads to synthesize medical text into audio files efficiently.

Use POST to /v1/audio/speech

Construct your request body with the required parameters. Ensure your API key is active and included in the header to authenticate the request immediately.

Include text, voice, and model

Specify the model as "tts-1" or "tts-1-hd". Provide the input text (max 4096 characters) and select a voice from the 8 available presets. Optionally set the language ISO code for accurate synthesis, especially for non-English Latin scripts.

  • Model: "tts-1" or "tts-1-hd"
  • Input: Text string up to 4096 characters
  • Voice: One of 8 presets (e.g., aria, atlas)
  • Language: Optional ISO code (e.g., "en", "de")

Receive audio file in response

The API returns the synthesized audio file directly in the response body. Supported formats include mp3, wav, opus, flac, and pcm. Failed requests are free, ensuring you only pay for successful synthesis.

Make your first request

Use the OpenAI SDK

Sound wave illustration for: Use the OpenAI SDK

Integrate MedVoice into your health tech app using the official OpenAI SDKs for Python or Node.js. Since our API endpoint mirrors the OpenAI speech structure, you can leverage familiar libraries without learning a new interface. This approach simplifies development for patient education audio guides.

Install the official OpenAI Python/Node SDK

Add the standard OpenAI library to your project environment. For Python, use pip install openai. For Node.js, run npm install openai. This provides the client classes needed to send TTS requests.

Set base_url to https://api.cc77play.com/v1

Configure the SDK client to point to our infrastructure. Initialize the client with your API key and set the base_url parameter to https://api.cc77play.com/v1. This directs all requests to the MedVoice endpoint while maintaining standard OpenAI compatibility.

Use the same client methods

Call the standard audio.speech method with your parameters. Pass the model (tts-1 or tts-1-hd), input text, voice, and response_format. The SDK handles the JSON structure and authentication header automatically, returning the audio file directly for playback or storage.

Supported audio formats

Sound wave illustration for: Supported audio formats

Choose the audio format that best fits your patient education workflow. Each format balances compatibility, file size, and quality differently, allowing you to optimize delivery for various devices and network conditions.

MP3 for web and mobile

MP3 is the standard choice for web players and mobile applications. It offers broad compatibility across all major browsers and devices while keeping file sizes manageable.

WAV for high-quality local storage

Select WAV when you need uncompressed, high-fidelity audio for local storage or professional editing. This format preserves the full quality of the synthesized speech without any lossy compression artifacts.

OPUS and FLAC for efficiency

OPUS provides excellent compression for efficient bandwidth usage, ideal for low-bandwidth environments. FLAC offers lossless compression, reducing file size while maintaining perfect audio fidelity for archival purposes.

Configure voice and language

Sound wave illustration for: Configure voice and language

MedVoice API offers eight distinct voice presets to match your content’s tone, from the warm narration of Aria to the neutral delivery of Atlas. Each voice is engineered for clarity, ensuring patient education materials are easy to understand regardless of the listener’s hearing ability or device quality.

Choose from 8 preset voices

Select voices like Luna for soft storytelling or Felix for energetic promos. All voices are based on licensed recordings and include an inaudible synthetic watermark.

  • 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

Set language ISO code explicitly

For optimal accuracy, explicitly set the language field using the ISO code. Our API supports 23 languages, including English, Spanish, German, and French, allowing precise control over pronunciation for medical terminology.

Default language detection for Latin text

If you omit the language parameter, the system guesses the language based on the script. Latin-script text defaults to English, but for other languages like Dutch or Swedish, always specify the code to ensure correct enunciation.

Configure voice and language

Handle rate limits

Sound wave illustration for: Handle rate limits

Rate limits protect service stability during peak usage. Your API key allows 60 requests per minute, sufficient for most batch-processing workflows in health tech applications.

60 requests per minute per key

Each key is limited to 60 requests per minute. This limit applies across all models and voices. Monitor your usage dashboard to stay within bounds.

  • Limit: 60 requests/minute/key
  • Applies to all endpoints

10 requests before first top-up

New accounts without a top-up are limited to 10 requests per minute. This allows testing the API with your free trial credit. Top up via USDT on the TRON network (TRC-20) to unlock the full 60 req/min capacity.

Queue processing under load

Requests are processed sequentially. Under heavy load, your request may wait in a queue. Longer texts take more time to synthesize. Plan your generation steps accordingly to avoid delays.

Common errors and fixes

Sound wave illustration for: Common errors and fixes

The API returns specific error codes to help you troubleshoot integration issues quickly. Understanding these responses ensures your health tech application handles audio generation failures gracefully without wasting patient education credits.

401 for invalid or expired keys

Receive a 401 status when the Authorization header contains an incorrect or revoked key. This occurs if you issued a new key via the dashboard, instantly invalidating the previous one. Regenerate your active key from /get-api-key/ and update your configuration.

429 for rate limit exceeded

A 429 error indicates you have exceeded the 60 requests per minute limit. New accounts start with a 10 requests/minute limit until the first top-up is processed. Implement exponential backoff in your client to handle queue delays during peak usage.

  • Limit: 60 requests/minute after top-up
  • Limit: 10 requests/minute initially
  • Implement retry logic with backoff

400 for missing required fields

The API returns a 400 error if the JSON body lacks required fields like model or input. Ensure input does not exceed 4096 characters. Split longer medical texts into smaller chunks before sending requests to avoid truncation errors.

  • Include model, input, and voice
  • Limit text to 4096 characters
  • Validate JSON structure before sending
Common errors and fixes

Test with cURL

Sound wave illustration for: Test with cURL

Use the provided cURL example to verify your integration quickly. This command sends a simple text payload to the TTS endpoint, allowing you to confirm that your account is active and the API is responding correctly.

Use the provided cURL example

Copy the command below into your terminal. It targets the standard speech endpoint with a short medical phrase, ensuring you receive a valid audio file.

Replace YOUR_API_KEY

Update the placeholder with your actual key from the dashboard. Ensure the format is Bearer tts-... to authenticate your request correctly.

Verify audio file output

Check that the response contains a valid audio file in your chosen format. This confirms your integration is ready for patient education content.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Our platform simplifies complex clinical data into clear, actionable insights for modern healthcare startups seeking rapid market validation.

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. LibriTTS-R corpus (OpenSLR 141)
  3. W3C WAI: making audio and video accessible
  4. MDN: Web Speech API
  5. Node.js documentation
  6. OpenAI API reference: create speech
  7. LibriTTS-R paper (arXiv 2305.18802)
  8. openai-python on GitHub
  9. Creative Commons Attribution 4.0
  10. openai-node on GitHub
  11. TRON developer hub: TRC-20
  12. curl documentation

More on this site