Text-to-Speech API with 8 Voices and 23 Languages

By ScriptCare editorial team · Updated 2026-11-18

This page explains how to integrate ScriptCare’s text-to-speech API into your health app or patient portal. You will learn to generate natural audio guides from medical text using standard HTTP requests or the OpenAI SDK. The guide covers authentication, supported voices, and response formats tailored for indie developers building global health communication tools.

We provide eight distinct voices and support 23 languages, ensuring your patient guides are accessible and clear. You will find concrete cURL examples, parameter details, and rate limit information to help you manage character quotas and error handling efficiently. Everything is designed for simple, privacy-respecting audio generation without complex infrastructure.

Text-to-Speech API with 8 Voices and 23 Languages

Frequently asked questions

How do I get my API key?

Sign up on the /get-api-key/ page using Google or email. Your key appears immediately on the dashboard alongside your balance and usage stats. You can issue a new key at any time, which instantly invalidates the old one.

Can I use the OpenAI SDK with this API?

Yes. The request shape matches the OpenAI speech endpoint. Simply change the base_url to https://api.th68casino.com/v1 and use your ScriptCare key. The official OpenAI SDKs work directly by changing the base_url.

What is the base URL for the API?

The base URL is https://api.th68casino.com/v1. Use this for all requests, including the speech endpoint at /v1/audio/speech and the voices endpoint at /v1/voices.

How do I specify a voice in the request?

Include the voice parameter in your JSON body. Choose from eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. Each voice supports all 23 languages.

What happens if I exceed the rate limit?

You are limited to 60 requests per minute per key (10 before the first top-up). Requests are processed sequentially, so excess requests may wait in a queue until capacity is available.

Is the API key secure if exposed?

If exposed, you can issue a new key immediately via the dashboard. The old key stops working at once. Use the Bearer token format in your Authorization header.

Can I use the same key for multiple apps?

Yes, one active key per account can be used across multiple applications. You can generate a new key anytime if needed, which invalidates the previous one instantly.

How do I handle audio streaming?

The API does not support streaming or WebSocket connections. You send a POST request and receive the full audio file in the response. For long texts, split and join files manually.

Do I need to install extra libraries?

No extra libraries are required. You can use plain HTTP or the official OpenAI SDK. No custom SDK or mobile SDK is provided by ScriptCare.

What is the maximum text length per request?

The maximum input length is 4096 characters per request. For longer texts, split the text into parts, generate audio for each, and join the resulting files.

How do I switch from MP3 to WAV?

Set the response_format parameter in your request body to 'wav'. Other supported formats include mp3, opus, flac, and pcm. The default format is mp3.

Can I set a custom speed for the voice?

Yes. Use the speed parameter with a value between 0.25 and 4.0. This allows you to adjust the playback rate of the generated audio to suit your needs.

Does the API support asynchronous requests?

The API processes requests sequentially. There is no asynchronous mode or webhook support. Requests are handled in order, so high load may cause queuing delays.

How do I authenticate my requests?

Include your API key in the Authorization header as a Bearer token: Authorization: Bearer tts-... . Your key is issued upon account creation on the /get-api-key/ page.

First request

curl

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

Start by visiting the /get-api-key/ dashboard on th68casino.com. You can sign up instantly using Google or create an account with just an email and password. This account is specific to this site and gives you immediate access to your unique credentials.

Sign Up on the Dashboard

Sign Up on the Dashboard

Registration takes seconds. Once logged in, you see your active API key, current balance, and a ready-to-use cURL example. If you use email/password, you start without trial credit; Google sign-ins receive $0.50 valid for 7 days.

  • Google or email/password options
  • Immediate key visibility
  • No credit card required

Generate Key from Settings

Generate Key from Settings

Your dashboard displays one active key at a time. You can generate a new key from the settings page whenever needed. The old key stops working immediately when the new one is issued, ensuring tight control over your patient data access.

  • One active key per account
  • Instant deactivation of old keys
  • Simple settings interface

Rotate Keys Securely

Rotate your key anytime via the dashboard. This is useful if you suspect unauthorized use or after deploying your app to production. Since each account holds only one active key, rotation is immediate and leaves no ambiguity about which credential is valid.

  • Immediate effect
  • No downtime required
  • Secure replacement

First Request with cURL

Sound wave illustration for: First Request with cURL

To generate audio quickly, you can use a simple cURL command. This method requires no external libraries and works directly in your terminal.

Send your text to the speech endpoint. The API returns the audio file, ready for your patient portal or health app.

POST to /v1/audio/speech

Direct your request to POST https://api.th68casino.com/v1/audio/speech. Include the text you want converted, up to 4096 characters, in the JSON body.

  • Endpoint: POST /v1/audio/speech
  • Method: POST
  • Content-Type: application/json

Include Bearer Token

Add your API key to the header. Use Authorization: Bearer YOUR_API_KEY to authenticate your request securely.

  • Header: Authorization
  • Value: Bearer YOUR_API_KEY

Receive MP3 Response

The API returns the audio file in the requested format. For web players, MP3 is the standard choice for easy integration.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

You can use the official OpenAI SDK for Python or Node.js without installing a new library. Simply configure the client to point to our API base URL. This allows you to leverage familiar tools and existing code structures while accessing our TTS engine.

The integration requires minimal changes to your initialization logic. By overriding the base URL, the SDK routes requests to our endpoints automatically. This ensures compatibility with standard methods while maintaining the simplicity of a single unified client setup.

Set base_url to our API

Configure your SDK client instance by setting the base URL to https://api.th68casino.com/v1. This redirects all standard API calls to our infrastructure. You continue using your existing API key format, prefixed with Bearer.

This approach works with both Python and JavaScript SDKs. It eliminates the need for custom HTTP clients or manual header management. Your code remains clean and uses standard library methods for authentication and request routing.

  • Supports Python and Node.js OpenAI SDKs
  • No custom client library required
  • Uses standard Bearer token authentication

Use Standard Speech Endpoint

Call the audio.speech.create() method exactly as you would for OpenAI. Pass your text, selected voice, and desired format. The SDK handles the JSON serialization and sends the request to our /v1/audio/speech endpoint.

Ensure you include the model parameter (tts-1 or tts-1-hd) and your chosen voice. The SDK manages the request body structure, so you only provide the necessary parameters. This keeps your code concise and readable.

  • Use audio.speech.create() method
  • Pass model, input, and voice
  • No extra parameters needed

Handle Responses Like OpenAI

The API returns an audio file, just like the OpenAI API. Handle the response by saving the output to a file or playing it directly in your patient portal. The response structure matches standard expectations.

If an error occurs, such as a rate limit or invalid input, the SDK throws an appropriate exception. Catch these errors to handle retries or notify users. This ensures robust error handling in your health app workflow.

Audio files are generated in formats like MP3 or WAV. You can save the data to a file or play it directly in your patient portal. The response includes the audio content in the format you requested.

  • Returns audio stream or file
  • Standard exception handling for errors
  • Supports MP3, WAV, OPUS, FLAC

Supported Request Parameters

Sound wave illustration for: Supported Request Parameters

The API accepts two model variants, tts-1 and tts-1-hd, which share the same engine and pricing structure. You choose based on your preference for standard versus high-definition audio output. Both models process text up to 4096 characters per request, making them suitable for generating concise patient instructions or short medical summaries without needing complex splitting logic.

For voice selection, you can choose from eight distinct presets. Female voices like Aria offer a warm, clear narration style ideal for general health guides, while male options like Atlas provide a neutral tone suited for news updates. Each voice is designed to deliver clear, natural-sounding audio for patient portals.

Model: tts-1 or tts-1-hd

Both tts-1 and tts-1-hd use the same underlying engine and price. Select tts-1-hd if you prefer high-definition audio, though the character limit remains 4096 per request. The choice does not affect your billing rate, which is $0.01 per 1,000 characters.

Use the model field in your JSON body to specify your preference. The API processes requests sequentially, so longer texts may queue under load, but the engine handles the synthesis consistently regardless of the model variant chosen.

  • Both models share identical pricing and engine capabilities.
  • Maximum input length is 4096 characters per request.
  • No performance difference in processing time between models.

Voice: 8 Preset Options

Choose from eight licensed voices, including Aria, Nova, Luna, Sage, Felix, Milo, Atlas, and Orion. Each voice offers a distinct tone, from the calm instructional style of Sage to the energetic promo vibe of Felix. All voices support all 23 languages, ensuring consistent quality across global health communications.

The voice parameter accepts these preset names. If you omit the language field, the system guesses it from the text script, but for non-English Latin text, explicitly setting the language ensures accurate pronunciation. Every audio file includes an inaudible watermark identifying it as synthetic.

  • 8 distinct voice presets available.
  • All voices support 23 languages.
  • Includes Aria, Nova, Luna, Sage, Felix, Milo, Atlas, Orion.

Speed: 0.25 to 4.0

Adjust the speed parameter between 0.25 and 4.0 to control the playback rate. A faster speed can help patients quickly digest routine information, while a slower pace may improve comprehension for complex medical instructions. The default speed is 1.0, providing a natural, conversational rhythm.

This parameter allows you to tailor the audio experience for different user needs. For example, using a speed of 2.0 can significantly reduce wait times for bulk audio generation, helping you keep up with the 60 requests per minute rate limit during high-traffic periods.

  • Speed range: 0.25 to 4.0.
  • Default speed is 1.0 for natural pacing.
  • Adjustable to optimize for comprehension or generation speed.

Response Formats

Sound wave illustration for: Response Formats

The API returns audio in five distinct formats, letting you choose the right balance of quality, file size, and compatibility for your patient portal or health app. Selecting the correct response_format ensures optimal playback across different devices and networks.

MP3 for Web Players

MP3 is the default and most versatile choice for web-based audio players. It offers excellent compression with acceptable quality, making it ideal for web-based audio guides on various devices.

WAV for High Quality

Choose WAV when you need lossless audio for high-fidelity playback or further processing. This uncompressed format preserves the full audio data, ensuring that subtle nuances in the synthetic voice remain intact for critical medical instructions.

OPUS and FLAC for Archives

OPUS provides superior compression for modern web applications, while FLAC offers lossless compression for archival storage. Use these formats when storing long audio guides or when you need to preserve quality without the large file size of WAV.

Response Formats

Rate Limits and Quotas

Sound wave illustration for: Rate Limits and Quotas

ScriptCare’s API enforces a limit of 60 requests per minute per active key, ensuring stable performance for your patient audio guides. This quota applies uniformly regardless of the model used, keeping generation predictable for your indie health app.

60 Requests Per Minute

The standard rate limit allows 60 API calls per minute. This capacity is sufficient for most batch-processing workflows, such as generating daily medication reminders or updating multiple patient portal articles at once.

10 Requests Before Top-Up

New accounts start with a restricted quota of 10 requests per minute. This allows you to test the integration with your free trial credit ($0.50) without hitting limits immediately. Once you top up via USDT (TRC-20), the limit increases to the full 60 requests per minute.

  • Free trial accounts begin at 10 requests/minute.
  • Top-up via TRON (TRC-20) unlocks the full 60 requests/minute.
  • No minimum spend required to increase limits.

Queue Processing on Load

Requests are processed sequentially. Under high load, your synthesis jobs may wait in a queue before processing begins. While typical speed is roughly real-time, brief delays are normal during peak usage. Failed requests remain free, so queued retries do not incur extra costs.

Error Handling

Sound wave illustration for: Error Handling

Errors are returned as standard HTTP codes so your app can react instantly. Always check the status code before parsing the audio payload to avoid silent failures in patient guide delivery.

We return specific codes for authentication, throttling, and server issues. This structure lets you implement simple retry logic or alert your users without guessing what went wrong.

401 for Invalid Keys

A 401 status means the Bearer token is missing, expired, or incorrect. Rotate your key in the dashboard settings immediately, as old keys stop working the moment a new one is issued.

Ensure your authorization header matches the format Authorization: Bearer tts-... exactly. Case sensitivity matters for the prefix.

  • Check key format in dashboard
  • Rotate key to invalidate old one
  • Verify Bearer token syntax

429 for Rate Limits

You hit 60 requests per minute. New accounts start with a 10 requests/minute limit until the first top-up is processed. Wait for the window to reset or add USDT credit to increase your baseline.

Requests are processed sequentially under load, so a 429 might also occur if the queue is full during high traffic periods.

  • Standard limit: 60 req/min
  • Initial limit: 10 req/min
  • Queue processing during load

500 for Service Errors

A 500 indicates a temporary server issue. Failed requests are free, so no credit is deducted. Wait a few seconds and retry the same text.

We do not offer SLAs, so brief outages may occur. Keep your app resilient by handling these errors gracefully.

  • Retry on 500 errors
  • Failed requests are free
  • No SLA guarantee

Voice Selection Guide

Sound wave illustration for: Voice Selection Guide

Choosing the right voice is critical for patient comfort and clarity. Our eight presets are designed to match specific medical communication contexts, ensuring the audio guide feels natural and trustworthy without sounding robotic or overly casual.

Aria for General Narration

Aria offers a warm, clear narrator tone ideal for general health overviews and introductory patient guides. Her voice is easy to listen to for extended periods, making her perfect for explaining daily routines or basic wellness tips without causing listener fatigue.

  • Warm and clear tone
  • Ideal for general narration
  • Best for patient onboarding

Atlas for News Updates

Atlas provides a neutral, news-style delivery suitable for clinical alerts or hospital announcements. His consistent, steady pace helps convey important updates clearly, ensuring patients and staff receive time-sensitive medical information without distraction or emotional bias.

  • Neutral and professional
  • Clear delivery for alerts
  • Suitable for announcements

Sage for Instructions

Sage delivers a calm, instructional voice perfect for step-by-step medication guides or procedure instructions. Her soothing tone helps reduce anxiety while patients follow complex health protocols, ensuring each step is understood clearly and calmly.

  • Calm and instructional
  • Reduces patient anxiety
  • Best for step-by-step guides

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Our platform simplifies medical navigation so patients can easily understand their health journey.

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 API reference: create speech
  3. curl documentation
  4. LibriTTS-R paper (arXiv 2305.18802)
  5. TRON developer hub: TRC-20
  6. Python documentation
  7. LibriVox public-domain audiobooks
  8. LibriTTS-R corpus (OpenSLR 141)
  9. MDN: Web Speech API
  10. FFmpeg documentation
  11. ISO 639 language codes
  12. IETF RFC 7845: Ogg Opus

More on this site