TTS API Quickstart Guide for Newsroom Developers Using OpenAI SDK

By News Audio Wire editorial team · Updated 2026-11-19

This guide shows newsroom developers how to integrate the News Audio Wire TTS API using the OpenAI SDK. We explain how to replace expensive enterprise speech providers with a transparent, character-based solution designed for high-volume editorial workflows. You will learn to generate audio files programmatically, manage voice presets, and handle responses efficiently within your existing infrastructure.

The documentation covers authentication, parameter configuration, and rate limits specific to news feeds. You will find concrete examples for splitting long texts, selecting output formats, and handling errors with automatic refunds. This resource is intended for technical teams scaling audio content delivery who need reliable, character-counted billing without enterprise contracts or SLAs.

TTS API Quickstart Guide for Newsroom Developers Using OpenAI SDK

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or email. Accounts are per site. The dashboard displays your active API key, balance, and usage. You can issue a new key at any time; the old one stops immediately. Failed requests are free, and a $0.50 trial credit is available for Google sign-ups.

Can I use the OpenAI Python SDK?

Yes. The endpoint matches the OpenAI speech endpoint shape. Configure the SDK’s base_url to https://api.d1555.info/v1 and use your site’s key. This allows you to use the official OpenAI SDKs directly without custom wrappers. The request fields and response format remain identical to the standard OpenAI speech integration.

What is the base URL?

The API base URL is https://api.d1555.info/v1. Use this for all requests, including the speech endpoint at /v1/audio/speech. The voices endpoint is at /v1/voices, and models are at /v1/models. Ensure your Authorization header uses the Bearer token format with your specific API key.

What voices are available?

Eight presets are available: Aria, Nova, Luna, and Sage (female); Felix, Milo, Atlas, and Orion (male). Voices are based on licensed recordings from LibriTTS-R and LibriVox. Each generated file includes an inaudible watermark marking it as synthetic speech. You can select any voice for any supported language.

How do I set the language?

Pass the optional language field with an ISO code. 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. Supported languages include Arabic, Chinese, English, French, German, Spanish, and 18 others.

What is the character limit?

Each request accepts 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 efficient processing while maintaining audio continuity across segments.

How fast is the generation?

Generation is roughly real-time, processing about 25 characters per second for long texts. Short phrases take a few seconds. Requests are processed sequentially, so under load, a request may wait in a queue. Typical speed depends on text length and current server load.

Do you support SSML?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. You can adjust the speed parameter between 0.25 and 4.0 to modify playback rate. For precise control, split text into segments and adjust speed per segment manually in your application logic.

Can I stream the audio?

No. There is no streaming, WebSocket, or real-time partial audio support. The API returns the complete audio file in the response. You must wait for the full synthesis to complete before receiving the audio data. This applies to all response formats including mp3, wav, and opus.

What formats are supported?

Supported response formats are mp3, wav, opus, flac, and pcm. Specify the desired format in the response_format field. The choice affects file size and compatibility but not the underlying synthesis engine. All formats include the synthetic speech watermark. Choose based on your storage and playback requirements.

What are the rate limits?

The limit is 60 requests per minute per key. Before the first top-up, the limit is 10 requests per minute. Requests are processed sequentially. Exceeding the limit may result in delays or errors. Monitor your usage via the dashboard to manage volume effectively during high-demand periods.

What happens on error?

Failed requests are free. If synthesis fails, the charge is returned in full. The API returns an error status code with details. No characters are deducted from your balance for failed attempts. You can retry the request or adjust parameters like speed or voice based on the error message.

Is there a WebSocket endpoint?

No. There is no WebSocket endpoint for real-time audio streaming. The API uses standard HTTP POST requests. Audio is returned as a complete file in the response body. Use standard HTTP libraries for integration, as no specialized WebSocket client is required.

How do I rotate my key?

Issue a new API key from your dashboard at any time. The new key becomes active immediately, and the old one stops working at once. This allows seamless rotation without downtime. You can generate multiple keys, but only one remains active per account at any given time.

First request

curl

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

Sound wave illustration for: Authentication Setup

Authentication for the News Audio Wire API requires a single active bearer token per account. You generate this key on the /get-api-key/ page after signing in via Google or email. This key authorizes all subsequent requests to the API endpoint.

Generating your API key

Generating your API key

Visit the dashboard to view your current key and balance. The system issues one active key per account, visible immediately upon creation. Ensure you copy the string starting with tts- accurately, as it is required for every request.

Using Bearer token in headers

Using Bearer token in headers

Include your key in the Authorization header of every HTTP request. Use the format Authorization: Bearer tts-.... The API validates this token before processing any synthesis job, ensuring only authorized newsroom accounts can generate audio content.

Rotating keys when needed

You can issue a new key at any time from the dashboard. When a new key is generated, the previous one becomes invalid immediately. This allows for secure rotation without downtime, ensuring your news feeds remain uninterrupted during security updates.

First API Request

Sound wave illustration for: First API Request

The synthesis endpoint accepts plain text and returns an audio file. This direct HTTP call bypasses the need for complex client-side libraries, making it ideal for automated news pipelines that generate audio summaries from editorial drafts.

Below is a minimal request using cURL. It demonstrates the basic structure required to convert a news headline into speech. The endpoint handles the conversion, returning the binary audio data in the response body.

Adjust the voice parameter to match your publication's brand identity, such as atlas for neutral news delivery. Ensure the input field contains your clean, pre-processed text string without markdown formatting.

Curl example for synthesis

Send a POST request to the speech endpoint. Replace <YOUR_API_KEY> with your secret key from the dashboard. The request body must be valid JSON containing the model, input text, and voice selection.

  • Endpoint: POST https://api.d1555.info/v1/audio/speech
  • Header: Authorization: Bearer tts-...
  • Content-Type: application/json

JSON body structure explanation

The request body requires three mandatory fields: model, input, and voice. The model field accepts either tts-1 or tts-1-hd, both using the same engine and pricing. The input field holds your text, limited to 4096 characters. Spaces and punctuation count toward this limit.

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

Response format handling

The API returns the audio file directly in the response body. No wrapper JSON is included. You must handle the binary stream correctly in your newsroom CMS to store or publish the file. Supported formats include MP3 for web delivery and WAV for archival quality.

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

The OpenAI SDKs are compatible with News Audio Wire by simply redirecting the base URL. Set the endpoint to https://api.d1555.info/v1 and provide your API key in the Authorization header. This allows editorial teams to use familiar code structures without learning a new client library.

Developers can maintain their current SDK version while leveraging our transparent character-based pricing model.

Changing the base_url

Update your SDK configuration to point to our API base URL. This single change enables the official OpenAI Python and JavaScript libraries to communicate with our TTS engine, handling authentication and request formatting automatically.

Ensure your API key is included in every request header. The SDK will handle the serialization, allowing you to focus on text input and voice selection.

  • Base URL: https://api.d1555.info/v1
  • Header: Authorization: Bearer tts-<your-key>

Using official OpenAI SDKs

Leverage the standard OpenAI SDK clients directly. No custom wrappers or additional dependencies are required. The request shape matches the OpenAI speech endpoint exactly, ensuring predictable behavior for newsroom developers accustomed to that ecosystem.

This compatibility reduces onboarding time for engineering teams managing large-scale audio generation for daily news updates.

Model selection (tts-1 vs tts-1-hd)

Both tts-1 and tts-1-hd models use the same underlying engine and pricing structure. Select tts-1 or tts-1-hd based on your preference; both use the same engine and pricing.

The choice does not affect character billing, allowing editorial teams to optimize for audio quality without worrying about cost variations between models.

Input Parameters

Sound wave illustration for: Input Parameters

The API accepts text input with a strict limit of 4096 characters per request. This constraint applies to the entire string, including spaces and punctuation. For news articles exceeding this length, you must split the content into chunks and join the resulting audio files programmatically to maintain continuous playback.

When sending your request, ensure the text is properly encoded. The system handles character counting automatically, so every space and punctuation mark contributes to your usage billing. This predictable metric helps editorial teams estimate costs accurately before generation begins.

Text input up to 4096 characters

The API accepts text input with a strict limit of 4096 characters per request. This constraint applies to the entire string, including spaces and punctuation. For news articles exceeding this length, you must split the content into chunks and join the resulting audio files programmatically to maintain continuous playback.

Voice preset selection

Select from eight distinct voice presets tailored for different editorial tones. Female voices include Aria (warm narrator), Nova (upbeat), Luna (storytelling), and Sage (instructional). Male options cover Felix (energetic promo), Milo (conversational), Atlas (neutral news), and Orion (documentary style).

Each voice is designed to match specific news formats, from hard news to feature stories. You can switch voices between requests without any penalty, allowing flexible tone management across different segments of your broadcast.

  • 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 adjustment (0.25–4.0)

Adjust the playback speed between 0.25 and 4.0 times the normal rate. This feature allows you to condense long transcripts for quick briefings or slow down complex financial reports for better comprehension.

Speed changes are applied in real-time during synthesis, affecting the final audio duration without altering the voice characteristics. This is particularly useful for fitting audio content into fixed broadcast slots or adapting to different listening contexts.

Output Formats

Sound wave illustration for: Output Formats

Choose the output format that matches your publication’s infrastructure. MP3 offers a balance of quality and bandwidth for audio players embedded in news articles. WAV provides uncompressed audio ideal for archival storage or pipelines where file size is less critical than sound reproduction.

For efficient distribution, Opus delivers compression suitable for mobile apps and variable bandwidth environments. FLAC provides lossless compression, preserving original audio quality. Select based on your specific delivery needs.

MP3 for web delivery

MP3 is the standard for web audio players embedded in news articles. It offers a strong balance between quality and bandwidth efficiency, ensuring fast load times for readers on both desktop and mobile devices.

WAV for high-quality archives

WAV provides uncompressed, high-fidelity audio. It is ideal for archival storage or broadcast pipelines where file size is less critical than pristine sound reproduction and compatibility with legacy audio systems.

Opus and FLAC options

Opus delivers excellent compression with low latency, suitable for mobile apps and variable bandwidth environments. FLAC provides lossless compression, preserving original audio quality while reducing storage requirements compared to WAV.

Output Formats

Rate Limits for News Feeds

Sound wave illustration for: Rate Limits for News Feeds

Newsroom automation pipelines often trigger multiple audio generations per article update. Understanding rate limits ensures your ingestion scripts do not stall during peak editorial hours.

60 requests per minute limit

Each API key supports a maximum of 60 requests per minute. This limit applies per key. If your workflow generates audio for breaking news stories rapidly, monitor your consumption to avoid throttling.

10 requests per minute initially

New accounts start with a lower limit of 10 requests per minute. This baseline applies until you complete your first top-up. Upgrade your limit by adding credit via USDT (TRC-20) to scale your newsroom's audio output immediately.

Queue behavior under load

Requests are processed sequentially. If your pipeline exceeds the per-minute limit, subsequent requests wait in a queue rather than failing instantly. Longer texts take more time to synthesize, so plan your batch jobs accordingly to avoid delays in delivery.

Handling Long Texts

Sound wave illustration for: Handling Long Texts

News scripts often exceed the 4096-character limit per request. Your application must split long articles into manageable chunks before sending them to the API. This ensures every segment generates successfully without truncation errors.

The API returns separate audio files for each chunk. Your backend needs to concatenate these files in order. This workflow allows you to publish complete, coherent audio versions of lengthy news stories seamlessly.

Splitting text into chunks

Divide input text into segments of 4096 characters or fewer. Ensure splits occur at natural boundaries like sentence endings to maintain audio clarity. Each segment becomes a separate API call.

Track the character count precisely. Spaces and punctuation count toward the limit. Accurate splitting prevents partial words or broken sentences in the final audio output.

  • Maximum 4096 characters per request
  • Count spaces and punctuation
  • Split at sentence boundaries

Joining audio files programmatically

Receive multiple audio files from sequential API calls. Use your server-side language to merge these files into a single continuous track. Maintain the original order of the chunks.

Ensure the audio formats match. If you request MP3, all chunks will be MP3. Use libraries like ffmpeg or native audio modules to join the files without quality loss.

Managing character limits

Monitor the total character count of your source text. If a story exceeds 4096 characters, you must make multiple requests. Each request counts toward your rate limit of 60 per minute.

Failed requests do not consume credits. If a chunk fails to synthesize, you can retry that specific segment without penalty. This allows for robust error handling in long-form audio generation.

Error Codes and Handling

Sound wave illustration for: Error Codes and Handling

Synthesis failures occur when the API rejects a request, typically due to invalid parameters or temporary service issues. These errors are distinct from HTTP-level connection problems and indicate that the audio engine could not process the input text. Understanding these distinctions helps editorial teams troubleshoot delivery issues without unnecessary downtime.

When a synthesis fails, the system ensures you are not charged for the failed attempt. The character count remains unchanged, and no credit is deducted from your balance. This guarantees that your newsroom’s audio pipeline remains cost-effective even during unexpected outages or configuration errors.

Common HTTP error codes

The API returns standard HTTP status codes to indicate the nature of the failure. A 401 Unauthorized error means your Bearer token is missing, invalid, or expired. A 400 Bad Request indicates that the JSON body contains invalid fields, such as an unsupported voice or speed outside the 0.25–4.0 range. A 429 Too Many Requests signals that you have exceeded the 60 requests per minute limit.

These codes help developers quickly identify whether the issue lies with authentication, input validation, or rate limiting. Addressing the specific code allows for automated retry logic or configuration adjustments in your news delivery pipeline.

  • 401: Invalid or expired API key
  • 400: Invalid JSON body or unsupported parameters
  • 429: Rate limit exceeded (60 req/min)

Synthesis failure scenarios

Synthesis failures can occur if the input text exceeds 4096 characters in a single request or contains unsupported characters that the engine cannot process. Additionally, if the voice preset is unavailable for the specified language, the request will fail. These scenarios are predictable and can be mitigated by pre-validating text length and language compatibility before sending the request.

The system does not store the failed audio, ensuring no storage costs are incurred. Developers should implement logic to catch these errors and retry with corrected parameters, such as splitting longer texts or adjusting the language code.

Refund process for errors

If a synthesis fails, the charge is returned in full. No manual claim is required; the system automatically credits your balance. This applies to both failed requests and any instances where the API returns a failure status code. Your balance reflects the correct amount immediately, ensuring accurate billing for your newsroom’s audio production.

This transparent refund process ensures that you only pay for successfully generated audio files. It aligns with the character-based pricing model, allowing editorial teams to scale their audio content without worrying about hidden costs from failed attempts.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Requests are processed sequentially, meaning under heavy load, a request may wait in a queue before synthesis begins.

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. Python documentation
  3. LibriVox public-domain audiobooks
  4. LibriTTS-R corpus (OpenSLR 141)
  5. curl documentation
  6. LibriTTS-R paper (arXiv 2305.18802)
  7. openai-node on GitHub
  8. TRON developer hub: TRC-20
  9. OpenAI API reference: create speech
  10. FFmpeg documentation
  11. ISO 639 language codes
  12. openai-python on GitHub

More on this site