Integrate Our Text-to-Speech API: A Quickstart Guide for Developers

By Voctet editorial team · Updated 2026-11-18

This guide helps indie developers quickly integrate our text-to-speech API to generate synthetic audio files for ML datasets. Instead of manual recording, you get structured, watermark-marked audio instantly via a standard REST endpoint compatible with existing OpenAI SDKs.

You will learn how to authenticate, structure requests, and handle responses for formats like MP3 or FLAC. The guide covers key parameters, rate limits, and error handling, ensuring you can build reliable TTS pipelines without unnecessary complexity.

Integrate Our Text-to-Speech API: A Quickstart Guide for Developers

Frequently asked questions

How do I get an API key?

Sign up at https://play09bet.com/get-api-key/ using Google or email. You receive one active key per account. You can issue a new key anytime; the old one stops immediately. Failed requests are free. A $0.50 trial credit is available for Google sign-ups.

What is the base URL?

The API base URL is https://api.play09bet.com/v1. Use this endpoint for all requests, including POST /v1/audio/speech, GET /v1/voices, and GET /v1/models. Configure your client to use this base URL for standard operations.

Can I use the OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. Change the SDK’s base_url to https://api.play09bet.com/v1 and use your Voctet key. The official OpenAI SDKs work directly with this configuration for seamless integration.

What models are available?

Two models are available: tts-1 and tts-1-hd. Both use the same engine and pricing. Select either model in your request body. The choice does not affect cost or voice quality, only the model identifier used in the API call.

How do I set the language?

Pass an optional ISO language code in the request. If omitted, the system guesses from the script, defaulting to English for Latin text. Set it explicitly for non-English Latin-script text to ensure correct pronunciation for the 23 supported languages.

What is the character limit?

Each request supports up to 4096 characters in the input field. For longer texts, split them into parts of this size and join the resulting audio files. Spaces and punctuation count toward this limit.

How do I handle errors?

Failed requests are free, and the charge is returned in full. Check the response status code for errors. If synthesis fails, you are not billed. Ensure your input text is within the 4096-character limit and uses supported voices.

What are the rate limits?

You are limited to 60 requests per minute per key. Before the first top-up, the limit is 10 requests per minute. Requests are processed sequentially, so high load may cause queuing delays. Monitor your usage to avoid throttling.

Can I change the speaking speed?

Yes. Adjust the speed parameter between 0.25 and 4.0. This allows you to slow down narration or speed up promotional content. The default speed is typically 1.0. Adjust based on your specific use case for optimal clarity.

Is the API compatible with cURL?

Yes. The API accepts standard JSON bodies via POST requests. You can easily generate audio using cURL commands. The documentation provides ready-to-use examples for quick testing and integration into your existing workflows or scripts.

How do I list available voices?

Send a GET request to /v1/voices. This endpoint returns all 8 voice presets, supported languages, and formats. Use this to verify available options before generating audio. The voices include aria, nova, luna, sage, felix, milo, atlas, and orion.

What formats are supported?

Supported formats are mp3, wav, opus, flac, and pcm. Specify the desired format in the response_format field of your request. Choose based on your storage or processing needs. All generated files include an inaudible synthetic watermark.

How do I revoke my API key?

Issue a new API key from your account dashboard. The old key stops working immediately when the new one is created. You can revoke and replace keys at any time. This ensures secure access control without waiting for expiration.

Is the API synchronous or asynchronous?

The API is synchronous. You send a request and receive the audio file in the response. Requests are processed one after another, so under load, you may experience queuing delays. There is no WebSocket or streaming endpoint.

First request

curl

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

Sound wave illustration for: Authentication

Authentication is straightforward: include your API key in the Authorization header as a Bearer token. This single key grants access to all endpoints, from speech generation to voice listing, and is tied to your account’s billing balance.

Keys are generated when you sign up via Google or email. You can manage them directly from your dashboard, where usage stats and current balances are also displayed.

Bearer Token

Pass your key using Authorization: Bearer tts-... in every request header. This standard format ensures compatibility with most HTTP clients and the official OpenAI SDKs.

The token authenticates your identity and deducts credits from your balance based on the character count of each successful request.

  • Include Authorization: Bearer <your-key> in request headers.
  • Use the same key for all API endpoints.
  • Keys are case-sensitive and must not be shared publicly.

API Key Management

Each account holds one active key. You can generate a new key at any time from the dashboard.

Old keys stop working immediately upon issuance of the new one, ensuring tight control over access.

Keys are visible in your account dashboard alongside usage metrics and remaining balance.

  • Generate new keys instantly via the dashboard.
  • Old keys become invalid immediately.
  • View key status and usage in real-time.

Key Revocation

Revoking a key is immediate. When you issue a new key, the previous one ceases to function at once.

This allows you to secure your account quickly if a key is compromised or if you want to reset access without changing your billing details.

No waiting period or propagation delay occurs; the change is instantaneous.

  • Revocation is immediate.
  • Old keys stop working instantly.
  • No manual confirmation required.

Endpoint: Speech Generation

Sound wave illustration for: Endpoint: Speech Generation

To generate audio, send a POST request to https://api.play09bet.com/v1/audio/speech. This single endpoint handles all synthesis tasks, accepting your text payload and voice configuration in one structured call.

You receive a direct audio file response, ready for immediate use in your ML dataset pipelines. No complex streaming protocols or WebSocket connections are required; just send the text and download the result.

POST /v1/audio/speech

Send your JSON payload to the endpoint. The API processes requests sequentially, so under high load, synthesis may queue. Typical speed is roughly real-time, generating about 25 characters of text per second for long inputs.

JSON Body Structure

Your request body must include the input text (up to 4096 characters), a voice preset from our 8 options, and a model identifier. You can also specify response_format, speed, and an optional language ISO code for precise control.

  • model: "tts-1" or "tts-1-hd"
  • input: Text string (max 4096 chars)
  • voice: One of 8 presets (e.g., aria, nova)
  • response_format: mp3, wav, opus, flac, or pcm
  • speed: Float between 0.25 and 4.0
  • language: Optional ISO code (e.g., "en")

Response Format

The API returns the generated audio file directly in the response body. Each file includes an inaudible watermark marking it as synthetic speech. Failed requests incur no charge.

Endpoint: Speech Generation

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

Leverage familiar OpenAI SDKs to integrate Voctet’s TTS endpoint seamlessly. By simply updating the base URL, you can use standard libraries without learning a new client wrapper, enabling rapid prototyping for ML dataset generation.

This approach ensures consistent codebases across projects. Developers can swap the endpoint configuration and maintain existing logic, making it easy to scale synthetic voice production for training data pipelines.

Base URL Configuration

Point your SDK’s base_url to https://api.play09bet.com/v1. This redirects standard TTS requests to our infrastructure while preserving the familiar JSON structure.

Ensure your Authorization header includes your tts-... bearer token. This single key manages all requests, with usage tracked against your balance.

  • Base URL: https://api.play09bet.com/v1
  • Auth Header: Authorization: Bearer tts-<key>
  • Compatible with official OpenAI SDKs

Python SDK Example

Use the openai Python package. Initialize the client with our base URL and your API key.

Call Audio.speech() with your desired model, voice, and input text. The SDK handles the request and returns the audio file.

This method is ideal for scripting batch generation of synthetic audio files for ML datasets.

  • Install: pip install openai
  • Init: client = OpenAI(base_url="https://api.play09bet.com/v1", api_key="tts-...")
  • Call: client.audio.speech.create(...)

JavaScript SDK Example

Initialize the OpenAI JavaScript SDK with our base URL and your API key.

Invoke the speech endpoint with parameters like model, voice, and input. The response contains the audio data.

This setup works well in Node.js environments or browser-based applications for audio synthesis.

  • Install: npm install openai
  • Init: const client = new OpenAI({ baseURL: "https://api.play09bet.com/v1", apiKey: "tts-..." });
  • Call: client.audio.speech.create(...)

Request Parameters

Sound wave illustration for: Request Parameters

Our API offers two model variants, tts-1 and tts-1-hd, which utilize the exact same underlying engine and pricing structure. This design simplifies integration because you can swap between standard and high-definition outputs without adjusting your billing logic or character counts. Both models handle the full character limit of 4096 per request, making them suitable for generating consistent synthetic audio for ML datasets.

Model Selection (tts-1, tts-1-hd)

Selecting the model is straightforward. Since both variants share the same price point and engine, you can choose based on your specific quality needs without worrying about cost discrepancies. This uniformity allows indie developers to prototype with one model and scale to the other seamlessly as their dataset requirements evolve.

Voice Presets

We provide eight distinct voice presets, categorized into female and male profiles, each with a specific tonal character. You can choose from warm narrators like Aria or energetic promos like Felix. Every voice supports all 23 languages, allowing you to generate diverse synthetic speech for multilingual datasets without managing separate voice models.

  • Female: aria, nova, luna, sage
  • Male: felix, milo, atlas, orion

Speed Control

Adjust the playback speed between 0.25 and 4.0 to fit your data volume needs. Faster speeds reduce generation time for large datasets, while slower speeds ensure clarity for nuanced speech patterns. The API processes requests sequentially, so speed adjustments help manage queue times during high-volume synthesis tasks.

Response Formats

Sound wave illustration for: Response Formats

We provide five standard audio formats—MP3, WAV, OPUS, FLAC, and PCM—allowing you to choose the best balance between file size and quality for your ML datasets. Each generated file carries an inaudible watermark marking it as synthetic speech, which helps verify data provenance in training pipelines.

MP3, WAV, OPUS, FLAC, PCM

Select your preferred format via the response_format parameter. MP3 and OPUS offer efficient compression for large-scale dataset collection, while WAV and FLAC preserve lossless quality for precise acoustic analysis. PCM is available for raw byte processing without codec overhead.

Binary Audio Response

The response body contains the raw audio bytes, not a JSON object. This structure minimizes parsing overhead and allows direct writing to disk or memory buffers, making it ideal for high-throughput data generation pipelines.

Metadata Headers

Standard HTTP headers accompany the audio payload. While we do not store the generated audio, request metadata (time, characters, status) is kept for billing purposes, ensuring accurate tracking of your character consumption.

Response Formats

Rate Limits

Sound wave illustration for: Rate Limits

Rate limits protect service stability during high-volume synthetic data generation. Our API enforces a standard cap of 60 requests per minute per active key, ensuring consistent throughput for indie developers building ML datasets without unpredictable throttling during peak usage windows.

You can monitor your current usage and remaining quota directly in your account dashboard. This transparency helps you plan batch processing schedules effectively, avoiding unexpected interruptions while generating thousands of audio samples for model training.

60 Requests Per Minute

Once your account is funded, you benefit from a limit of 60 requests per minute. This throughput is sufficient for most indie development workflows, allowing you to generate significant volumes of synthetic speech data efficiently without needing complex queuing logic.

Initial 10 RPM Limit

New accounts start with a conservative limit of 10 requests per minute. This prevents accidental abuse and ensures fair resource allocation during the initial phase of your integration testing or small-scale dataset creation.

This lower limit applies until you complete your first top-up, allowing you to verify your integration works correctly before scaling up your generation volume.

Limit Increases After Top-Up

Your rate limit automatically increases to the full 60 RPM as soon as your first USDT top-up is confirmed on the TRON network. This process is automatic and typically completes within minutes, so you can resume high-speed generation immediately.

There is no need to contact support or wait for manual approval; the system detects the payment and adjusts your quota in real time.

Your balance does not expire.

Error Handling

Sound wave illustration for: Error Handling

When the API encounters an issue, it returns a standard HTTP status code to indicate the nature of the problem. Most errors are client-side, such as 400 Bad Request for invalid JSON or 429 Too Many Requests when you exceed your rate limit.

The response body always contains a JSON object with an error field, providing a machine-readable error code and a human-readable message. This structure allows you to programmatically distinguish between authentication failures, validation errors, and server-side issues without parsing raw text.

HTTP Status Codes

We use standard HTTP status codes to communicate the result of your request. A 200 OK indicates successful synthesis. Common errors include 401 Unauthorized for invalid or revoked API keys, 400 Bad Request for malformed input exceeding the 4096 character limit, and 429 Too Many Requests when you hit the 60 requests per minute limit.

JSON Error Responses

Every error response includes a JSON body with an error object containing a code and a message. This allows your code to parse the specific issue, such as voice_not_found or input_too_long, and handle it gracefully without crashing your application.

Retry Logic

For transient errors like 503 Service Unavailable or 429 Too Many Requests, implement exponential backoff. Wait briefly before retrying, as the queue may be processing other requests. Since requests are processed sequentially, short delays often resolve temporary congestion without overwhelming the endpoint.

  • Retry 429 errors with increasing delays
  • Handle 503 errors with immediate retry
  • Fail fast on 400/401 errors
Error Handling

Voice List Endpoint

Sound wave illustration for: Voice List Endpoint

Retrieve available voices, languages, and supported formats in a single request. This endpoint provides the metadata you need to configure your TTS calls accurately before generating audio files.

The response lists all 8 presets and 23 supported languages, ensuring you pick the right voice for your ML dataset or synthetic speech project without guesswork.

GET /v1/voices

Call GET https://api.play09bet.com/v1/voices to get a JSON array of all available voice presets. Each entry includes the voice ID, gender, and description, helping you select the perfect tone for your dataset.

This endpoint is lightweight and returns instantly, making it ideal for pre-flight checks in your data collection pipeline.

  • Returns voice ID, gender, and descriptive tags
  • Includes supported languages and formats
  • Authentication is required.

Language Support

All 8 voices support 23 languages, including Arabic, Chinese, English, Japanese, and Swahili. You can explicitly set the language parameter or rely on automatic detection from the input script.

Note that Vietnamese, Thai, and Ukrainian are not supported, so filter your dataset accordingly before calling the speech endpoint.

Format Options

The endpoint confirms that MP3, WAV, OPUS, FLAC, and PCM are available for output. Choose the format that best fits your ML training requirements, balancing file size and fidelity.

All generated audio files include an inaudible watermark to identify them as synthetic speech, useful for dataset labeling.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. These diverse synthetic datasets will help you train your custom voice models effectively.

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. Tether (USDT)
  3. LibriVox public-domain audiobooks
  4. Python documentation
  5. curl documentation
  6. Creative Commons Attribution 4.0
  7. OpenAI API reference: create speech
  8. LibriTTS-R paper (arXiv 2305.18802)
  9. openai-python on GitHub
  10. ISO 639 language codes
  11. TRON developer hub: TRC-20
  12. MDN: Web Speech API

More on this site