API Documentation for E-commerce Audio Generation

By VoiceSync Agency editorial team · Updated 2026-11-19

Welcome to the developer hub for VoiceSync Agency’s TTS API. This page provides the technical reference you need to integrate high-volume, natural-sounding voiceovers directly into your e-commerce workflows. Whether you are powering product descriptions, video ads, or accessibility features, our OpenAI-compatible endpoints allow you to generate audio files quickly using the tools you already know.

You will find clear specifications for authentication, request parameters, and response formats, along with ready-to-use code examples in cURL, Python, and JavaScript. We also detail rate limits, error handling, and supported audio formats so you can reliably scale your audio generation without unexpected interruptions or integration surprises.

API Documentation for E-commerce Audio Generation

Frequently asked questions

What is the base URL for the API?

The API base URL is https://api.tk78.info/v1. You use this endpoint for all requests, including POST /v1/audio/speech for synthesis, GET /v1/voices for voice metadata, and GET /v1/models for model information. This URL is the foundation for integrating our text-to-speech service into your e-commerce workflows.

How do I authenticate my requests?

Include your API key in the request header as Authorization: Bearer tts-... . Each account has one active key. If you need a new key, you can issue it anytime, and the old key stops working immediately. This ensures secure access to your text-to-speech generation capabilities.

Can I use the OpenAI SDK with this API?

Yes, the request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.tk78.info/v1 and providing your site-specific key. This allows seamless integration with your existing tools without needing a custom SDK or complex configuration changes.

What is the maximum character limit per request?

Each request supports up to 4096 characters in the input field. For longer texts, you should split them into parts of this size and join the resulting audio files. This limit ensures consistent processing performance while allowing you to generate voiceovers for detailed product descriptions or longer content.

How do I specify the language for a voice?

Pass the optional language parameter 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 to ensure accurate pronunciation and natural-sounding output for your specific target audience.

What happens if I exceed the rate limit?

The limit is 60 requests per minute per key (10 per minute before the first top-up). Requests are processed sequentially, so exceeding the limit may cause your request to wait in a queue. This ensures fair usage and maintains service stability during high-volume generation periods for your store.

Are failed requests charged to my balance?

No, failed requests are free. If synthesis fails, the charge is returned in full to your balance. This protects your budget from unexpected costs due to transient errors, ensuring you only pay for successfully generated audio files that meet your quality standards for your e-commerce content.

How do I switch from tts-1 to tts-1-hd?

Simply change the model field in your request body from tts-1 to tts-1-hd. Both models use the same engine and have identical pricing. This flexibility allows you to test quality differences without adjusting your budget or integration logic, as the request shape remains exactly the same.

Can I change my API key without downtime?

Yes, you can issue a new key at any time. The old key stops working immediately when the new one is active. This allows you to rotate keys for security without interrupting your ongoing integrations, ensuring continuous service for your e-commerce platforms and agency clients.

What is the typical response time for long texts?

Long texts generate at roughly real-time speed, about 25 characters per second of audio. Short phrases take a few seconds. Requests are processed sequentially, so under load, a request may wait in a queue. This predictable timing helps you plan your content generation workflows effectively.

Do I need to install a specific SDK?

No, you do not need our specific SDK. You can use the official OpenAI SDK or plain HTTP requests. The API endpoint shape is compatible with OpenAI standards. This gives you the freedom to choose your preferred programming language and tooling for integrating text-to-speech into your applications.

How do I handle audio streaming in the browser?

The API returns the audio file in the response body; it does not support streaming or WebSocket connections. You receive the complete file once generation is done. For browser playback, you can handle the returned audio data as a standard file download or buffer for playback.

Is there a webhook for completion notification?

No, there is no webhook for completion notifications. The API is synchronous; you receive the audio file directly in the response after processing. This simplifies integration, as you do not need to manage webhook endpoints or handle asynchronous callbacks to know when your voiceover generation is complete.

How do I retrieve the list of available voices?

Send a GET request to /v1/voices. This endpoint returns details about available voices, languages, formats, and pricing. Use this information to select the appropriate voice preset, such as Aria or Felix, for your specific e-commerce use case, ensuring the tone matches your brand identity.

First request

curl

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

Sound wave illustration for: Authentication

Secure your API integration with a simple Bearer token. Send your key in the Authorization header to authenticate every request to the TTS endpoint. This ensures your usage is tracked correctly against your account balance.

Your key acts as the single point of access for all audio generation. Keep it secure in your environment variables to prevent unauthorized usage from your digital agency or online store workflows.

Bearer Token Usage

Bearer Token Usage

Include the header Authorization: Bearer tts-... in every HTTP request. The API validates this token before processing your text-to-speech jobs. Without it, requests return a 401 error.

Use this method for both cURL commands and SDK integrations. The token format remains consistent across all endpoints, ensuring a uniform authentication experience.

  • Format: Authorization: Bearer tts-your-api-key
  • Required for all POST and GET requests
  • Case-sensitive string value

Generating a New Key

Generating a New Key

Navigate to the /get-api-key/ dashboard to generate a fresh key. This is useful when rotating credentials or integrating with new client projects. The new key becomes active immediately.

You can issue a new key at any time without downtime. This allows seamless transitions between development and production environments for your e-commerce audio pipelines.

  • Access via the account dashboard
  • Instant activation upon generation
  • One active key per account; a new key can be issued any time (old one stops at once).

Invalidating Old Keys

Generating a new key automatically invalidates the previous one. The old key stops working immediately, ensuring no lingering access from compromised or outdated systems.

This immediate revocation is crucial for maintaining security in high-volume agency workflows. You do not need to wait for a cooldown period or manual approval.

  • Old key stops at once
  • No manual deactivation needed
  • Instant security update

Endpoints Overview

Sound wave illustration for: Endpoints Overview

Our API provides three core endpoints to handle audio generation, voice discovery, and model details. The primary endpoint processes your text input into audio, while the discovery endpoints let you verify available voices and model configurations before making calls.

POST /v1/audio/speech

This endpoint accepts your text payload and returns the synthesized audio file. It follows the standard OpenAI-compatible JSON structure, making integration straightforward for e-commerce platforms needing product descriptions or ad voiceovers.

  • Endpoint: POST https://api.tk78.info/v1/audio/speech
  • Accepts JSON body with model, input, voice, and format fields

GET /v1/voices

Retrieve the full list of available voices, their associated languages, supported formats, and pricing details. This allows your application to dynamically present voice options to users or configure batch jobs based on specific tonal needs.

  • Endpoint: GET https://api.tk78.info/v1/voices
  • Returns metadata for all 8 voice presets and supported languages

GET /v1/models

Check the available model versions, such as 'tts-1' and 'tts-1-hd'. This endpoint helps you verify which engine is active and ensures your requests align with the current model configurations.

  • Endpoint: GET https://api.tk78.info/v1/models
  • Lists supported model identifiers for synthesis requests

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts plain text input via the input field, supporting up to 4096 characters per request. Spaces and punctuation count toward this limit, so plan your character budget carefully when generating product descriptions or ad copy. For longer texts, split the content into chunks and join the resulting audio files.

Input Text and Length

Keep your input concise to ensure fast synthesis times, as requests are processed sequentially. Short phrases may take a few seconds, while longer texts generate at roughly real-time speed.

Voice Selection

Choose from eight preset voices, including female options like Aria and Nova, and male options like Felix and Atlas. Each voice offers a distinct tone suitable for different e-commerce contexts, from energetic promos to calm instructional guides.

  • Aria: Warm, clear narrator
  • Nova: Bright, upbeat
  • Felix: Energetic, promo
  • Atlas: Neutral, news

Response Format Options

Specify the output format using the response_format parameter. Available options include MP3 for web compatibility, WAV for high-quality audio, OPUS and FLAC for efficient compression, and PCM for raw data.

  • mp3
  • wav
  • opus
  • flac
  • pcm

Speed and Language

Sound wave illustration for: Speed and Language

Adjusting the speed allows you to fine-tune the pacing of product descriptions or ad voiceovers, ranging from a relaxed 0.25x to a brisk 4.0x. This flexibility ensures the audio matches your brand’s energy without needing post-production edits.

Language handling is critical for global e-commerce. While the API can guess the language from the script, explicitly setting the ISO code guarantees accuracy, especially for Latin-script texts that might otherwise default to English.

Adjustable Speed Range

Use the speed parameter to control generation pace. Values outside 0.25–4.0 will result in an error. Slower speeds can enhance clarity for complex product features, while faster rates work well for quick promo bursts.

Language Code Specification

Specify the language field with an ISO code (e.g., fr, de, ja) to force a specific voice output. This is essential when your input text uses Latin characters but requires a non-English voice, preventing incorrect language guessing.

  • Supported: Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, Turkish.

Automatic Language Detection

If language is omitted, the API guesses based on the script. Latin text defaults to English. Ensure your text matches the intended language to avoid mismatched voice outputs in multilingual catalogs.

Error Handling

Sound wave illustration for: Error Handling

Handling errors gracefully ensures your e-commerce audio pipeline stays robust during peak traffic or network hiccups. By anticipating common response codes and understanding rate limits, you can implement automatic retries without wasting credits on failed synthesis attempts.

Common HTTP Errors

Use standard HTTP status codes to diagnose issues. A 401 Unauthorized indicates an invalid or expired API key, while a 429 Too Many Requests signals you have hit your per-minute limit. Always check the response body for a clear error message to guide your retry logic.

  • 400 Bad Request: Missing required fields like model or input.
  • 401 Unauthorized: Invalid Bearer token.
  • 500 Internal Server Error: Temporary engine issue; retry after a short delay.

Rate Limit Exceeded

Your key allows 60 requests per minute once topped up, but only 10 before the first top-up. If you exceed this, the API returns a 429 status. Requests are processed sequentially, so under heavy load, you may also experience queuing delays before the 429 occurs.

  • 60 requests/minute after top-up.
  • 10 requests/minute before first top-up.
  • Implement exponential backoff for retries.

Invalid Character Count

Each request supports up to 4096 characters. If your product description or ad script exceeds this limit, split the text into chunks and join the resulting audio files. Sending more than 4096 characters in a single input field will result in a 400 error.

  • Maximum input length: 4096 characters.
  • Spaces and punctuation count towards the limit.
  • Split long texts manually for best results.
Error Handling

Code Examples

Sound wave illustration for: Code Examples

Integrate VoiceSync’s TTS engine directly into your e-commerce workflows using standard HTTP requests or the OpenAI SDK. These examples demonstrate how to generate audio files for product descriptions or ad scripts efficiently.

cURL Command

Send a POST request to the speech endpoint with your API key in the Authorization header. This method is ideal for quick testing or simple scripts.

  • Base URL: https://api.tk78.info/v1
  • Model: tts-1 or tts-1-hd
  • Format: mp3, wav, opus, flac, or pcm

Python OpenAI SDK

Use the official OpenAI Python library by overriding the base_url. This allows you to use familiar methods like client.audio.speech.create for seamless integration.

  • Install: pip install openai
  • Set base_url to https://api.tk78.info/v1
  • Pass your tts-... key as the API key

JavaScript Fetch Request

Construct a fetch request with the appropriate headers and JSON body. This approach works well in browser environments or Node.js applications for dynamic content generation.

  • Content-Type: application/json
  • Authorization: Bearer tts-...
  • Body: { model, input, voice, response_format }

Rate Limits

Sound wave illustration for: Rate Limits

To ensure fair usage across our shared infrastructure, the API enforces strict rate limits on every active key. Understanding these constraints helps you plan batch processing for product descriptions and ad voiceovers without unexpected interruptions.

60 Requests Per Minute

Once your account is fully funded, you can send up to 60 requests per minute. This limit applies per API key, so if you rotate keys, each key maintains its own quota.

10 Requests Before Top-Up

New accounts start with a restricted quota of 10 requests per minute. This allows you to test integration with your e-commerce workflow before committing to a top-up. The limit lifts automatically upon funding.

Queuing Behavior

Requests are processed sequentially. If the server is busy, your request may wait in a queue before synthesis begins. Longer texts take more time, so plan your API calls to avoid bottlenecks during peak shopping seasons.

  • No SLA guarantees for immediate processing
  • Backpressure is handled via standard HTTP delays
  • Ideal for batch jobs over off-peak hours

Audio Formats

Sound wave illustration for: Audio Formats

Choose the right audio format to balance file size and quality for your e-commerce workflows. MP3 is the standard for web delivery, offering small file sizes that load quickly on product pages and in video ads without sacrificing clarity.

MP3 for Web

MP3 is ideal for most digital use cases, including website accessibility features and social media ads. Its compressed nature ensures small file sizes while maintaining clear voice reproduction for customer-facing content.

WAV for High Quality

Select WAV when you need uncompressed, high-fidelity audio for professional video editing or archival purposes. This format preserves the full detail of the synthesized voice, ensuring the best possible quality for final creative assets.

OPUS and FLAC Options

OPUS provides efficient compression, while FLAC offers lossless compression for those who want smaller files than WAV without any quality loss. Both formats give you flexibility in storage and delivery efficiency.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Ask specific questions about voice warmth, clarity, and suitability for your brand.

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. IETF RFC 7845: Ogg Opus
  3. W3C WAI: making audio and video accessible
  4. MDN: Web Speech API
  5. curl documentation
  6. Creative Commons Attribution 4.0
  7. OpenAI API reference: create speech
  8. LibriVox public-domain audiobooks
  9. ISO 639 language codes
  10. openai-python on GitHub
  11. openai-node on GitHub
  12. LibriTTS-R corpus (OpenSLR 141)

More on this site