Frequently asked questions
How do I get an API key?
Navigate to /get-api-key/ and sign in with Google or create an account with email and password. Accounts created via Google receive a $0.50 free trial valid for seven days. Email-based accounts start without trial credit. You will receive one active key per account, which is displayed on the dashboard.
What is the curl example for TTS?
Send a POST request to https://api.b8my.cc/v1/audio/speech with your Bearer token. Include the model (tts-1 or tts-1-hd), input text, voice preset, and response format in the JSON body. The API returns the audio file directly in the response body, allowing you to save it locally or play it.
Can I use the OpenAI SDK?
Yes. The endpoint shape matches the OpenAI speech endpoint. Configure your SDK by changing the base_url to https://api.b8my.cc/v1 and using your site-specific key. This allows you to use official OpenAI SDKs for Python, Node.js, and other languages without modifying the request structure.
What are the error codes?
The API returns standard HTTP status codes. Failed requests are free, and the charge is returned in full if synthesis fails. Specific error details are included in the response body. Use these codes to handle retries or notify users of issues like invalid input or insufficient balance.
How do I set the speed?
Include the speed parameter in your request JSON, with a value between 0.25 and 4.0. The default speed is 1.0. Adjusting this value scales the playback speed of the generated audio. Ensure the resulting audio remains clear and intelligible at your chosen speed settings.
Is SSML supported?
No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You must provide plain text input. If you need specific pronunciation, ensure the text is spelled correctly. The system guesses the language from the script if not explicitly set.
What is the character limit?
Each request supports up to 4096 characters in the input field. For longer texts, split the content into parts of this size and join the resulting audio files. Spaces and punctuation count toward the character limit. This ensures consistent processing and predictable billing for your content.
How do I handle rate limits?
The limit is 60 requests per minute per key (10 per minute before the first top-up). Requests are processed sequentially, so under load, a request may wait in a queue. Implement retry logic with exponential backoff to handle temporary delays or limit breaches effectively.
What is the base_url?
The API base URL is https://api.b8my.cc/v1. Use this for all SDK configurations and direct HTTP requests. The speech endpoint is /audio/speech, voices are listed at /voices, and models are available at /models. Ensure your authentication header uses the Bearer token format.
Do I need to install a specific SDK?
No. You can use the official OpenAI SDKs by adjusting the base_url, or use plain HTTP requests. There is no proprietary SDK or mobile app required. Any HTTP client capable of sending JSON POST requests can interact with the API effectively.
How do I stream audio?
Streaming is not supported. The API returns the complete audio file in the response body after synthesis is finished.
Can I send multiple voices in one request?
No. Each request accepts only one voice preset from the eight available options. To use different voices, send separate requests for each segment. You can then concatenate the resulting audio files to create a final track with varied voice characteristics.
What happens on timeout?
If the request exceeds the timeout, the connection closes. Failed requests are free, so you will not be charged for the characters. You can retry the request. Long texts may take time to process, so ensure your client handles reasonable wait times for synthesis.
How do I revoke my key?
Generate a new key from your dashboard. The new key becomes active immediately, and the old one stops working at once. You can issue a new key any time. This effectively revokes the previous key without needing a separate revoke action.
First request
curl
curl https://api.b8my.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.mp3Python (openai)
from openai import OpenAI
client = OpenAI(base_url="https://api.b8my.cc/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.b8my.cc/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 | |
|---|---|
aria | female |
nova | female |
luna | female |
sage | female |
felix | male |
milo | male |
atlas | male |
orion | male |
| language | |
|---|---|
ar | العربية |
zh | 中文 |
da | Dansk |
nl | Nederlands |
en | English |
fi | Suomi |
fr | Français |
de | Deutsch |
el | Ελληνικά |
he | עברית |
hi | हिन्दी |
it | Italiano |
ja | 日本語 |
ko | 한국어 |
ms | Bahasa Melayu |
no | Norsk |
pl | Polski |
pt | Português |
ru | Русский |
es | Español |
sw | Kiswahili |
sv | Svenska |
tr | Türkçe |
Authentication
The API uses standard Bearer token authentication. Include the header Authorization: Bearer tts-<your_key> in every request. Each account maintains one active key at a time. The key identifies your account and tracks usage against your rate limits.
You can generate a new key at any time via the dashboard. When a new key is issued, the previous key becomes invalid immediately. This ensures that if a key is exposed, you can revoke access without waiting for a renewal cycle.
Bearer token format
Pass your API key in the Authorization header using the Bearer scheme. The format is strictly Bearer tts-<key_string>. Do not include quotes or extra spaces.
The key is tied to your specific account balance and character usage. Ensure the header is present in all API calls to avoid 401 Unauthorized errors.
- Format:
Authorization: Bearer tts-abc123 - Case-sensitive:
Bearermust be capitalized - No quotes around the token
Generating a new API key
Navigate to the /get-api-key/ page on b8my.cc. Click the option to issue a new key. The new key appears instantly in your account dashboard.
This action does not affect your current balance or character count. You can switch keys seamlessly in your integration by updating the header value.
- Log in with Google or email
- Click 'Issue New Key'
- Old key invalidates immediately
Revoking old keys
Revocation is automatic upon issuing a new key. There is no separate 'revoke' button; the system manages this state server-side.
If you suspect a key leak, generate a new one immediately. The old key will stop working within seconds, preventing further unauthorized usage.
Speech Endpoint
The core synthesis endpoint is POST https://api.b8my.cc/v1/audio/speech. Send a JSON payload with your text and voice selection to receive an audio file. The endpoint accepts standard parameters including model, input, voice, response_format, speed, and language.
POST /v1/audio/speech
Submit requests to the speech endpoint with a valid Bearer token in the Authorization header. The service processes text up to 4096 characters per request. For longer content, split the text into segments and join the resulting audio files.
JSON body structure
The request body must be a valid JSON object. Ensure all string fields are properly escaped. The API returns the audio binary directly in the response body or an error object if synthesis fails.
Required fields: model, input, voice
Specify 'tts-1' or 'tts-1-hd' for the model. Provide the text string in the 'input' field, limited to 4096 characters. Select one of the eight preset voices, such as 'aria' or 'nova', for the voice parameter.
- model: tts-1 or tts-1-hd
- input: text string (max 4096 chars)
- voice: one of eight presets (e.g., aria, nova)
Available Voices
The API provides eight distinct voice presets, each engineered for specific content types. These voices are derived from licensed recordings, ensuring consistent quality across all generated audio files. Each voice supports all 23 available languages, allowing for flexible localization without requiring separate voice assets.
Female voices: Aria, Nova, Luna, Sage
Aria offers a warm, clear narrator style ideal for general reading. Nova delivers a bright, upbeat tone suitable for energetic content. Luna provides a soft, storytelling voice for narrative text. Sage is designed for calm, instructional materials.
- Aria: Warm, clear narrator
- Nova: Bright, upbeat
- Luna: Soft, storytelling
- Sage: Calm, instructional
Male voices: Felix, Milo, Atlas, Orion
- Felix: Energetic, promo
- Milo: Friendly, conversational
- Atlas: Neutral, news
- Orion: Deep, documentary
Voice characteristics and use cases
Each voice is based on licensed recordings from LibriTTS-R (CC BY 4.0) and LibriVox public-domain audiobook readings. All generated audio files contain an inaudible watermark identifying them as synthetic speech. The choice of voice should align with the tone of your blog content or static articles.
Request Parameters
The API accepts model and speed parameters to control synthesis behavior. Both tts-1 and tts-1-hd engines incur identical pricing at $0.01 per 1,000 characters, allowing you to select quality without cost penalties. Speed scales linearly from 0.25x to 4.0x, affecting generation duration but not character billing.
Model selection: tts-1 vs tts-1-hd
Select tts-1 for standard efficiency or tts-1-hd for higher fidelity. Since pricing is uniform, choose based on listener preference for blog content rather than budget constraints. Both models support the full range of 23 languages and 8 voice presets.
Speed adjustment: 0.25 to 4.0
Adjust the speed value between 0.25 and 4.0 to match reading pace requirements. Faster speeds reduce listening time for long articles, while slower speeds may improve clarity for complex technical terms. The character count remains constant regardless of speed adjustments.
Language code specification
Specify the language field using an ISO 639-1 code (e.g., en, de, ja) to ensure accurate pronunciation. Without this field, the system guesses the language, defaulting to English for Latin-script text. Explicitly setting the language is recommended for non-English content to avoid misinterpretation.
- Supported languages include Arabic, Chinese, English, French, German, Hindi, Japanese, Korean, Spanish, and 13 others.
- Voices can speak any of the 23 supported languages regardless of the voice's original recording language.
Response Formats
The API returns raw audio bytes upon successful synthesis, eliminating the need for external decoding libraries. Selecting the appropriate response_format ensures compatibility with your media pipeline. All generated files include an inaudible watermark to identify synthetic speech.
Choose MP3 for web delivery, WAV for high-fidelity editing, or PCM for uncompressed processing. OPUS and FLAC offer efficient compression for long-form content. The format selection directly impacts file size and bandwidth usage during transfer.
Supported formats: MP3, WAV, OPUS, FLAC, PCM
Select one of five formats via the response_format field. MP3 provides balanced compression for web delivery. WAV delivers lossless audio for editing. OPUS and FLAC offer efficient compression for long-form content. PCM offers raw data for custom processing.
Each format maintains the same audio quality from the engine. The choice affects only file size and network transfer efficiency, not synthesis accuracy.
- MP3: Standard web audio format
- WAV: Lossless, uncompressed audio
- OPUS: High-efficiency compression
- FLAC: Lossless compressed audio
- PCM: Raw uncompressed bytes
Response payload structure
A successful response returns the audio file directly as the response body. No JSON wrapper contains the binary data. Headers include Content-Type matching the selected format.
Use the standard HTTP 200 status code for success. The response length equals the file size of the generated audio. No additional metadata is included in the response body.
Binary audio data handling
Write the response body directly to a file or pass it to an audio player. Do not parse the response as JSON. Ensure your HTTP client handles binary data correctly.
For long texts, the API returns a single audio file. Joining parts is handled by your client if you split the input. Verify the file integrity before playback.

Error Handling
The API returns standard HTTP status codes to indicate request outcomes. A 200 OK response confirms successful synthesis, while 4xx errors indicate client-side issues such as invalid parameters or missing authentication. Server-side failures return 5xx codes, which do not incur charges (failed requests are free).
Common HTTP status codes
Use 200 for successful audio generation. 400 Bad Request indicates malformed JSON or missing required fields. 401 Unauthorized means the Bearer token is invalid or expired. 429 Too Many Requests signals that you have exceeded the 60 requests per minute limit.
Invalid input handling
Inputs exceeding 4096 characters per request will fail with a 400 error. Ensure the input field contains valid text strings. If the voice or model field is missing or unrecognized, the API returns a 400 error. Failed requests are free, so no characters are deducted from your balance.
Rate limit exceeded errors
Each API key is limited to 60 requests per minute. New accounts start with a 10 requests per minute limit until the first top-up. If you exceed this limit, the API returns a 429 status code. Requests processed one after another may wait in a queue under load, potentially delaying responses.
Curl Example
Use cURL to verify the API connection and test audio generation directly from the command line. This method requires no additional libraries and works with any shell environment, making it ideal for quick validation of your API key and voice selection before integrating into your application.
The following examples demonstrate how to send a POST request to the speech endpoint. Replace the placeholder key with your actual token from the /get-api-key/ dashboard.
Basic curl command
Test connectivity by sending a minimal request. This confirms your key is active and returns a short audio file.
Sending text to audio
Send up to 4096 characters per request. Specify the model, voice, and input text in the JSON body.
- model: tts-1 or tts-1-hd
- voice: e.g., nova
- input: "Hello, world."
Saving output to file
Redirect the binary response to a local file using the -o flag. This allows immediate playback or upload to your blog.
OpenAI SDK Integration
The API endpoint mirrors the OpenAI speech structure, allowing direct integration using official SDKs by simply overriding the base URL. This eliminates the need for custom wrappers or proprietary client libraries.
Changing base_url
Set the base URL to https://api.b8my.cc/v1 in your SDK configuration. This directs requests to the correct TTS endpoint while maintaining standard compatibility.
Using official SDKs
Utilize the official OpenAI SDK for your preferred language. The request payload structure is identical, ensuring seamless migration without code refactoring.
Authentication header setup
Pass your API key via the Authorization: Bearer tts-... header. The SDK handles header injection automatically when configured correctly.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Requests in unsupported languages may default to English or produce unintelligible audio.
23 languages
Any voice speaks any of these languages.
Sources and further reading
- Wikipedia
- Node.js documentation
- Python documentation
- LibriVox public-domain audiobooks
- FFmpeg documentation
- ISO 639 language codes
- LibriTTS-R corpus (OpenSLR 141)
- LibriTTS-R paper (arXiv 2305.18802)
- curl documentation
- W3C WAI: making audio and video accessible
- OpenAI API reference: create speech
- MDN: Web Speech API
