API Documentation for Freelance Developers

By AudioPilot editorial team · Updated 2026-11-19

This guide shows freelance narrators and self-publishing authors how to generate audiobook chapters using the AudioPilot cloud API. You will learn to send text and receive audio files via a simple HTTP endpoint compatible with OpenAI SDKs. The documentation covers authentication, parameter selection, and error handling for integration into your production workflow.

You will get concrete steps for managing API keys, splitting long texts into 4096-character chunks, and selecting voices like Aria or Atlas. We explain rate limits, supported formats, and pricing transparency so you can build a consistent pipeline for character-based billing without hidden fees or complex subscriptions.

API Documentation for Freelance Developers

Frequently asked questions

Does the API support SSML?

No, the API does not support SSML. It accepts plain text input to generate audio files. You control pacing and tone by selecting from the eight available voice presets or adjusting the speed parameter between 0.25 and 4.0. For complex formatting, split your text into separate requests and join the resulting audio files manually.

Can I use the OpenAI Python SDK?

Yes, the official OpenAI SDKs work seamlessly. Change the base_url to https://api.60w.info/v1 and use your API key. The request shape matches the OpenAI speech endpoint exactly. This allows you to use familiar libraries like openai in Python without writing custom HTTP client code for your audiobook generation workflow.

How do I set the language explicitly?

Pass the optional language field with an ISO code in your JSON body. While the API guesses the language from the script (defaulting to English for Latin text), explicitly setting it ensures accuracy for non-English languages. Supported languages include Arabic, Chinese, French, German, Japanese, Spanish, and others listed in the documentation.

What is the maximum input length?

The maximum input length is 4096 characters per request. For longer texts, split your content into parts of up to 4096 characters. Generate audio for each part separately and join the resulting audio files. Spaces and punctuation count toward the character limit, so plan your splits accordingly for efficient audiobook production.

Do I need to pay for tts-1-hd?

No, tts-1-hd costs the same as tts-1. Both models use the same engine and pricing structure. You are charged $10 per 1 million characters regardless of which model you select. Use tts-1-hd when you need higher audio quality without incurring additional costs per request.

Is streaming supported via WebSocket?

No, streaming via WebSocket is not supported. The API returns the complete audio file in the response after processing. Requests are processed sequentially, so under load, a request may wait in a queue. You receive the final audio file once generation is complete, rather than receiving partial audio chunks in real time.

How do I handle errors in my script?

Check the HTTP status code and response body for error details. If synthesis fails, the charge is returned in full, so you are not billed for failed requests. Implement retry logic in your script for transient errors. Ensure your input text is under 4096 characters and your API key is valid before sending requests.

Can I change the speed dynamically?

Yes, you can adjust the speed dynamically by setting the speed parameter in your request. The value must be between 0.25 and 4.0. This allows you to control the pacing of your audiobook narration directly through the API. Adjust the speed per request to suit the tone of different sections of your text.

First request

curl

curl https://api.60w.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.60w.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.60w.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 the API using a Bearer token sent in the Authorization header. Your key is managed through the /get-api-key/ dashboard, where you can view your current credentials and usage statistics.

Each account maintains a single active key. If you need to rotate credentials, issuing a new key immediately invalidates the previous one, ensuring only one token is valid at any time.

Generate your Bearer token

Generate your Bearer token

Create your account via Google or email on the sign-up page. The dashboard displays your active key starting with 'tts-'. Include this token in every request as: Authorization: Bearer tts-...

One active key per account

One active key per account

Unlike systems that allow multiple concurrent keys, this API restricts you to one active token per account. This simplifies security management for freelance narrators who share credentials or use automated scripts.

Revoke old keys instantly

Generating a new key from the dashboard instantly deactivates the old one. There is no grace period; the previous key stops working immediately. Use this feature if you suspect unauthorized access or are switching development environments.

Base URL and SDK Setup

Sound wave illustration for: Base URL and SDK Setup

AudioPilot’s speech endpoint mirrors the OpenAI API structure, allowing you to reuse existing codebases with minimal changes. By adjusting the base URL, you can integrate our cloud TTS engine directly into your audiobook production pipeline without learning a new protocol.

The API accepts standard JSON payloads and returns audio files directly. This compatibility means you can leverage familiar tools and libraries to handle authentication, request formatting, and file storage efficiently.

OpenAI SDK compatibility

Our endpoint POST https://api.60w.info/v1/audio/speech follows the same request shape as OpenAI’s speech endpoint. This design ensures that developers already familiar with OpenAI’s structure can switch to AudioPilot with negligible friction.

You can use the same request parameters for model, input, voice, and response_format. The engine supports tts-1 and tts-1-hd, ensuring consistent behavior across different quality tiers.

  • Same JSON structure as OpenAI Speech API
  • Supports tts-1 and tts-1-hd models
  • Identical parameter names for voice and format selection

Setting the base_url

To route requests to AudioPilot, you must update the base_url in your client configuration. Point it to https://api.60w.info/v1 instead of the default OpenAI endpoint.

This single change directs all subsequent API calls to our infrastructure. Ensure your authentication header remains Authorization: Bearer tts-... using your unique site key.

  • Set base_url to https://api.60w.info/v1
  • Keep Authorization: Bearer tts-... header format
  • Point requests to the correct regional endpoint

Using official client libraries

You can use the official OpenAI SDKs for Python, Node.js, and other languages. Simply initialize the client with the adjusted base URL and your API key.

This approach lets you use standard methods like client.audio.speech.create(). The library handles serialization and file download automatically, simplifying integration into your narrator workflow.

  • Works with official OpenAI SDKs
  • Supports Python, Node.js, and other languages
  • Automates serialization and file handling

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts two model variants, tts-1 and tts-1-hd, which share the same underlying engine and pricing structure. This allows you to test quality without worrying about cost differences in your budgeting calculations for your audiobook projects.

Your input text is limited to 4096 characters per request. For longer chapters, you will need to split the text and join the resulting audio files later. The character count includes all spaces and punctuation marks.

Model: tts-1 or tts-1-hd

Both models use the same synthesis engine and price per million characters. You can choose either based on your preference for output characteristics, though the core audio generation remains identical. There is no price difference between them.

Using tts-1-hd does not incur extra fees, making it easy to switch for final master copies without adjusting your billing expectations.

Input text up to 4096 chars

Each API call can process a maximum of 4096 characters. This limit applies to the input field in your JSON body. Text exceeding this length must be divided into smaller segments before sending.

Remember that every space, comma, and period counts toward this limit. Plan your chunking strategy carefully to ensure no narrative context is lost between segments.

Voice selection and speed

Select from eight distinct voice presets tailored for narration. Options include female voices like Aria for warm storytelling or Luna for soft tones, and male voices like Atlas for neutral news or Orion for documentary styles.

You can adjust the playback speed between 0.25 and 4.0. This flexibility helps you match the pacing to your specific genre, whether it is a slow-paced mystery or a fast-paced thriller.

  • 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

Response Formats

Sound wave illustration for: Response Formats

The API returns audio as binary data in the response body. You must specify the desired response_format in your request, choosing from mp3, wav, opus, flac, or pcm. The endpoint does not store the generated file; it is delivered directly in the HTTP response stream.

MP3, WAV, Opus, FLAC, PCM

Select your preferred audio container based on your distribution needs. MP3 offers small file sizes for web playback, while WAV and FLAC provide uncompressed quality for archival or editing. Opus balances efficiency and quality, and PCM provides raw uncompressed data.

Binary audio in response

Unlike text endpoints, the speech endpoint returns raw audio bytes. When using the OpenAI SDK or standard HTTP libraries, you must handle the binary payload directly. Save the response body to a file with the corresponding extension (e.g., .mp3 or .wav) to ensure proper playback.

Choosing the right format

For audiobook production, FLAC is ideal for lossless quality during editing, while MP3 is suitable for final distribution to platforms like Audible or Kindle Direct Publishing. Opus offers excellent compression for streaming applications. PCM is useful if you need to process samples directly without decoding overhead.

  • MP3: Suitable for web streaming and final distribution.
  • WAV/FLAC: Ideal for editing and archival storage.
  • Opus: Efficient for low-bandwidth playback.
  • PCM: Raw data for custom processing pipelines.

Rate Limits and Queues

Sound wave illustration for: Rate Limits and Queues

AudioPilot processes requests sequentially, meaning synthesis happens one after another rather than in parallel. This design ensures consistent quality but requires understanding how volume affects your generation speed during peak usage periods.

60 requests per minute

Each API key supports a maximum of 60 requests per minute. This limit applies to the total number of synthesis jobs submitted, regardless of text length. Exceeding this cap will result in a rate limit error.

10 requests before top-up

New accounts or those with zero balance are restricted to 10 requests per minute. This lower limit helps manage server load before you add funds via USDT top-up. Once credited, the limit increases to the standard 60 RPM.

Queue behavior under load

Requests are processed in the order they are received. Under heavy load, your synthesis job may wait in a queue before generation begins. This can increase latency, especially for longer texts. Plan your batch submissions accordingly to avoid delays.

Rate Limits and Queues

Handling Long Texts

Sound wave illustration for: Handling Long Texts

Text-to-speech synthesis has a strict limit of 4,096 characters per request. To generate an entire chapter, you must split your manuscript into smaller segments that fit within this boundary. This ensures each request completes successfully without truncation.

Once you have segmented your text, send each chunk as a separate API call. The API returns individual audio files for each segment. You must then concatenate these files in the correct order to create a continuous audiobook file.

Splitting into chunks

Divide your text at natural breaks, such as paragraph ends or sentence boundaries, to avoid cutting words in half. Ensure each segment contains no more than 4,096 characters, including spaces and punctuation. This prevents request errors and maintains audio continuity.

  • Preserve paragraph breaks to maintain natural pacing in the final audio.
  • Track the character count of each segment to stay under the 4,096 limit.

Joining audio files

After receiving the audio files from each request, concatenate them using a standard audio library or command-line tool like FFmpeg. Ensure there are no gaps or overlaps between segments. This creates a seamless listening experience for your audience.

Process files in the exact order of your text segments. Verify the audio quality of each joined segment to ensure consistent volume and tone across the entire chapter.

  • Use FFmpeg to merge MP3 or WAV files sequentially.
  • Verify the total duration matches the expected length of the text.
  • Check for silent gaps between joined segments.

Managing character limits

Remember that spaces and punctuation count toward the 4,096 character limit. Plan your chunking strategy accordingly to avoid wasting characters on unnecessary whitespace. Monitor your usage to ensure efficient processing.

If a segment exceeds the limit, the API will reject the request. Always validate your text length before sending. This prevents failed synthesis and ensures you only pay for valid requests.

  • Count all characters, including spaces and punctuation.
  • Validate text length before each API call.

Error Codes and Handling

Sound wave illustration for: Error Codes and Handling

The API returns standard HTTP error codes to indicate specific failure states. Understanding these responses helps you handle retries and billing correctly without manual intervention.

Errors are distinct from successful responses, ensuring you know exactly when a request failed and when no charge should be applied.

Invalid API key

When the Authorization header contains a malformed or revoked token, the API returns a 401 Unauthorized status. This indicates that your key is no longer valid or was never correct.

Since each account holds only one active key, issuing a new key immediately invalidates the old one. Ensure you update your client configuration promptly after regeneration.

  • Status code: 401 Unauthorized
  • Action: Regenerate key via /get-api-key/

Input too long

If the input field exceeds 4096 characters, the API returns a 400 Bad Request error. The entire chunk is rejected, so no characters are consumed from your balance.

Split your manuscript into smaller segments before sending, ensuring each piece stays within the character limit to avoid unnecessary retries.

  • Status code: 400 Bad Request
  • Limit: 4096 characters per request

Rate limit exceeded

Exceeding 60 requests per minute results in a 429 Too Many Requests response. Your key remains valid, but further requests will be rejected until the window resets.

Before your first top-up, the limit is stricter at 10 requests per minute. Implement exponential backoff in your script to handle these queues gracefully.

  • Status code: 429 Too Many Requests
  • Limit: 60 req/min (10 before top-up)

Curl Example for Audiobooks

Sound wave illustration for: Curl Example for Audiobooks

Generate audio for your audiobook chapters by sending a POST request to the speech endpoint. The API accepts standard JSON bodies, allowing you to define the model, input text, voice, and language directly in the request payload.

You can customize the output by adjusting the speed parameter and selecting from eight distinct voice presets. The response returns the binary audio data, which you can save directly to your project directory for further editing or distribution.

Basic speech request

Send a POST request to https://api.60w.info/v1/audio/speech with your Bearer token. Include the model (e.g., tts-1), input text, and voice preset in the JSON body. The API processes the text and returns the audio file.

Ensure the input text does not exceed 4096 characters. If your chapter is longer, split it into chunks and concatenate the resulting audio files later.

  • Endpoint: POST /v1/audio/speech
  • Auth: Bearer token in header
  • Model: tts-1 or tts-1-hd

Setting speed and voice

Select a voice that fits your narrative style, such as luna for soft storytelling or atlas for neutral narration. The speed parameter ranges from 0.25 to 4.0, allowing you to adjust the pace of the narration.

Specify the language if the text is not English, even if it uses Latin script, to ensure accurate pronunciation.

Saving the output file

Use the -o flag in curl to save the binary response directly to a file. For example, -o chapter1.mp3 saves the output as an MP3 file.

You can choose from multiple formats including MP3, WAV, Opus, FLAC, and PCM depending on your editing needs.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Once you receive the audio files for each chunk, concatenate them in the correct order.

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

More on this site