Text-to-Speech API: Generate Audio from Text

By ScribeVoice editorial team · Updated 2026-11-18

This page documents the ScribeVoice Text-to-Speech API, designed for developers who need to convert text into audio files programmatically. You will find clear instructions on generating API keys, constructing requests, and handling responses. The API follows a standard JSON structure, making it easy to integrate into any backend workflow without learning a proprietary system.

We support the official OpenAI SDKs, requiring only a simple base URL change. You can generate speech in 23 languages using eight distinct voice presets, with formats including MP3, WAV, and FLAC. This guide covers essential details like rate limits, character constraints, and error handling to help you build reliable audio generation features.

Text-to-Speech API: Generate Audio from Text

Frequently asked questions

What is the API endpoint URL?

The API endpoint is POST https://api.play5k5k.com/v1/audio/speech. You send a JSON body containing your text and configuration parameters. The request structure matches the OpenAI speech endpoint, ensuring compatibility with standard HTTP clients and libraries that support JSON payloads for audio generation.

Does the API support OpenAI SDKs?

Yes, the official OpenAI SDKs work seamlessly. Simply change the base_url to https://api.play5k5k.com/v1 and use your ScribeVoice API key. This allows you to use familiar SDK methods for authentication and request handling without needing to rewrite your integration code from scratch.

How do I authenticate requests?

Include your API key in the Authorization header as a Bearer token: Authorization: Bearer tts-... You can generate or rotate this key on your account dashboard. Each account has one active key; issuing a new one immediately invalidates the previous one for security.

What audio formats are available?

You can choose from mp3, wav, opus, flac, and pcm formats. Specify your preference in the response_format field of your request. This flexibility allows you to select the best balance between file size and quality for your specific blogging or content distribution needs.

What is the character limit per request?

Each request supports up to 4096 characters of input text. For longer articles, split your text into chunks of this size and join the resulting audio files. Spaces and punctuation count toward the character limit, so plan your content structure accordingly for optimal processing.

How fast is the API response?

Generation speed is roughly real-time, processing about 25 characters per second. Short phrases may take a few seconds, while longer texts generate at a consistent pace. Requests are processed sequentially, so high load may introduce slight delays as requests wait in the queue.

Can I adjust the voice speed?

Yes, you can set the speed between 0.25 and 4.0. This allows you to speed up narration for quick updates or slow it down for clearer instructional content. Adjust the speed parameter in your request body to match the desired pacing for your audience.

Is streaming supported?

No, streaming or WebSocket support is not available. The API returns the complete audio file upon request completion. You cannot receive partial audio chunks in real-time, so you must wait for the full synthesis to finish before accessing the generated audio data.

Do you provide an official SDK?

We do not provide a dedicated ScribeVoice SDK. Instead, we recommend using the official OpenAI SDK or standard HTTP libraries. Since our endpoint mimics the OpenAI speech format, you can leverage existing community tools and documentation to integrate quickly into your WordPress or blog workflow.

How do I handle rate limits?

The limit is 60 requests per minute per key (10 before the first top-up). If you exceed this, requests may queue. Monitor your usage via the dashboard and implement retry logic in your code to handle temporary throttling during high-traffic periods on your site.

What happens if a request fails?

Failed requests are free; the charge is returned in full if synthesis fails. You can retry the request without incurring additional costs. Check the response status to identify errors, such as invalid parameters or network issues, and adjust your payload accordingly before resubmitting.

Can I use custom voices?

No, custom voice cloning or uploading your own voice is not supported. You can choose from eight preset voices like Aria, Nova, or Felix. These voices are based on licensed recordings and offer distinct styles, but you cannot create unique voice profiles for your brand.

Is there an API for WordPress?

There is no official WordPress plugin or specific WordPress API. However, you can easily integrate our REST API into your WordPress site using custom code or existing HTTP libraries. Many developers build simple plugins or use PHP cURL to fetch audio and embed it in posts.

How do I get my API key?

Sign up on the /get-api-key/ page using Google or an email and password. Once registered, your dashboard displays your API key, balance, and usage stats. You can also issue a new key at any time, which immediately invalidates the previous one for security.

First request

curl

curl https://api.play5k5k.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.play5k5k.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.play5k5k.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 creating an account on the /get-api-key/ dashboard. You can sign in with Google for an instant trial or use email and password for a permanent account. Once registered, you get immediate access to your unique credentials.

Sign up on the dashboard

Visit the sign-up page to create your account. Google sign-in grants a $0.50 trial valid for 7 days, while email accounts start without credit.

  • Google sign-in includes trial credit
  • Email sign-up requires manual top-up
  • No credit card needed to start

Copy your Bearer token

Your dashboard displays a single active API key. Copy this token to use in the Authorization: Bearer header for all API requests. It is the only key you need for authentication.

  • One active key per account
  • Use in Authorization header
  • Key starts with tts-

Rotate keys instantly

If your key is exposed, generate a new one immediately. The old key stops working instantly, ensuring your API access remains secure without downtime.

  • Instant invalidation of old keys
  • No downtime during rotation

Make your first request

Sound wave illustration for: Make your first request

Once you have your API key, generating audio is straightforward. Send a POST request to the speech endpoint with your text and voice selection. The service returns the audio file directly in the response, ready for immediate use in your blog or app.

You can test the integration quickly using curl or any HTTP client. The JSON body accepts your text, desired voice, and output format. Failed requests are free, so you can experiment without worrying about credits.

Use curl for quick tests

Start with a simple curl command to verify your key and workflow. Replace YOUR_API_KEY with your actual token.

This approach lets you confirm connectivity and audio generation before integrating into your WordPress site or custom script.

  • Run locally or in any terminal environment
  • Verify response headers and audio data instantly

Send JSON payload

The request body requires model, input, voice, and response_format. The model can be tts-1 or tts-1-hd, both using the same engine.

Set input to your blog post text (up to 4096 characters). Choose a voice from the 8 presets and specify an audio format like mp3 or wav.

Receive audio file directly

The API returns the audio file directly in the response body. You can save it to your server or play it to users.

No additional download steps are needed. The file is generated synchronously, ensuring you get a complete audio clip ready for playback.

Make your first request

OpenAI SDK compatibility

Sound wave illustration for: OpenAI SDK compatibility

ScribeVoice mirrors the OpenAI speech endpoint structure, allowing you to reuse existing client libraries with minimal configuration. By simply adjusting the base URL, you can integrate our TTS engine into your current workflow without rewriting your codebase.

Authentication remains straightforward: provide your Bearer token in the Authorization header. The API accepts the same JSON body fields, ensuring that developers familiar with OpenAI’s format can switch providers seamlessly while maintaining their existing integration logic.

Change base_url to ours

Update your client configuration to point to https://api.play5k5k.com/v1. This single change directs all requests to our infrastructure while preserving the standard endpoint paths.

  • Base URL: https://api.play5k5k.com/v1
  • Endpoint: POST /v1/audio/speech

Use official SDKs

The official OpenAI SDKs work directly with our API. You can continue using your preferred language bindings without needing a custom client library.

  • Compatible with official OpenAI SDKs
  • No custom library required

Same request shape

The JSON body structure is identical to OpenAI’s speech endpoint. Pass your model, input, voice, and response_format exactly as you would elsewhere.

  • Standard JSON payload
  • Fields: model, input, voice, response_format, speed

Supported audio formats

Sound wave illustration for: Supported audio formats

Choose the right format based on your delivery needs. MP3 offers small file sizes for fast web playback, while WAV provides uncompressed high-quality audio for archival purposes. Select your preferred format via the response_format parameter in your API request.

MP3 for web playback

MP3 is ideal for playback on websites or blogs. It balances quality with significantly reduced file sizes, ensuring quick load times for your visitors without sacrificing clarity.

  • Compressed format for efficient bandwidth usage
  • Universal support across all modern browsers
  • Best for standard web audio players

WAV for high quality

Select WAV when you need lossless audio fidelity. This format preserves the full detail of the synthesis, making it suitable for professional editing or high-fidelity storage needs.

  • Uncompressed, lossless audio data
  • Maximum fidelity for post-production
  • Larger file sizes than MP3

Opus, FLAC, and PCM

Opus delivers excellent compression at low bitrates, suitable for voice-heavy applications. FLAC offers lossless compression for storage efficiency, while PCM provides raw, uncompressed digital audio for direct processing.

  • Opus: High efficiency, low bitrate
  • FLAC: Lossless compression
  • PCM: Raw uncompressed data

Rate limits and quotas

Sound wave illustration for: Rate limits and quotas

ScribeVoice enforces strict rate limits to ensure stable performance for all users. Each API key is capped at 60 requests per minute, with a lower threshold of 10 requests per minute applied to new accounts before the first top-up.

60 requests per minute

Once your account is funded, the limit increases to 60 requests per minute per key. This allows bloggers and developers to generate audio content efficiently without hitting hard caps during moderate usage.

10 requests before top-up

New accounts start with a limit of 10 requests per minute. This ensures stability while you test the free trial credit (if applicable). You can increase this limit immediately by adding USDT to your balance.

Queue processing under load

Requests are processed sequentially. If you exceed the per-minute limit or send many requests simultaneously, subsequent requests will wait in a queue rather than failing immediately. This ensures fair access but may increase total generation time during peak usage.

Rate limits and quotas

Voice and model options

Sound wave illustration for: Voice and model options

ScribeVoice offers two model variants, tts-1 and tts-1-hd, which use the same underlying engine and pricing. You can choose between them based on your specific quality or latency needs without any change in cost structure.

Both models support the eight available preset voices, allowing you to select a tone that best fits your content’s mood, from warm narration to energetic promos. The voice selection is straightforward and consistent across both models.

tts-1 and tts-1-hd models

The tts-1 and tts-1-hd models are functionally identical in terms of voice quality and engine performance. They share the same pricing structure, making it easy to switch between them based on your preference without worrying about cost differences.

Both models support all eight voices and languages, ensuring consistency in your audio output regardless of the model chosen.

  • Same engine and pricing for both models
  • Consistent voice quality and language support

8 preset voices

Choose from four female voices: Aria (warm narrator), Nova (upbeat), Luna (soft storyteller), and Sage (calm instructor). For male voices, select Felix (energetic promo), Milo (friendly conversation), Atlas (neutral news), or Orion (deep documentary).

Each voice is designed for specific tones, allowing you to match the audio to your content’s style. All voices support all 23 languages, ensuring flexibility in your global content strategy.

  • 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 control 0.25–4.0

Adjust the speech speed from 0.25x to 4.0x to fit your content’s pacing. This feature allows you to slow down complex explanations or speed up lighter content, enhancing listener engagement.

The speed control is applied uniformly across all voices and models, providing consistent results. Experiment with different speeds to find the optimal pace for your audience’s listening habits.

Handling long texts

Sound wave illustration for: Handling long texts

Send up to 4096 characters per request. For longer texts, split the input into chunks and combine the resulting audio files.

Split into 4096 char chunks

Divide your text into segments of 4096 characters or fewer. Each segment generates a separate audio file via the API.

Join audio files manually

After receiving all audio files, concatenate them into a single track. This ensures continuous playback of the complete text.

Efficient batch processing

Process chunks sequentially. Monitor the queue, as requests may wait under load before synthesis begins.

Keep text under the limit to avoid splitting overhead. This approach maintains audio quality and simplifies error handling.

Handling long texts

Common errors and solutions

Sound wave illustration for: Common errors and solutions

API errors are straightforward and usually stem from configuration or input limits. Understanding these common issues helps you troubleshoot quickly without waiting for support. Most problems are resolved by checking your key, adjusting your rate, or splitting your text.

Invalid API key

Ensure your Authorization header uses the Bearer prefix followed by your unique key. Keys are case-sensitive and must match the one issued to your account.

  • Check for extra spaces or line breaks in the token string.
  • Verify the key hasn’t been rotated; a new key invalidates the old one instantly.

Rate limit exceeded

The API allows 60 requests per minute per key. If you exceed this, requests queue and process sequentially. New accounts start with a 10 requests/minute limit until the first top-up.

  • Implement exponential backoff in your client code.
  • Monitor your usage dashboard to stay within limits.

Text too long

Each request supports a maximum of 4096 characters. If your input exceeds this, the synthesis will fail. You must split the text into smaller chunks and join the resulting audio files manually.

  • Count characters including spaces and punctuation.
  • Use a simple script to chunk text before sending requests.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. You can create a stunning blog with WordPress without writing a single line of code today.

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. ISO 639 language codes
  3. Python documentation
  4. curl documentation
  5. Creative Commons Attribution 4.0
  6. Node.js documentation
  7. LibriTTS-R corpus (OpenSLR 141)
  8. OpenAI API reference: create speech
  9. openai-node on GitHub
  10. LibriVox public-domain audiobooks
  11. TRON developer hub: TRC-20
  12. W3C WAI: making audio and video accessible

More on this site