Text-to-Speech API for Transport Announcements

By ScribeCast editorial team · Updated 2026-11-18

This guide helps indie developers integrate realistic synthetic speech into public transport and parking systems. You will learn how to send text and receive audio files using our straightforward API, which mirrors the OpenAI speech endpoint structure for easy adoption.

We focus on simple integration so you can prioritize the user experience. Here you will find concrete examples for authentication, parameter configuration, and error handling, along with specific details on rate limits and voice presets tailored for automated announcements.

Text-to-Speech API for Transport Announcements

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. Accounts are per site. Once registered, your dashboard displays your active API key, current balance, and usage statistics immediately, allowing you to start testing your transport announcements right away without waiting for approval.

Can I use the OpenAI SDK?

Yes, the official OpenAI SDKs work perfectly. You simply change the base_url to https://api.wz777app.com/v1 and use your ScribeCast key. This allows indie developers to leverage familiar code structures for integrating realistic synthetic speech into their parking systems or public transport applications with minimal effort.

What is the base URL?

The API base URL is https://api.wz777app.com/v1. You will use this endpoint for all requests, including generating audio via POST /v1/audio/speech or retrieving available voices via GET /v1/voices. Ensure your SDK or HTTP client is configured to point to this specific domain for authentication.

How do I send a request?

Send a POST request to https://api.wz777app.com/v1/audio/speech with a JSON body. Include your model (tts-1 or tts-1-hd), input text, voice preset, response format, and optional speed. Authenticate using the Authorization: Bearer header with your API key. The API returns the generated audio file directly.

What formats are supported?

We support mp3, wav, opus, flac, and pcm response formats. Choose the format that best fits your transport system’s playback hardware or software requirements. For example, use mp3 for efficient storage or wav for high-fidelity public address systems. The format is specified in the request body.

What are the rate limits?

You are limited to 60 requests per minute per API key. New accounts start with a lower limit of 10 requests per minute until you make your first top-up. This ensures fair usage for indie developers building parking or transit features without requiring enterprise-grade infrastructure for moderate traffic.

How do I handle errors?

If synthesis fails, the charge is returned in full, so you are not billed for errors. Monitor your response status codes to detect issues like invalid inputs or rate limit exceedances. Failed requests do not consume your character balance, allowing you to retry safely without financial penalty.

Can I regenerate my key?

Yes, you can issue a new API key at any time from your dashboard. When you generate a new key, the old one stops working immediately. This is useful for security if you suspect your key was exposed in your transport app’s client-side code or logs.

Is there a SDK for mobile?

No, we do not offer a mobile SDK. You should use the standard OpenAI SDK or plain HTTP requests to integrate with your mobile app. Since our API follows the standard OpenAI request shape, you can easily adapt existing HTTP libraries to call our speech endpoint.

Do I need to install anything?

No, you do not need to install any specific software or plugins. Since we provide a cloud API, you only need an internet connection and an HTTP client compatible with JSON requests. This simplicity allows indie developers to quickly prototype voice features for parking systems or automated announcements.

How do I split long texts?

Split your text into parts of up to 4096 characters per request. Generate audio for each part separately, then join the resulting audio files in your application. This approach ensures reliable synthesis and avoids hitting character limits, which is common for detailed transit route announcements or instructions.

What happens if I exceed limits?

If you exceed the 60 requests per minute limit, your requests may be queued or rejected. Under load, requests are processed sequentially, so long texts may take time. Failed requests are free, but successful ones consume your balance. Monitor your usage to avoid interruptions during peak transit hours.

Can I use different voices?

Yes, you can choose from 8 voice presets like aria, nova, or atlas. Each voice has a distinct tone suitable for different announcement types, from calm instructions to energetic promos. You specify the voice in the request body, allowing you to customize the audio experience for your specific transport use case.

How do I set the language?

Set the optional 'language' field to an ISO code if needed. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, explicitly setting the language ensures accurate synthesis, supporting 23 languages including Arabic, Chinese, and Spanish.

First request

curl

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

Authentication and keys

Sound wave illustration for: Authentication and keys

Access the API by creating an account on /get-api-key/. Sign in with Google or use email and password. The dashboard displays your unique API key, current balance, and usage statistics.

Get your API key

Get your API key

Navigate to /get-api-key/ to sign up. Google sign-in provides a $0.50 trial credit valid for 7 days. Email accounts start without trial credit. Your key appears immediately on the dashboard alongside your balance.

Bearer token format

Bearer token format

Include your key in the request header as Authorization: Bearer tts-.... This format works with the official OpenAI SDKs by setting the base URL to https://api.wz777app.com/v1. Each account holds one active key at a time.

Regenerate keys instantly

Issue a new key anytime from your dashboard. The old key stops working immediately, ensuring secure access control. This is useful if you suspect exposure or rotate credentials for different transport modules.

Keep your key private. It provides full access to your account's characters and billing.

  • New keys replace the old one instantly
  • One active key per account

Quickstart with curl

Sound wave illustration for: Quickstart with curl

Generate your first transport announcement in seconds. Send a simple POST request to the speech endpoint with your API key and text. The API returns an audio file ready for your public transport or parking system.

Use the provided curl example to test connectivity. Replace YOUR_API_KEY and your target text. The response delivers the synthetic speech file directly to your terminal or script.

Basic POST request

Send a POST request to https://api.wz777app.com/v1/audio/speech. Include your Bearer token in the Authorization header. Set the Content-Type to application/json.

  • Endpoint: POST https://api.wz777app.com/v1/audio/speech
  • Header: Authorization: Bearer tts-...

JSON body structure

The request body requires the model, input, and voice fields. You can optionally specify response_format, speed, and language.

The input text is limited to 4096 characters. Spaces and punctuation count toward this limit.

  • model: 'tts-1' or 'tts-1-hd'
  • voice: e.g., 'aria', 'milo'
  • input: your announcement text
  • response_format: 'mp3', 'wav', 'opus', 'flac', or 'pcm'

Response format

On success, the API returns the audio file in the requested format. Failed requests return an error JSON object and are free of charge.

Use the returned audio file directly in your transport announcements or parking systems.

OpenAI SDK integration

Sound wave illustration for: OpenAI SDK integration

The API mirrors the OpenAI speech endpoint structure, allowing you to leverage existing SDKs with minimal code changes. Simply update the base URL to https://api.wz777app.com/v1 and inject your ScribeCast key. This approach lets indie developers integrate voice features for parking systems or transit announcements without learning a new library.

Change base URL

Point your SDK client to https://api.wz777app.com/v1 instead of the standard OpenAI endpoint. Ensure your Authorization: Bearer tts-... header remains intact. This single configuration shift enables all standard speech synthesis calls.

Use official SDKs

You can use the official OpenAI Python or Node.js SDKs directly. Pass your ScribeCast API key as the bearer token. The SDK handles the JSON serialization and response parsing automatically, reducing boilerplate code for your transport announcements.

Compatible endpoints

The POST /v1/audio/speech endpoint accepts the same JSON body as OpenAI. You can also use GET /v1/voices to list available presets or GET /v1/models to verify engine status. This consistency simplifies integration for existing OpenAI workflows.

  • POST /v1/audio/speech
  • GET /v1/voices
  • GET /v1/models

Request parameters

Sound wave illustration for: Request parameters

Configure your synthesis requests with precise parameters to match your transport or announcement use case. The API accepts standard fields to define the audio output, allowing you to switch between models or adjust voice characteristics without changing your integration code.

Every parameter directly influences the final audio file’s character count, processing time, and tone. Accurate configuration ensures your automated announcements sound natural and fit within your budget constraints.

Model selection

Choose between "tts-1" for standard quality or "tts-1-hd" for higher fidelity. Both models use the same engine and pricing, so select based on whether you need the enhanced audio clarity for complex station announcements or the standard output for simple parking notifications.

Voice presets

Select from eight distinct voice presets, such as 'aria' for warm narrations or 'atlas' for neutral news-style updates. Each voice is designed for specific tones, from upbeat to documentary, ensuring your public transport messages resonate with the intended audience.

You can pick 'milo' for friendly conversational tones or 'sage' for clear instructional guidance. All voices support the full range of 23 languages, allowing consistent branding across diverse routes.

  • 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

Speed and language

Adjust the speed between 0.25 and 4.0 to fit tight schedules or allow slower processing for complex routes. You can also optionally specify a language ISO code to ensure correct pronunciation, especially for non-English Latin script texts where auto-detection might guess English by default.

If the language is omitted, the system guesses from the script. For mixed-language announcements, explicitly setting the language field prevents mispronunciation and ensures accurate delivery for passengers.

  • Speed: 0.25–4.0
  • Language: optional ISO code
  • Auto-detects script if omitted

Response formats

Sound wave illustration for: Response formats

The API returns synthesized audio as a binary file within the HTTP response body, allowing you to save the file directly or play it in your transport application’s media player. You can choose from several standard formats depending on your storage needs and playback requirements.

MP3 support

MP3 is the default and most compatible format for web players and mobile apps. It offers a good balance between file size and audio quality, making it ideal for storing thousands of station announcements without excessive storage costs.

WAV and FLAC options

Use WAV for uncompressed, lossless audio that preserves the full quality of the synthesis engine. FLAC provides lossless compression, reducing file size by roughly 50–60% compared to WAV while maintaining identical audio fidelity, which is useful for archival purposes.

PCM and Opus

PCM provides raw, uncompressed linear audio data, which is useful for immediate playback without decoding overhead. Opus offers high-quality compression suitable for low-bandwidth environments, ensuring clear announcements even on older public address systems.

Response formats

Error handling

Sound wave illustration for: Error handling

Synthetic speech generation is straightforward, but API calls can fail due to network issues, invalid parameters, or exceeding rate limits. Understanding these errors helps you build robust transport announcements that handle edge cases gracefully without confusing passengers.

Common error codes

The API returns standard HTTP status codes to indicate success or failure. A 200 OK means the audio file is ready. Use 400 for bad requests, 401 for authentication issues, and 500 for server-side synthesis failures. Failed requests are free, so no charge occurs if synthesis fails.

Rate limit messages

  • 429 Too Many Requests: You have exceeded 60 requests per minute per key.

Input validation

Ensure your text input does not exceed 4096 characters per request. The API will reject requests with invalid JSON bodies or unsupported response formats. Always validate your payload before sending to avoid unnecessary API calls.

Rate limits and quotas

Sound wave illustration for: Rate limits and quotas

Your API key allows 60 requests per minute for standard usage. This limit ensures stable service for your transport announcements and parking system integrations without requiring enterprise-grade infrastructure.

60 requests per minute

After activating your account, you can generate audio at a rate of 60 requests per minute. This throughput is sufficient for most indie developer use cases, such as batch-processing parking lot announcements or updating public transit displays.

10 requests before top-up

New accounts start with a lower limit of 10 requests per minute until you add funds. This restriction applies to your free trial balance and initial usage. Once you top up via USDT (TRC-20), your rate increases immediately to the full 60 requests per minute.

  • Minimum top-up is $5 USDT (TRC-20).
  • Balance does not expire.
  • No monthly plans or subscriptions required.

Queue behavior

Requests are processed sequentially. Requests are processed one after another, so under load a request may wait in a queue. Short phrases take a few seconds to generate, while longer texts process at roughly real-time speed. Plan your integration to handle these slight delays gracefully.

Best practices

Sound wave illustration for: Best practices

Optimizing your transport announcements requires balancing voice quality with network efficiency. Synthesis takes roughly 25 characters of text per second of generation; long station names or complex schedules benefit from strategic splitting to keep the user experience responsive without unnecessary waiting.

Split long texts

The API limits input to 4,000 characters per request. For lengthy announcements, split your text into smaller segments and concatenate the resulting audio files. This ensures each chunk generates quickly, maintaining a natural flow for passengers.

Handle retries

Requests are processed sequentially, so under heavy load, your call may queue. Implement exponential backoff for retries. If a request fails, the charge is returned, so retrying is safe. Avoid aggressive polling to prevent hitting your rate limit.

Cache static announcements

Station names and safety warnings rarely change. Generate these once using your preferred voice and save the audio file locally. Serving cached files eliminates API calls, reduces latency, and saves your character quota for dynamic, real-time updates.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Her clear enunciation works well for general information, reducing listener fatigue during long commutes.

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. LibriVox public-domain audiobooks
  3. Python documentation
  4. Tether (USDT)
  5. W3C WAI: making audio and video accessible
  6. Node.js documentation
  7. openai-python on GitHub
  8. IETF RFC 7845: Ogg Opus
  9. MDN: Web Speech API
  10. OpenAI API reference: create speech
  11. curl documentation
  12. TRON developer hub: TRC-20

More on this site