Complete Guide to the AnimVoice Text-to-Speech API

By AnimVoice editorial team · Updated 2026-11-19

This documentation details the AnimVoice API for generating synthetic speech audio files. It is designed for animators and cartoonists who need reliable, licensable voices without the overhead of manual voice acting or complex cloning workflows. The API follows the OpenAI speech endpoint structure, allowing you to send text and receive audio in formats like MP3, WAV, Opus, or FLAC.

You will find precise specifications for authentication, endpoint behavior, and rate limits. The guide covers integration using standard OpenAI SDKs or plain HTTP requests, including Python and JavaScript examples. All pricing, voice presets, and technical constraints are based on the current live infrastructure at api.pokom7.info.

Complete Guide to the AnimVoice Text-to-Speech API

Frequently asked questions

How do I get my API key?

Sign up on the /get-api-key/ page using Google or email and password. The dashboard displays your active API key, balance, trial status, characters left, usage, and a ready curl example. Each account is tied to a single site. You can issue a new key at any time, which immediately invalidates the previous one.

Which SDK is recommended for integration?

There is no official SDK for AnimVoice. Use the official OpenAI SDKs by changing the base_url to https://api.pokom7.info/v1 and providing your site-specific key. Alternatively, you can use plain HTTP requests. The request shape matches the OpenAI speech endpoint exactly.

Can I use the OpenAI Python SDK with this API?

Yes. Configure the OpenAI Python SDK by setting the base_url to https://api.pokom7.info/v1. Use your AnimVoice API key for authentication. The endpoint structure is identical to OpenAI’s speech endpoint, allowing you to use the same code structure with minimal configuration changes.

What is the maximum length of text per request?

The maximum input length is 4096 characters per request. For longer texts, split the input into chunks of up to 4096 characters. Generate audio for each chunk separately, then join the resulting audio files to create the final output.

How do I specify the output format?

Include the response_format field in your JSON body. Supported formats are mp3, wav, opus, flac, and pcm. The default format is mp3, but you can explicitly request any supported format to suit your project’s audio requirements.

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). Exceeding this limit will result in errors. Requests are processed sequentially, so high load may also cause queuing delays. Monitor your usage via the dashboard.

Can I generate audio asynchronously?

The API processes requests sequentially. There is no asynchronous streaming or WebSocket support. Requests are handled one after another, meaning under load, a request may wait in a queue. You must manage concurrency in your client code if needed.

Do I need to install a specific library?

No specific AnimVoice library is required. You can use the official OpenAI SDKs or standard HTTP libraries. Since the endpoint matches the OpenAI speech format, any library capable of sending JSON POST requests and receiving audio files works.

How do I handle authentication errors?

Ensure your request includes the header Authorization: Bearer tts-... with your valid key. If you receive an error, verify the key format. You can generate a new key on the dashboard, which immediately invalidates the old one. Check for typos in the base URL.

Is the API endpoint stable?

The endpoint POST https://api.pokom7.info/v1/audio/speech is the stable interface. While no SLA or uptime guarantee is provided, the structure follows the OpenAI standard. Use the documented fields for model, input, voice, response_format, and speed for consistent results.

Can I use the same key for multiple projects?

Yes, one active key per account can be used across multiple projects. However, the rate limit of 60 requests per minute applies to the key globally. If multiple projects share the key, they share this rate limit.

How do I rotate my API key?

Issue a new key from the dashboard at any time. The new key becomes active immediately, and the old key stops working at once. Update your applications to use the new key. This ensures secure access without downtime.

What is the difference between tts-1 and tts-1-hd?

Both models use the same engine and price. The model field accepts either tts-1 or tts-1-hd. There is no functional or pricing difference between them for this API. You can use either identifier interchangeably in your requests.

Does the API support streaming responses?

No, the API does not support streaming, WebSockets, or real-time partial audio. The entire audio file is returned in the response body after synthesis completes. For long texts, you must manage splitting and joining audio files manually.

First request

curl

curl https://api.pokom7.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.pokom7.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.pokom7.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 AnimVoice API by including your unique key in the Authorization header. Each account holds one active key, which you can generate on the /get-api-key/ dashboard page.

Keys follow the prefix tts- followed by alphanumeric characters. This simple token structure ensures secure, direct access to the synthesis endpoints without complex OAuth flows.

API Key format

API Key format

Your API key is a string starting with tts-. It is generated when you create an account via Google or email/password on the site's dashboard.

Bearer token usage

Bearer token usage

Include the key in every request using the standard HTTP header: Authorization: Bearer tts-.... This ensures the server authenticates your request and deducts from your balance correctly.

  • Use Authorization: Bearer tts-<your_key>

Key rotation policy

You can issue a new key at any time from your dashboard. The old key stops working immediately upon generation of the new one, ensuring no overlap or accidental usage of revoked credentials.

Endpoints Overview

Sound wave illustration for: Endpoints Overview

The API provides three core endpoints for generating and managing synthetic speech. You interact with the speech generation endpoint to convert text into audio files, while the voices and models endpoints expose the available configuration options and engine details.

These endpoints follow a standard REST structure, making integration straightforward for animation pipelines that need to batch-process scripts or generate dialogue lines on demand.

Speech generation endpoint

POST /v1/audio/speech accepts your script and returns an audio file directly in the response body. This is the primary endpoint for generating voice lines for your animated scenes.

The endpoint handles the synthesis engine logic, applying the selected voice, speed, and language parameters to produce the final audio asset.

  • Method: POST
  • Path: /v1/audio/speech
  • Returns: Audio binary data

Voices listing endpoint

GET /v1/voices returns a list of all available presets, their associated languages, supported formats, and pricing tiers. This allows you to programmatically select the right voice for each character.

Use this endpoint to verify supported languages before sending speech requests, ensuring your characters speak in the correct dialect.

  • Method: GET
  • Path: /v1/voices
  • Returns: JSON list of voices

Models listing endpoint

GET /v1/models provides metadata about the underlying synthesis engines. Currently, this confirms the availability of the 'tts-1' and 'tts-1-hd' models.

This endpoint helps verify that the API service is online and operational before you begin your batch generation process.

  • Method: GET
  • Path: /v1/models
  • Returns: Model metadata

Request Parameters

Sound wave illustration for: Request Parameters

Configure the synthesis engine and input constraints to generate audio files. Select the model, define the text payload, and specify voice and language parameters for each request.

The API processes text up to 4096 characters per request. Longer scripts must be split and joined by the client. The engine generates audio at roughly real-time speed, processing requests sequentially.

Model selection

Choose between tts-1 and tts-1-hd. Both use the same underlying engine and pricing structure, so select based on your quality preference without affecting cost.

The model name is sent as a string in the JSON body. Both options support all 8 voice presets and 23 languages.

Input text limits

The input field accepts plain text strings with a maximum length of 4096 characters. Spaces and punctuation count toward this limit.

For animations exceeding this length, split the script into chunks and concatenate the resulting audio files client-side.

  • Max length: 4096 characters
  • Includes spaces and punctuation
  • Split manually for longer scripts

Voice and language settings

Select one of 8 voices (e.g., aria, nova, felix). The language field accepts an ISO code; if omitted, the system guesses based on script, defaulting to English for Latin text.

Each voice can speak any of the 23 supported languages. Explicitly setting the language ensures correct pronunciation for non-English content.

  • 8 preset voices available
  • 23 supported languages
  • Explicit language code recommended

Response Formats

Sound wave illustration for: Response Formats

The API returns audio data in the format specified by the response_format parameter. Each file is a complete audio segment corresponding to the input text, ready for immediate download or pipeline integration.

MP3 output

MP3 is the default format, offering efficient compression for web playback and standard editing workflows. It supports variable bitrates to balance file size and quality, making it ideal for quick prototyping in animation pipelines.

WAV output

WAV provides uncompressed, lossless audio with zero generation artifacts. This format is preferred when precise timing is critical for lip-syncing or when further lossless processing is required in your editing software.

Opus and FLAC options

Opus offers high-quality compression at low bitrates, suitable for streaming or bandwidth-constrained environments. FLAC provides lossless compression, reducing storage size without sacrificing audio fidelity, perfect for archiving high-quality voice assets.

Rate Limits

Sound wave illustration for: Rate Limits

AnimVoice enforces a strict rate limit of 60 requests per minute per API key. This limit applies to all speech generation endpoints and ensures stable processing for animation pipelines. If you exceed this threshold, subsequent requests will receive a 429 Too Many Requests error until the window resets.

60 requests per minute

Each active key allows 60 synthesis requests within a sliding 60-second window. This capacity is sufficient for most independent animation workflows, allowing for batch processing of dialogue lines without significant delay.

10 requests before top-up

New accounts with an unused free trial credit are limited to 10 requests per minute. This lower limit prevents accidental rapid consumption of the initial trial balance. Once you top up your balance via USDT (TRC-20), the limit increases to the standard 60 requests per minute.

Queue behavior under load

Requests are processed sequentially. Under heavy load, additional requests may wait in a queue before synthesis begins. Typical generation speed is roughly real-time (25 characters per second), but queue wait times may increase if many parallel requests are submitted. Plan your animation timeline accordingly to avoid synchronization issues.

Rate Limits

Error Handling

Sound wave illustration for: Error Handling

The API returns standard HTTP status codes to indicate request outcomes. A 200 OK response confirms successful synthesis, while 400-level errors indicate issues with input parameters, such as invalid voice IDs or text exceeding the 4096-character limit. 500-level errors indicate server-side issues. 429 Too Many Requests signal that you have exceeded the rate limit of 60 requests per minute.

Common error codes

Use the error message in the JSON response body to identify the specific issue. Common causes include malformed JSON, unsupported response formats, or expired authentication keys. Always check the code field to programmatically handle these states.

  • 400 Bad Request: Invalid parameters or malformed JSON.
  • 401 Unauthorized: Invalid or missing API key.
  • 429 Too Many Requests: Rate limit exceeded.

Refund on failure

If synthesis fails due to a server-side error, the charge is returned in full. This ensures you only pay for successfully generated audio files. Failed requests are free, so you can retry without penalty.

Retry logic

Implement exponential backoff for 429 and 500 errors. Since requests are processed sequentially under load, short delays between retries prevent overwhelming the queue. For 400 errors, verify your input parameters before retrying immediately.

SDK Integration

Sound wave illustration for: SDK Integration

AnimVoice implements the standard OpenAI speech endpoint schema, allowing you to leverage existing client libraries without rewriting core logic. By adjusting the base URL, standard SDKs handle authentication, request serialization, and audio decoding seamlessly.

OpenAI SDK compatibility

The API accepts the same JSON structure as the OpenAI Speech endpoint. You can use official OpenAI SDKs for Python and JavaScript by simply redirecting them to our infrastructure.

Base URL configuration

Set the base URL to https://api.pokom7.info/v1. This ensures all requests, including voice listing and model metadata, route through our API gateway while maintaining standard field names.

Python and JS examples

In Python, initialize the client with your Bearer token and point it to our base URL. The code structure remains identical to OpenAI examples, requiring only the URL override.

JavaScript users can configure the SDK instance similarly. Pass the text input and desired voice parameters, and the SDK handles the binary audio response.

Curl Example

Sound wave illustration for: Curl Example

The following curl command demonstrates a standard synthesis request. It sends a short text payload to the speech endpoint using the tts-1 model. This example assumes you have already obtained an API key from the dashboard.

You can execute this command directly in your terminal to verify connectivity. The response will contain the binary audio data, which you can redirect to a file for immediate playback or further processing in your animation pipeline.

Basic request structure

The request body uses JSON format. Specify the model, input text, voice, and desired response format. Ensure the text length does not exceed 4096 characters. The API processes requests sequentially, so complex payloads may queue under high load.

Set the speed parameter between 0.25 and 4.0 to adjust playback rate. The default is 1.0. The language code is optional but recommended for non-English Latin text to prevent incorrect voice selection.

Headers configuration

Include the Authorization header with your Bearer token. Use the exact format: Authorization: Bearer tts-your-key-here. This authenticates the request against your account balance.

Set the Content-Type header to application/json to ensure the server correctly parses the input text and parameters. No additional headers are required for standard usage.

Response parsing

A successful response returns the audio file directly in the body. Save this binary data to a file with the appropriate extension (e.g., .mp3 or .wav). Failed requests return an error JSON object with details on why synthesis failed.

If the request fails, the charge is refunded automatically. Check the HTTP status code to determine if the audio was generated successfully. Use curl -o output.mp3 to save the response directly to a file.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. These mistakes often stem from treating TTS as a simple text-to-audio converter rather than a nuanced performance tool.

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

More on this site