News Audio API: Generate Speech from Text

By PressCast editorial team · Updated 2026-11-19

This page provides the technical documentation for PressCast’s text-to-speech API, designed specifically for news publishers and editorial teams. It covers the essentials for integrating high-quality audio narration into your content pipeline, from obtaining your API key to handling long-form articles. You will find concrete examples for generating speech using standard HTTP requests or the official OpenAI SDK, ensuring you can adopt the service without adopting a new, custom library.

We focus on reliable, straightforward integration for your newsroom workflows. Here you will learn how to manage rate limits, handle character limits for long texts, and choose the right audio formats for web delivery. The guide also details our supported voices, languages, and common error codes, giving you the specific numbers and endpoints needed to move from prototype to production quickly and efficiently.

News Audio API: Generate Speech from Text

Frequently asked questions

How do I get an API key?

Visit the /get-api-key/ page and sign up using Google or an email and password. Your account is specific to this site. Once registered, you will receive a single active Bearer key. You can issue a new key at any time, which immediately invalidates the previous one.

What SDKs are supported?

The API follows the same request shape as the OpenAI speech endpoint. Therefore, the official OpenAI SDKs work directly by changing the base_url to https://api.galaxyspinscasino.info/v1 and using your site-specific key. No custom SDK is required for integration.

Do I need a custom SDK?

No. Our endpoint matches the OpenAI speech API structure, so you can use the official OpenAI SDKs by simply updating the base_url to https://api.galaxyspinscasino.info/v1. Alternatively, any standard HTTP client or tools like curl work perfectly. We do not provide a custom SDK, keeping integration straightforward for your news pipeline.

How do I send a request?

Send a POST request to https://api.galaxyspinscasino.info/v1/audio/speech with a JSON body. Include your Bearer token in the Authorization header. Required fields are model, input (text), and voice. You can optionally specify response_format, speed, and language.

What is the rate limit?

You are limited to 60 requests per minute per key. Before your first top-up, this limit is lower at 10 requests per minute. Requests are processed sequentially, so high load may cause queuing delays.

Can I stream audio?

No. The API returns the complete audio file in the response. There is no streaming, WebSocket, or real-time partial audio support. You receive the full file after synthesis completes, which typically takes a few seconds for short phrases.

How do I handle long articles?

Split your text into parts of up to 4096 characters per request. Send each part individually and then join the resulting audio files. This ensures each request stays within the character limit while maintaining audio continuity.

What formats are available?

You can choose from mp3, wav, opus, flac, or pcm. These formats are specified in the response_format field of your request body. Choose based on your storage needs and playback requirements for your news content.

How do I set the language?

Pass the optional ISO code in the language field. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, explicitly set the language to ensure accuracy.

What happens on error?

If synthesis fails, the charge is returned in full. Failed requests are free. You can retry the request or check the response for details. Your balance remains unaffected by failed attempts.

Is the API RESTful?

Yes. It uses standard HTTP methods with a JSON request body and returns audio files. The endpoint is POST /v1/audio/speech, and voices are listed via GET /v1/voices. It follows standard RESTful conventions for easy integration.

Can I use curl?

Yes. The /get-api-key/ page provides a ready curl example. You can send POST requests with JSON bodies using curl. This is a simple way to test the API or integrate it into scripts without additional libraries.

How do I regenerate my key?

You can issue a new key at any time from your account page. When a new key is generated, the old one stops immediately. This allows you to rotate keys securely without downtime.

What is the character limit?

Each request supports up to 4096 characters of input text. Spaces and punctuation count toward this limit. For longer articles, split the text into chunks of this size and process them sequentially.

First request

curl

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

Start by creating an account at /get-api-key/. You can sign up instantly using your Google account or provide an email and password. This creates your workspace for managing API access.

Sign up via Google or email

Sign up via Google or email

Google sign-ups receive $0.50 of free trial credit, valid for 7 days. Email-based accounts start with zero balance. You can top up later with USDT on the TRON network.

Find your key in the dashboard

Find your key in the dashboard

Once logged in, your unique API key is displayed in the dashboard. Use this key in the Authorization: Bearer header for all requests. The dashboard also shows your current balance and usage stats.

Regenerate key if needed

If your key is exposed, generate a new one immediately. The old key stops working instantly. You can issue a new key at any time from the dashboard settings.

Make Your First Request

Sound wave illustration for: Make Your First Request

Send a POST request to the speech endpoint with your text payload. The API processes the input and returns the generated audio file directly in the response body, allowing you to save the result immediately.

POST request to /v1/audio/speech

Direct your HTTP client to https://api.galaxyspinscasino.info/v1/audio/speech. Include your Authorization: Bearer header with your API key to authenticate the request.

JSON body with text and voice

The request body must be valid JSON. You need to specify the model (e.g., tts-1), the voice preset, and the input text. Optional fields include language, response_format, and speed.

  • Set model to tts-1 or tts-1-hd.
  • Provide text in the input field (max 4096 characters).
  • Choose a voice from the 8 available presets.

Receive audio file in response

On success, the API returns the audio file in the specified format. Failed requests incur no charge, ensuring you only pay for delivered content.

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

Integrating PressCast into your news pipeline is straightforward because we mirror the OpenAI speech endpoint structure. You do not need to learn a new API schema or rewrite your existing audio generation logic. Simply point your client to our base URL and use your PressCast API key.

This compatibility means your editorial team can switch providers or add redundancy without extensive code refactoring. The familiar request shape ensures a smooth transition from testing to production environments.

Change base_url to our API

Update your SDK configuration to use https://api.galaxyspinscasino.info/v1 as the base URL. Keep your existing Authorization header with your tts-... key. All other parameters like model, input, and voice remain identical to the standard OpenAI format.

  • Base URL: https://api.galaxyspinscasino.info/v1
  • Auth: Bearer tts-<your-key>
  • Endpoint: POST /v1/audio/speech

Use official OpenAI SDKs

You can use the official OpenAI SDKs for Python, Node.js, or other languages. This allows you to leverage existing libraries your team already knows. No learning curve for new syntax or authentication methods.

  • Python SDK supported
  • Node.js SDK supported
  • HTTP libraries work directly

No custom library needed

You do not need to install a separate PressCast-specific library. The standard OpenAI client handles the request shape perfectly. This reduces dependency management and keeps your project lightweight.

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

Choosing the right audio format ensures your news content loads quickly and sounds clear across all devices. The API supports five output formats, allowing editorial teams to balance file size, quality, and compatibility based on their specific publishing workflow.

Each format serves a distinct purpose, from lightweight web delivery to lossless archival storage. You can select the format that best fits your player’s capabilities and your audience’s bandwidth constraints without compromising on the synthetic speech quality.

MP3 for web delivery

MP3 is the standard choice for most news websites and mobile apps. It offers a good balance between file size and audio clarity, ensuring fast load times even on slower connections. This format is widely supported by all major web players and podcasts.

Use MP3 when you need broad compatibility and efficient bandwidth usage. It is ideal for on-demand articles where listeners may be on mobile data or older devices.

  • Ideal for web players and podcast feeds
  • Small file sizes for faster loading
  • Broad device compatibility

WAV for high quality

WAV provides uncompressed audio, preserving the full quality of the synthesized voice. This format is best for editors who want lossless audio for further editing or broadcasting. It results in larger files but ensures no data loss during playback.

Use WAV when audio fidelity is the priority, such as in radio segments or high-end editorial features. The raw data can be easily processed by standard audio editing software without re-encoding artifacts.

  • Uncompressed, lossless quality
  • Best for editing and broadcasting
  • Larger file sizes

FLAC, OPUS, PCM options

FLAC offers lossless compression, reducing file size while maintaining perfect audio quality. OPUS is highly efficient, offering excellent quality at low bitrates. PCM provides raw, uncompressed audio data, useful for specific technical integrations or direct hardware playback.

These formats cater to specialized needs. FLAC is great for archives, OPUS for efficient delivery, and PCM for systems requiring raw audio streams. Select based on your infrastructure’s requirements for compression and data integrity.

  • FLAC: Lossless compression for archives
  • OPUS: Efficient streaming at low bitrates
  • PCM: Raw uncompressed data for technical use

Rate Limits and Performance

Sound wave illustration for: Rate Limits and Performance

Publishers sending frequent audio requests should monitor their usage to avoid temporary blocks. The API enforces a standard rate limit of 60 requests per minute per key, which handles typical editorial workflows without issue. If you exceed this threshold, the API returns a 429 error until the window resets.

60 requests per minute

Each API key allows up to 60 synthesis requests every minute. This limit applies to all voices and formats combined. For most newsrooms generating short segments or summaries, this capacity is sufficient for steady content production.

10 requests before first top-up

New accounts start with a reduced limit of 10 requests per minute until the first top-up is processed. This ensures system stability during initial high-volume bursts. Once you add USDT to your balance, your rate limit increases to the full 60 requests per minute.

Queue processing under load

Requests are processed sequentially. Under heavy load, a request may wait in a queue before synthesis begins. While long texts generate at roughly real-time speed, short phrases may take a few seconds. Plan your integration to handle slight delays gracefully.

Rate Limits and Performance

Handling Long Texts

Sound wave illustration for: Handling Long Texts

News articles often exceed the 4,096-character limit per request. You must split your text into smaller chunks before sending them to the API.

Split text into 4096 char chunks

Divide your input text into segments of 4,096 characters or fewer. Each segment generates a separate audio file. This approach ensures compatibility with the standard request shape.

Join audio files programmatically

Concatenate the returned audio files in the correct order. You can use any standard audio library to merge MP3, WAV, or other supported formats. This creates a single continuous file.

Maintain continuity

Ensure your splitting logic respects sentence boundaries where possible. While the API does not store state between requests, keeping chunks semantically coherent improves the listener experience. Spaces count toward the character limit.

Common Error Codes

Sound wave illustration for: Common Error Codes

Errors are standard in API integrations, and PressCast returns clear HTTP status codes to help you troubleshoot quickly. Most issues stem from authentication or rate limits, which are easy to resolve with the right key or by adjusting your request frequency.

401 for invalid key

This error means your Authorization header contains an incorrect or expired key. Ensure you are using the correct Bearer token from your dashboard. If you regenerated your key, the old one stops immediately, so update your configuration right away.

  • Check for typos in the Bearer token.
  • Ensure no extra spaces before or after the key.
  • Verify you are using the latest active key from /get-api-key/.

429 for rate limit

You have exceeded the limit of 60 requests per minute per key (or 10 per minute before your first top-up). Wait a few seconds before retrying. To handle spikes, consider implementing exponential backoff in your integration logic.

  • Limit: 60 req/min after top-up.
  • New accounts: 10 req/min initially.
  • Implement retry logic with delays.

500 for server errors

A 500 status indicates a temporary issue on our side, such as a processing timeout or internal error. These are rare. If you see this, retry the request after a short pause. Failed requests are free, so you won’t be charged for retries.

  • Retry with a short delay.
  • No charge for failed attempts.
  • Contact support via email if persistent.

Voices and Languages

Sound wave illustration for: Voices and Languages

Select the right voice for your news segments by calling GET /v1/voices. This endpoint lists all 8 presets, available languages, and supported formats, allowing you to match audio tone to your editorial style without guessing.

Accurate pronunciation is critical for news. Explicitly setting the language parameter ensures the engine uses the correct phonetic rules, especially for non-English Latin-script text. Without it, the system may default to English, leading to mispronounced names or places.

List voices with GET /v1/voices

Use this endpoint to retrieve the full catalog of voices and their capabilities. You can verify available formats and languages programmatically before generating audio.

The response includes all 8 presets, from warm narrators like Aria to neutral news voices like Atlas.

  • Aria: warm, clear narrator
  • Atlas: neutral, news
  • Felix: energetic, promo
  • Luna: soft, storytelling
  • Milo: friendly, conversational
  • Nova: bright, upbeat
  • Orion: deep, documentary
  • Sage: calm, instructional

Set language code for accuracy

Always include the language field with an ISO code (e.g., es, fr, de). This prevents the engine from guessing incorrectly, ensuring proper accent and pronunciation for specific news contexts.

This is especially important for mixed-language text or proper nouns that might otherwise be Anglicized by the default detector.

Default language detection

If you omit the language parameter, the system guesses the language from the text script. Latin script defaults to English.

For non-English Latin text, relying on detection may lead to errors. Explicitly setting the language code is the reliable method for accurate news delivery.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. There are no monthly plans, seats, or hidden fees, making budgeting predictable for newsrooms of any size.

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. curl documentation
  3. openai-python on GitHub
  4. Node.js documentation
  5. W3C WAI: making audio and video accessible
  6. Creative Commons Attribution 4.0
  7. FFmpeg documentation
  8. openai-node on GitHub
  9. LibriVox public-domain audiobooks
  10. OpenAI API reference: create speech
  11. ISO 639 language codes
  12. Tether (USDT)

More on this site