API Documentation for Text to Speech Generation

By BlogVoice editorial team · Updated 2026-11-19

This guide shows bloggers and no-code creators how to add natural-sounding speech to their WordPress sites using the BlogVoice API. You will learn to generate audio files from text with simple HTTP requests or the OpenAI SDK, ensuring your content is accessible for on-the-go readers without installing heavy plugins.

You will find concrete examples for retrieving your API key, making your first synthesis request, and handling common errors like rate limits or long inputs. The documentation covers supported formats, voice presets, and how to split texts exceeding 4096 characters, giving you everything needed to integrate audio into your blog workflow.

API Documentation for Text to Speech Generation

Frequently asked questions

What is the base URL for the API?

The API base URL is https://api.za24.info/v1. You send POST requests to https://api.za24.info/v1/audio/speech for speech generation. Other endpoints like /v1/voices are also available at this base. This structure allows you to easily integrate the API into your WordPress plugins or custom themes without complex configuration.

How do I authenticate my requests?

Include your API key in the Authorization header as a Bearer token. Use the format: Authorization: Bearer tts-your-key-here. You can find your active key on the /get-api-key/ dashboard page. Ensure you send the exact key string without extra spaces to avoid authentication errors during your API calls.

Can I use the OpenAI Python SDK?

Yes, the official OpenAI SDKs work perfectly. Simply change the base_url parameter to https://api.za24.info/v1. Use your BlogVoice API key instead of an OpenAI key. This allows you to use familiar code structures for generating speech, making integration into your Python-based WordPress tools or scripts very straightforward.

What happens if I exceed the rate limit?

You are limited to 60 requests per minute per key. If you exceed this, subsequent requests may queue or fail. Before your first top-up, the limit is 10 requests per minute. Monitor your usage on the dashboard to avoid interruptions, especially when generating audio for multiple blog posts simultaneously.

How do I handle the audio file in JavaScript?

The API returns the audio file directly in the response body. In JavaScript, you can fetch the data as a blob or array buffer. You can then create a URL object from this blob and assign it to an HTML5 audio element. This allows immediate playback in your WordPress frontend without saving files to your server.

Is the API key secret or public?

Your API key is secret and should be kept secure. Although it works in client-side code, anyone with the key can use your balance. For WordPress, it is best practice to store the key in your site’s database or environment variables and generate audio server-side to protect your funds.

Can I generate audio in a specific language?

Yes, you can specify the language using the optional 'language' field with an ISO code. If omitted, the system guesses the language, defaulting to English for Latin script. For non-English Latin text, always set the language field to ensure accurate synthesis and avoid mispronunciation in your blog content.

What is the maximum text length per request?

Each request supports up to 4096 characters of input text. This includes spaces and punctuation. If your blog post is longer, you must split the text into chunks of this size. You can then join the resulting audio files to create a complete audio version of your entire article.

Do I need to install any extra libraries?

No extra libraries are strictly required if you use plain HTTP requests. However, using the OpenAI SDK or similar HTTP clients simplifies the process. For WordPress, you can use the built-in wp_remote_post function. No custom SDK or mobile library is needed, keeping your plugin lightweight and easy to maintain.

How do I handle audio playback in WordPress?

Use the standard HTML5 <audio> tag. Generate the audio URL via your API call and set it as the source. WordPress supports MP3, WAV, and other formats. You can embed this player in your posts or pages. Since audio is returned instantly, you can play it directly in the browser without waiting for file uploads.

Is the audio file returned as a URL or binary?

The audio file is returned as binary data in the response body. It is not stored on our servers. You must handle the binary data immediately by saving it locally or playing it in the browser. This ensures privacy, as input text is not stored for training.

Can I adjust the speed of the speech?

Yes, you can adjust the speed using the 'speed' parameter. Valid values range from 0.25 to 4.0. A value of 1.0 is normal speed. This feature allows you to optimize listening time for your readers. Faster speeds are useful for quick updates, while slower speeds may aid comprehension for complex topics.

What if the API returns an error?

If synthesis fails, the charge is returned in full. Check the response status code and error message for details. Common issues include invalid keys or rate limits. Ensure your text is within the 4096 character limit. Failed requests do not cost credit, so you can retry safely without worrying about your balance.

How do I split text into 4096 character chunks?

Split your text into segments of up to 4096 characters each. You can use standard string slicing in your preferred language. Send each chunk as a separate POST request to the /v1/audio/speech endpoint. Finally, join the resulting audio files in order. This ensures all your blog content is converted accurately without truncation.

First request

curl

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

BlogVoice provides a lightweight API to turn blog posts into audio without heavy plugins. Sign up via Google or email at /get-api-key/ to access your dashboard. You receive a unique key immediately for authentication.

Sign up on the site

Sign up on the site

Visit the registration page to create an account. You can sign in with Google for instant access or use a standard email and password. Accounts are created per site, ensuring your credentials are specific to this storefront.

  • Google or email/password registration
  • Instant access to dashboard
  • No credit card required for sign-up

Find key in dashboard

Find key in dashboard

After logging in, your dashboard displays your active API key. You can also view your current balance, trial credit, and usage statistics. Use this key in the Authorization: Bearer header for all requests.

  • View key, balance, and usage
  • Key format: tts-...
  • Visible immediately after signup

Generate new key if needed

If you suspect your key is compromised, you can issue a new one at any time. The old key stops working immediately upon generation of the new one, ensuring secure access without downtime.

  • Issue new key anytime
  • Old key invalid immediately
  • No extra charge for key rotation

First request with cURL

Sound wave illustration for: First request with cURL

Send your text to the BlogVoice API to receive an audio file. Use the cURL command below, replacing YOUR_API_KEY with the key found in your dashboard.

Ensure the text does not exceed 4,096 characters. The API returns the audio file directly, ready for playback or download.

Basic POST request

Use this cURL command to generate speech. It sends a POST request to the endpoint with your API key in the header.

```bash curl -X POST https://api.za24.info/v1/audio/speech \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Hello from BlogVoice", "voice": "nova", "response_format": "mp3"}' ```

Required JSON fields

The request body must include model, input, voice, and response_format. The model accepts tts-1 or tts-1-hd. The input is your text. Choose a voice like aria or felix. Set response_format to mp3, wav, opus, flac, or pcm.

You can optionally specify speed (0.25–4.0) or language (e.g., en, de, fr). If omitted, the language is guessed.

  • model: tts-1 or tts-1-hd
  • input: string (max 4096 chars)
  • voice: one of 8 presets
  • response_format: mp3, wav, opus, flac, pcm

Response handling

A successful response returns the audio file directly in the body. Save this output to a file for use in your WordPress posts or podcasts.

If the request fails, check the HTTP status code. Common errors include invalid keys or rate limits. Failed requests incur no charge.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

The OpenAI SDK works seamlessly with BlogVoice because our API mirrors the standard request structure. You simply update the configuration to point to our endpoint and use your specific API key.

Install the library

Install the official OpenAI Python library using pip. This provides the necessary classes to handle requests and parse audio responses efficiently.

  • pip install openai

Set base_url

Configure the client to use our API base URL. Replace the default endpoint with https://api.za24.info/v1 to direct requests to our TTS service.

Pass your API key

Authenticate by passing your unique API key found in the dashboard. Use the format 'Bearer tts-...' in the authorization header to generate speech.

Supported audio formats

Sound wave illustration for: Supported audio formats

BlogVoice supports five standard audio formats to suit different playback needs. You select the desired format using the response_format field in your JSON request body. The API returns the audio file directly in the response for immediate use.

MP3 for web playback

MP3 is the default and most compatible format for web embedding. It offers a good balance between file size and quality, making it ideal for blog players and mobile apps.

WAV for high quality

WAV provides uncompressed, lossless audio. Use this format if you need pristine sound quality for professional recordings or offline editing, accepting the larger file size.

OPUS, FLAC, PCM options

OPUS offers efficient compression. FLAC provides lossless compression for storage efficiency. PCM returns raw uncompressed audio data, useful for specific audio processing pipelines.

Request parameters

Sound wave illustration for: Request parameters

Configure your speech synthesis by selecting the appropriate model, voice, and speed. These parameters determine the audio engine, speaker identity, and playback rate for your generated content.

Model selection

Choose between tts-1 for standard generation or tts-1-hd for higher fidelity. Both models use the same underlying engine and pricing.

Voice preset choice

Select from eight distinct voices like Aria (warm narrator) or Felix (energetic promo). Each voice supports 23 languages, so set the language field for non-English Latin text.

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

Speed adjustment

Adjust the speed parameter between 0.25 and 4.0 to control playback rate. Default speed is 1.0, suitable for most blog content.

Request parameters

Handling errors

Sound wave illustration for: Handling errors

Errors provide immediate feedback to help you troubleshoot API calls. Most issues stem from authentication, limits, or input constraints, which are clearly defined in the response body. Handling these gracefully ensures your WordPress plugin or no-code workflow continues running smoothly without interruption.

Invalid API key

If your key is missing, expired, or incorrect, the API returns a 401 Unauthorized error. Ensure you are using the correct key from your BlogVoice dashboard and that it starts with tts-. Regenerate the key if you suspect it was compromised.

Rate limit exceeded

You have a limit of 60 requests per minute. If you exceed this, you receive a 429 error. New accounts start with a 10 requests/minute limit until the first top-up is processed. Implement exponential backoff in your code to retry after a short delay.

  • Check the Retry-After header for the exact wait time.
  • Monitor your usage in the dashboard to stay within limits.

Input too long

Each request supports a maximum of 4096 characters for the input field. If your text exceeds this, the API returns a 400 Bad Request error. Split your content into smaller chunks, generate audio for each, and concatenate the files on the client side.

  • Count characters including spaces and punctuation.
  • Use a simple loop to process text in 4096-character segments.

Rate limits explained

Sound wave illustration for: Rate limits explained

BlogVoice’s API enforces a standard limit of 60 requests per minute for each active key.

60 requests per minute

Each API key is capped at 60 requests per minute. This limit applies uniformly regardless of the model chosen. It is designed to handle typical blog content volumes without requiring complex throttling logic in your no-code automation tools.

10 requests before top-up

New accounts without a top-up start with a lower limit of 10 requests per minute. This allows you to test the integration with your WordPress site before committing funds. Once you add USDT to your balance, the limit increases to the standard 60 requests per minute.

Queue processing behavior

Requests are processed sequentially. Under heavy load, a request may wait in a queue before synthesis begins. For short phrases, this adds a few seconds of delay. For longer texts, the generation speed is roughly real time (about 25 characters per second). This ensures audio quality remains consistent even during traffic spikes.

Audio length and splitting

Sound wave illustration for: Audio length and splitting

BlogVoice processes text in chunks of up to 4,096 characters per request. This limit ensures consistent generation speed and reliability for your blog posts or articles.

4096 character limit

Each API call accepts a maximum of 4,096 characters, including spaces and punctuation. If your text exceeds this, you must split it before sending.

Splitting long texts

Split your content into segments of 4,096 characters or fewer. Send each segment as a separate POST request to generate individual audio files.

  • Break text at natural pauses or paragraph boundaries.
  • Avoid splitting mid-sentence to preserve audio coherence.

Joining audio files

Combine the resulting audio files into a single track for seamless playback. This keeps the listening experience smooth for your audience without requiring complex player setups.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. We process requests sequentially, meaning under heavy load, your audio might wait in a queue.

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-node on GitHub
  3. TRON developer hub: TRC-20
  4. FFmpeg documentation
  5. Creative Commons Attribution 4.0
  6. LibriTTS-R corpus (OpenSLR 141)
  7. LibriTTS-R paper (arXiv 2305.18802)
  8. OpenAI API reference: create speech
  9. IETF RFC 7845: Ogg Opus
  10. MDN: Web Speech API
  11. Node.js documentation
  12. ISO 639 language codes

More on this site