Developer Guide to Our Text-to-Speech API

By NewsVoice editorial team · Updated 2026-11-19

This guide shows you how to integrate PressAudio into your news application’s audio pipeline. You’ll find concrete examples for authenticating, selecting voices, and handling responses with the OpenAI-compatible SDKs. We cover the specific endpoints, parameter limits, and error structures you need to build a reliable speech engine that replaces brittle third-party readers.

Designed for product teams, this reference helps you manage character quotas, split long texts, and rotate API keys instantly. Whether you are generating news briefs or audio summaries, you’ll get the exact technical details to fit our lightweight TTS API into your existing stack without guessing at the implementation.

Developer Guide to Our Text-to-Speech API

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or email. You receive one active key per account. You can issue a new key at any time, and the old one stops immediately. Google sign-ups include a $0.50 trial credit valid for seven days.

Does it work with OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. Use the official OpenAI SDKs by changing the base_url to https://api.qq988.info/v1 and providing your site’s key. This allows you to integrate quickly without learning a new library structure.

What is the base URL?

The API base URL is https://api.qq988.info/v1. Use this for all requests, including POST /v1/audio/speech for generation and GET /v1/voices for listing available options. Authentication is handled via the Authorization header with your Bearer token.

How do I handle errors?

Failed requests are free: if synthesis fails, the charge is returned in full. You should check the HTTP status code in the response. If an error occurs, retry logic is recommended, keeping in mind the rate limit of 60 requests per minute.

Can I use Python?

Yes, since the API follows the OpenAI endpoint structure, you can use the standard OpenAI Python SDK. Simply update the base_url to our API endpoint. Alternatively, use any HTTP library to send JSON payloads with your authentication header and parameters.

What is the character limit?

Each request supports up to 4096 characters of input text. 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 used for billing calculations.

How do I change voices?

Specify the voice parameter in your request body. Choose from eight presets like aria, nova, luna, sage, felix, milo, atlas, or orion. You can also optionally set a language ISO code to ensure correct pronunciation for non-English scripts.

What formats are supported?

You can request audio in mp3, wav, opus, flac, or pcm formats. Set the response_format field in your JSON body to your preferred type. The API returns the audio file directly in the response for immediate use in your application.

Is there a webhook?

No, there is no webhook support. The API is synchronous; you send a POST request and receive the audio file in the response. For long texts, you must handle splitting and joining audio files yourself in your application logic.

How do I track usage?

Your account dashboard on /get-api-key/ shows your balance, characters left, and usage history. Request metadata including time, characters, and status is kept for billing purposes. You can monitor your consumption directly through the interface after logging in.

Can I use multiple keys?

Each account has one active key. You can issue a new key at any time, which immediately invalidates the old one. This allows you to rotate keys for security without needing multiple simultaneous active credentials for the same account.

What happens on timeout?

Requests are processed sequentially, so under load a request may wait in a queue. If synthesis fails, the charge is returned in full. Ensure your client handles potential delays appropriately, as typical speed is roughly real-time for long texts.

Do I need to install dependencies?

If using the OpenAI SDK, you need to install the standard library. Otherwise, you can use any standard HTTP client. No proprietary SDK or specific dependencies are required, as the API uses standard JSON over HTTP for all interactions.

Is the API RESTful?

Yes, it is a standard REST API. Use POST for generating speech and GET for retrieving voices or models. All endpoints follow standard HTTP methods and return JSON or audio data, making it easy to integrate with existing web services.

First request

curl

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

Authentication and keys

Sound wave illustration for: Authentication and keys

Access your unique API key from the dashboard at /get-api-key/ after signing in. Each account holds one active key, displayed alongside your current balance and character usage.

Get your API key from dashboard

Get your API key from dashboard

Log in via Google or email to view your credentials. The dashboard shows your key, remaining free trial credit, and a ready-to-use curl example for immediate testing.

Bearer token header format

Bearer token header format

Include your key in the HTTP header as Authorization: Bearer tts-.... This standard format works with the OpenAI SDK by simply pointing to our base URL.

Rotate keys instantly

Generate a new key at any time from the dashboard. The previous key stops working immediately, ensuring no overlap or confusion during rotation.

Endpoints overview

Sound wave illustration for: Endpoints overview

Our API exposes three primary endpoints to handle voice synthesis and metadata retrieval. The core synthesis endpoint accepts text and configuration to generate audio, while the metadata endpoints provide details on available voices and models without consuming credits.

These endpoints follow standard REST conventions, making them easy to integrate into your news application’s backend. You can fetch the list of supported voices and formats before initiating synthesis to ensure your client-side logic matches the available options.

POST /v1/audio/speech

This is your main endpoint for generating audio. Send a JSON body with the text, voice selection, and desired format to receive a binary audio file. It supports standard request fields like model, input, voice, and speed.

The endpoint returns the audio file directly in the response body. If the request fails, you will receive a JSON error object explaining the issue, such as an invalid voice ID or character limit exceeded.

  • Supports mp3, wav, opus, flac, and pcm formats
  • Accepts text up to 4096 characters per request
  • Returns binary audio data or JSON error details

GET /v1/voices

Retrieve a list of all available voice presets and their associated metadata. This endpoint helps you verify which voices are active and which languages they support without guessing.

Use this to dynamically populate your application’s voice selection dropdown, ensuring users only see valid options that match your current account’s capabilities.

  • Returns voice ID, name, and gender
  • Includes available audio formats

GET /v1/models

Fetch the available model identifiers, such as tts-1 and tts-1-hd. These models share the same engine and pricing.

Check this endpoint to confirm the current model versioning, though most integrations will simply use tts-1 or tts-1-hd directly in the speech endpoint.

  • Lists available model IDs
  • Indicates model capabilities

Request parameters

Sound wave illustration for: Request parameters

The API accepts text input up to 4,096 characters per request. Spaces and punctuation count toward this limit, so plan your chunking strategy accordingly. For longer articles, split the text and join the resulting audio files client-side.

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 your audio quality needs without worrying about cost differences.

Input text limit

Send your article content in the input field. If your text exceeds 4,096 characters, the API will reject it. You must handle the splitting logic in your application before sending multiple requests.

  • Max 4,096 characters per request
  • Spaces and punctuation count as characters
  • Split logic handled by your app

Voice preset selection

Select one of eight voices using the voice parameter. Each voice has a distinct tone, from warm narrators to deep documentary styles, and can speak any of the 23 supported languages. You can also specify a language code to ensure correct pronunciation for non-English scripts.

  • 8 presets available (e.g., aria, nova, atlas)
  • Voices support 23 languages
  • Optional language ISO code for clarity

Response formats

Sound wave illustration for: Response formats

Once your request succeeds, the API returns the generated audio file directly in the response body. You can save this file using any standard HTTP client. The format matches your response_format parameter, supporting mp3, wav, opus, flac, and pcm.

For error cases, the API returns a JSON object with an error field containing a type and message. This structure allows your code to programmatically handle issues like invalid input or service unavailability without parsing raw text. Always check the HTTP status code to determine success or failure.

Audio file download

The response body contains the raw audio bytes. Use the Content-Type header to identify the format (e.g., audio/mpeg for mp3). Ensure your application handles binary data correctly and respects the file size limits based on your input text length.

Audio files are generated quickly, typically taking a few seconds for short phrases. For longer texts, the response time may vary depending on queue load. Always implement retry logic with exponential backoff for robust integration.

  • Supported formats: mp3, wav, opus, flac, pcm
  • Content-Type header indicates the audio format
  • Binary response body contains the audio data

Error JSON structures

Errors return a JSON object with a clear error field. The type field indicates the error category (e.g., invalid_request_error), and message provides human-readable details. This enables precise error handling in your application.

Common errors include invalid API keys, rate limits exceeded, or input text exceeding the 4096 character limit. Each error includes a specific message to help you debug and adjust your requests accordingly.

  • Error type: invalid_request_error, rate_limit_exceeded, etc.
  • Message: Detailed description of the issue
  • HTTP status code indicates the error category

Rate limit headers

The API includes X-RateLimit-Limit and X-RateLimit-Remaining headers in responses. These headers help you monitor your usage and avoid hitting the 60 requests per minute limit. If you exceed the limit, you will receive a 429 status code.

For new accounts before the first top-up, the limit is 10 requests per minute. Monitor these headers to adjust your request frequency and ensure smooth operation during peak usage periods.

  • X-RateLimit-Limit: Maximum requests per minute
  • X-RateLimit-Remaining: Requests remaining in the current window
  • 429 status code when limit is exceeded

SDK integration

Sound wave illustration for: SDK integration

Our API mirrors the OpenAI speech endpoint structure, allowing you to leverage existing OpenAI SDKs with minimal code changes. This compatibility simplifies integration for teams already familiar with standard TTS workflows, ensuring a smooth transition without learning a proprietary client.

You only need to update the base URL to point to our API endpoint and supply your API key in the authorization header. This approach lets you keep your preferred language SDKs and error-handling logic intact.

OpenAI SDK compatibility

The request shape matches the OpenAI speech endpoint exactly. This means you can use the official OpenAI SDKs by simply pointing them to our base URL. Your existing code for handling audio responses and errors remains largely unchanged, reducing development time.

This compatibility ensures that standard headers and JSON structures work out of the box. You do not need a custom client library unless you prefer one.

  • Uses standard JSON body structure
  • Compatible with official OpenAI SDKs
  • Standard Bearer token authentication

Base URL configuration

Set your SDK base URL to https://api.qq988.info/v1. This directs all requests to our processing engine. Ensure your API key is passed via the Authorization header as "Bearer tts-...".

This single configuration change allows you to swap endpoints without rewriting your integration logic. It keeps your codebase clean and maintainable.

Python and JS examples

For Python, initialize the OpenAI client with the new base URL and pass your key. Send the text and voice parameters as usual. The response will contain the audio file directly.

In JavaScript, the same configuration applies. Use the fetch API or the OpenAI client to POST your request. Handle the audio blob response to play or store the generated speech.

SDK integration

Rate limits and quotas

Sound wave illustration for: Rate limits and quotas

Your API key allows 60 requests per minute, which is generally sufficient for standard news app integrations. Each request consumes characters from your balance, so monitoring usage helps avoid unexpected costs.

60 requests per minute

This limit applies to your active key. If you exceed this rate, the API returns a 429 error. You can rotate your key instantly from the dashboard to get a fresh limit without downtime.

10 requests before top-up

New accounts start with a lower limit of 10 requests per minute. This helps manage initial load. Once you add USDT (TRC-20) to your balance, the limit increases to 60 requests per minute.

Queued processing

Requests are processed sequentially. Under heavy load, your request may wait in a queue before synthesis begins. This ensures stable audio generation but may introduce slight latency for bulk operations.

  • Long texts are split and joined client-side
  • Failed requests are free and do not consume balance

Handling long texts

Sound wave illustration for: Handling long texts

News applications often process articles or press releases that exceed the single-request character limit. Our API accepts input text in chunks of up to 4096 characters. Your application must split the text and join the resulting audio files.

Your application must split the source text, send each chunk to the POST /v1/audio/speech endpoint, and concatenate the resulting audio files. This client-side approach keeps the integration lightweight and fits naturally into existing news delivery pipelines.

Split at 4096 characters

Divide your input text into segments no longer than 4096 characters. Each segment counts toward your character quota and is billed separately. Ensure you include spaces and punctuation in your character count, as these are treated as characters.

Join audio files client-side

The API returns individual audio files for each request. You must join these files sequentially on the client side or within your backend service. This method maintains the natural flow of the narration, provided your splitting logic respects sentence boundaries where possible.

  • Process requests sequentially to avoid queue delays.
  • Ensure audio formats match when joining files.

Manage character counts

Keep track of the total characters processed to stay within your rate limits. With 60 requests per minute, long articles may require careful pacing. Monitor your dashboard to see real-time usage and balance, ensuring uninterrupted audio generation for breaking news updates.

Common errors

Sound wave illustration for: Common errors

Even lightweight APIs encounter edge cases. Knowing how to interpret error responses helps you build resilient news pipelines that handle hiccups gracefully without dropping audio feeds.

Below are the three most common issues you might see, along with clear steps to resolve them quickly.

Invalid API key

If the authorization header is missing or malformed, the API returns a 401 error. Ensure you are sending Authorization: Bearer tts-... with the correct key from your dashboard.

Rate limit exceeded

You are limited to 60 requests per minute. If you exceed this, wait a moment or check your key’s status. New keys start with a 10 requests/minute limit until the first top-up.

Input too long

Each request accepts up to 4096 characters. If your text exceeds this, split it into smaller parts and join the resulting audio files client-side to maintain continuity.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. For small product teams, this complexity can divert focus from core development.

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

More on this site