Cloud TTS API: Generate Audio with 8 Voices

By Nnko editorial team · Updated 2026-11-19

This documentation provides the technical specifications for the Nnko text-to-speech API, designed for startups generating radio spots and ad campaigns. You will find exact endpoint structures, parameter definitions, and integration guides for the eight licensed voices, ensuring your synthetic speech delivery is reliable and consistent.

The guide covers authentication, request formatting, and response handling, with specific examples for cURL and the OpenAI SDK. It details rate limits, pricing mechanics, and troubleshooting steps for common encoding or timeout issues, enabling engineers to integrate audio generation into their ad production pipelines efficiently.

Cloud TTS API: Generate Audio with 8 Voices

Frequently asked questions

How do I get an API key?

Sign up on the /get-api-key/ page using Google or an email and password. Accounts are per site. The dashboard displays your active API key, balance, trial credit, characters left, and usage.

What is the base URL for the API?

The API base URL is https://api.nnko.info/v1. You send POST requests to /v1/audio/speech for synthesis. Other endpoints like /v1/voices and /v1/models are also available at this base path.

Does the API support OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. You can use the official OpenAI SDKs by changing the base_url to https://api.nnko.info/v1 and providing your Nnko API key.

What are the rate limits?

Limits are 60 requests per minute per key. New accounts start with 10 requests per minute until the first top-up is processed. Requests are processed sequentially, so high load may cause queuing.

How do I handle errors?

If synthesis fails, the charge is returned in full. Check the response status code. Failed requests incur no cost, so you can retry or adjust parameters like text length or voice selection.

Can I use curl for requests?

Yes. The dashboard provides a ready curl example. Send a POST request with JSON body containing model, input, voice, and response_format. Include your API key in the Authorization header as Bearer tts-...

What audio formats are supported?

Supported formats are mp3, wav, opus, flac, and pcm. Specify the desired format in the response_format field of your request. The generated audio is returned directly in the response body.

How do I select a voice?

Choose from eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. Each voice has a distinct tone. You can also optionally specify a language ISO code to guide synthesis.

What is the model parameter?

Use tts-1 or tts-1-hd. Both use the same engine and price. The model parameter determines the generation quality tier but does not affect the cost per character or the request structure.

How long does a request take?

Typical speed is roughly real time (25 characters per second). Short phrases take a few seconds. Under load, requests may wait in a queue since they are processed sequentially.

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 must wait for the full file to be generated.

Is SSML supported?

No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. Input text is sent as plain text up to 4096 characters. Control is limited to voice and speed parameters.

How do I rotate my API key?

Issue a new key from your dashboard at any time. The old key stops working immediately. You can have one active key per account, ensuring secure access management for your applications.

What happens if I exceed the limit?

Requests are processed sequentially. If you exceed the rate limit, new requests may wait in a queue until capacity is available. Failed requests due to other errors are free and refunded.

First request

curl

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

Access the Nnko TTS API using a unique API key issued to your account. You can generate or rotate keys via the /get-api-key/ dashboard. Each account holds one active key at a time, ensuring simple, secure integration for your ad campaign workflows.

Authentication is handled via the standard HTTP Authorization header. Pass your key as a Bearer token with every request to the speech endpoint. This method is compatible with all standard HTTP clients and the OpenAI SDK when configured with our base URL.

API Key

API Key

Your API key is the primary credential for accessing the TTS engine. It is generated when you create an account or via the dashboard. Keep this key secure in your environment variables or CI/CD secrets. Do not expose it in public GitHub repositories or client-side code.

The key grants access to your specific account balance and rate limits. If you suspect a leak, rotate the key immediately from the dashboard. The old key becomes invalid instantly, preventing unauthorized usage of your credits.

  • Keys are generated per account on nnko.info
  • One active key per account at any time
  • Rotate keys instantly via the dashboard

Bearer Token

Bearer Token

Include your API key in the Authorization header using the Bearer scheme. This is the standard method for authenticating REST API requests. The header format is: Authorization: Bearer tts-xxxxxxxxxxxxxxxxxxxxxxxx.

Ensure no extra spaces or characters are included in the token value. Incorrect formatting will result in a 401 Unauthorized error. The API validates the token against our internal database before processing the speech synthesis request.

  • Format: Authorization: Bearer <your-api-key>
  • Case-sensitive header name
  • No additional whitespace in the token value

Key Rotation

You can issue a new API key at any time from your account dashboard. When you generate a new key, the previous one is immediately invalidated. This is useful for security audits or if a key is compromised in a build artifact.

There is no downtime during rotation. The new key becomes active instantly. Update your integration configuration to use the new key as soon as it is generated. Old requests using the expired key will receive a 401 error.

  • Generate new key anytime via dashboard
  • Old key stops immediately
  • No downtime during rotation

Endpoints

Sound wave illustration for: Endpoints

The API exposes three primary endpoints for generating audio, managing voice resources, and retrieving model details. Each endpoint follows standard RESTful conventions, accepting JSON payloads or returning structured data.

Authentication via Bearer token is required for all requests. The base URL for all endpoints is https://api.nnko.info/v1.

Speech Endpoint

Use POST /v1/audio/speech to convert text into audio. Send a JSON body with model, input, voice, and optional parameters like response_format or speed. The endpoint returns the audio file directly in the response body.

If synthesis fails, the endpoint returns an error object and no charge is applied. Requests are processed sequentially; under load, a queue may form.

  • POST /v1/audio/speech
  • Accepts JSON body
  • Returns audio file or error

Voices Endpoint

Call GET /v1/voices to retrieve a list of available voices, their associated languages, supported formats, and pricing details. This endpoint helps you select the correct voice preset for your radio spot or campaign.

Each voice supports all 23 listed languages. You can filter or sort the results client-side based on your requirements.

  • GET /v1/voices
  • Lists 8 voice presets
  • Shows language support

Models Endpoint

Use GET /v1/models to fetch available model identifiers, primarily tts-1 and tts-1-hd. Both models use the same engine and pricing structure.

This endpoint is useful for verifying model availability or integrating with tools that require dynamic model discovery.

  • GET /v1/models
  • Returns tts-1 and tts-1-hd
  • Same engine and price

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis request by defining the model, input text, and voice. The API accepts plain text inputs up to 4096 characters, where spaces and punctuation count toward the character limit. For texts exceeding this length, split the input and join the resulting audio files.

Model Selection

Choose between "tts-1" or "tts-1-hd" using the model field. Both models use the same underlying engine and pricing structure ($10 per 1 million characters), allowing you to switch formats without cost implications.

Input Text

Provide your script via the input field. The system supports 23 languages, including English, German, and Japanese. If the language parameter is omitted, the API guesses the language from the script, defaulting to English for Latin text.

Voice Selection

Select one of eight licensed voices from the voice parameter, such as aria for warm narration or atlas for neutral news delivery. Each voice is based on licensed recordings from LibriTTS-R (CC BY 4.0), from LibriVox public-domain audiobook readings.

Response Format

Sound wave illustration for: Response Format

The API returns synthesized audio directly in the response body, eliminating the need for polling or secondary downloads. Supported formats include MP3, WAV, Opus, FLAC, and PCM, allowing flexible integration with your existing audio pipelines. Each file is generated via a standard HTTP POST response, ensuring compatibility with any HTTP client capable of handling binary data streams.

Failed requests return a JSON error object with details, ensuring you are not charged for unsuccessful synthesis attempts. This transparency allows for reliable retry logic in your ad campaign generation workflows.

Audio File

The response body contains the raw audio bytes in the format specified by your response_format parameter. For long texts split into segments, you receive individual audio files that you must join client-side. All generated files contain an inaudible synthetic watermark to identify them as AI-generated speech.

Ensure your application handles binary data correctly, as the response is not JSON-encoded when successful. The content type header matches your requested format (e.g., audio/mpeg for MP3).

  • Formats: mp3, wav, opus, flac, pcm
  • Binary response body
  • Inaudible watermark included

Error Objects

If synthesis fails (e.g., invalid voice, text too long, or rate limit exceeded), the API returns a JSON object with an error field. This includes a code (e.g., invalid_request_error) and a message describing the issue. Failed requests incur no charge, so you can safely retry or adjust parameters.

This allows you to trace specific failures in your billing logs without confusion.

  • JSON format
  • Includes code and message
  • No charge on failure

Status Codes

Standard HTTP status codes are used: 200 OK for successful audio generation, 400 Bad Request for invalid parameters (e.g., unsupported voice or model), 401 Unauthorized for missing or invalid API keys, and 429 Too Many Requests when exceeding the 60 requests per minute limit.

A 500 Internal Server Error indicates a transient issue on our end. In such cases, you may retry with exponential backoff. Always check the status code before parsing the response body to avoid errors with binary audio data.

  • 200: Success
  • 400: Bad Request
  • 401: Unauthorized
  • 429: Rate Limited

OpenAI SDK

Sound wave illustration for: OpenAI SDK

The Nnko API mirrors the OpenAI speech endpoint structure, allowing you to integrate directly using the official OpenAI SDKs. This compatibility means you can leverage existing client libraries without writing custom HTTP parsers, simply by adjusting the base URL to point to our infrastructure.

Base URL Change

Update your SDK configuration to use https://api.nnko.info/v1 as the base URL. This directs all requests to our processing engine while maintaining the standard request shape expected by the OpenAI client.

Client Initialization

Initialize the client with your API key using the standard environment variable or explicit parameter. The authentication header Authorization: Bearer tts-... is handled automatically by the SDK once the key is provided.

SDK Compatibility

The official OpenAI SDKs work out of the box. Since we match the request schema exactly, you can call the speech endpoint using familiar methods without needing a custom Nnko-specific library.

OpenAI SDK

Curl Example

Sound wave illustration for: Curl Example

Use curl to test the API directly from your terminal. This confirms connectivity and authentication before integrating into your application stack.

Basic Request

Send a simple POST request to generate audio. The following command uses the default model and voice.

  • ```bash
  • curl -X POST https://api.nnko.info/v1/audio/speech \
  • -H "Authorization: Bearer tts-your-api-key" \
  • -H "Content-Type: application/json" \
  • -d '{"input": "Hello world", "model": "tts-1", "voice": "nova", "response_format": "mp3"}' \
  • -o output.mp3
  • ```

With Parameters

Adjust speed and language explicitly. Setting language ensures correct pronunciation for non-English Latin scripts, avoiding automatic English fallback.

  • ```bash
  • curl -X POST https://api.nnko.info/v1/audio/speech \
  • -H "Authorization: Bearer tts-your-api-key" \
  • -H "Content-Type: application/json" \
  • -d '{"input": "Fast delivery", "model": "tts-1-hd", "voice": "atlas", "response_format": "wav", "speed": 1.2, "language": "en"}' \
  • -o output.wav
  • ```

Error Handling

Failed requests are free. Check the HTTP status code. A 4xx error indicates an authentication or input issue, while 5xx suggests a temporary server load.

Rate Limits

Sound wave illustration for: Rate Limits

Requests are processed sequentially, so under load a request may wait in a queue. Typical speed is roughly real time, generating about 25 characters of text per second for long texts. Short phrases take a few seconds.

Keep your implementation efficient to avoid hitting limits. The rate limit applies per API key, not per IP address.

Requests Per Minute

Each API key is limited to 60 requests per minute. This limit applies to the POST /v1/audio/speech endpoint. If you exceed this, you will receive a 429 Too Many Requests error.

  • Limit: 60 requests/minute per key
  • Applies to: POST /v1/audio/speech
  • Error code: 429

Pre-top-up Limit

Accounts without a top-up are limited to 10 requests per minute. This lower limit helps prevent abuse before payment is verified. Top up via USDT (TRC-20) to increase your limit to 60 requests per minute. The limit is 10 requests per minute before the first top-up.

  • Pre-top-up: 10 requests/minute
  • After top-up: 60 requests/minute

Queue Processing

Requests are processed one after another. If multiple requests are sent simultaneously, they will be queued. This means that under heavy load, a request may wait before synthesis begins. Plan your batch sizes accordingly to avoid delays.

  • Sequential processing
  • Queuing under load
  • Plan batch sizes

Troubleshooting

Sound wave illustration for: Troubleshooting

Synthesis failures return full refunds, but common HTTP errors indicate configuration issues. Ensure the Authorization header uses the Bearer scheme and verify that the model field is strictly tts-1 or tts-1-hd. Invalid voice names or unsupported response formats trigger immediate 400 errors without character deduction.

Common Errors

A 401 Unauthorized error means the API key is missing, malformed, or expired. Rotate your key immediately via the dashboard; the old key stops instantly. A 429 Too Many Requests error indicates you have exceeded the 60 requests per minute limit. Requests processed during congestion queue behind existing tasks, causing delays.

  • 401: Invalid or expired Bearer token
  • 400: Missing required fields like input or voice
  • 429: Rate limit exceeded (60 req/min)

Timeouts

Long texts or high load may cause request timeouts. Synthesis is not real-time; it processes sequentially. If a request waits in the queue, the connection may drop before audio is generated. Implement retry logic with exponential backoff. Short phrases typically complete in a few seconds, while longer texts take proportional time.

  • Implement retry logic with exponential backoff
  • Expect delays during high queue volumes
  • Short phrases take a few seconds

Text Encoding

Input text must be valid UTF-8. Special characters or malformed encoding can cause silent failures or garbled audio. Ensure your payload does not exceed 4096 characters. Split longer texts into smaller chunks before sending. Verify that your client library handles UTF-8 encoding correctly.

  • Use valid UTF-8 encoding
  • Split text > 4096 characters
  • Verify client library encoding settings

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. It returns synthesized audio files ready for immediate integration into your ad production workflow.

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. MDN: Web Speech API
  3. TRON developer hub: TRC-20
  4. OpenAI API reference: create speech
  5. ISO 639 language codes
  6. openai-python on GitHub
  7. LibriTTS-R corpus (OpenSLR 141)
  8. curl documentation
  9. Python documentation
  10. Tether (USDT)
  11. W3C WAI: making audio and video accessible
  12. LibriVox public-domain audiobooks

More on this site