TTS API Quickstart Guide
This quickstart guide shows how to integrate our uncensored chat completions API into your TTS pipeline. Use the OpenAI-compatible endpoint to generate scripts, captions, and dialogue without content refusals.
https://api.ttsapihub.com/v1
Base URL and Authentication
Start by configuring your client to point to our base URL: https://api.ttsapihub.com/v1. Our API is fully OpenAI-compatible, so you can use standard SDKs by simply updating the base_url and providing your API key. Authentication is handled via the Authorization header with a Bearer token. You generate a unique key during signup on the Get API key page. Each account is limited to one active key, which you can regenerate at any time. Your prompts are not used for training, and no phone number or credit card is required to start with the trial credit.
Generate Text with Chat Completions
Send a standard POST /v1/chat/completions request to generate text. The model ID to use is uncensored. This model is an open-weight LLM tuned to answer without content refusals for lawful adult use, making it ideal for creative scripts or dialogue where corporate filters might block your content. It does not generate audio, images, or video; it outputs pure text for your TTS pipeline to process. You can adjust parameters like temperature and max_tokens as needed. The API supports tool calling for structured data extraction, allowing you to format responses for your application.
curl https://api.ttsapihub.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Python SDK Integration
For Python developers, the official openai SDK works out of the box with minimal configuration. Initialize the client with your base URL and API key, then call chat.completions.create(). This approach lets you leverage existing OpenAI-compatible clients while benefiting from our uncensored model. The response includes the generated text, which you can feed directly into your speech synthesis engine. Remember that this is a text-only API, so you handle audio generation separately in your pipeline.
from openai import OpenAI
client = OpenAI(base_url="https://api.ttsapihub.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)
Node SDK Integration
Node.js developers can use the openai npm package with the same configuration as Python. Set the baseURL to our endpoint and provide your API key. Call the completions endpoint with the model ID uncensored. This integration is straightforward and allows you to integrate our text generation directly into your existing Node.js TTS services. The API responds with standard JSON, making it easy to parse and process the generated text for your application's needs.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ttsapihub.com/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);
Streaming Responses via SSE
For lower latency, enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) containing incremental text chunks. This is particularly useful for long-form content generation, as users can see text appearing in real-time. The streaming response follows the standard OpenAI SSE format, so you can use existing stream parsers. This approach reduces perceived wait times and allows your application to display text as it is generated, improving the user experience for your TTS pipeline.
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Limits, Errors, and Context Window
Your API key is limited to 300 requests per minute and an 8 MB request body. The model supports a 100,000-token context window, allowing for long scripts or documents. Common errors include 401 (invalid key), 402 (insufficient credit), and 429 (rate limit). If you hit the rate limit, implement exponential backoff. Pricing is transparent: $0.25 per 1M input tokens and $1.00 per 1M output tokens. Credits are prepaid, never expire, and top-ups start at $10. A new account receives $0.50 in trial credit valid for 7 days, requiring no card. Content limits block only sexual content involving minors; all other lawful adult, fictional, or controversial topics are allowed.
API specifications
A quick checklist for developers: format, limits, features, billing.
| Parameter | Details |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Model ID | uncensored |
| Authentication | Authorization: Bearer YOUR_KEY |
| Base URL | https://api.ttsapihub.com/v1 |
| Context window | 100,000 tokens, input and output combined |
| SSE streaming | Supported (stream: true), usage included at the end |
| Structured output | response_format: {"type": "json_object"} |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Completion length | 16,000 tokens max; 2,048 if max_tokens is not set |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Concurrency | up to 8 in parallel per key |
| Max body | up to 8 MB per request |
| Rate limit | 300 requests per minute per key |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Volume bonus | +5% from $50, +10% from $100 |
| Price | input $0.25 / 1M tokens, output $1.00 / 1M tokens |
| Top-up | USDT (TRC20) or USDC (Base), any whole amount from $10 to $500 |
| Credit expiry | paid credit never expires, no subscription |
| Trial credit | $0.50 for 7 days, no card |
| Content | adult content allowed; sexual content involving minors is refused |
| Key management | one key per account, regenerate any time (the old one stops working) |
| Sign-in | Google or e-mail and password |
Error codes
Every error is JSON with a type you can switch on. You are never charged for an error.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or prompt + max_tokens over the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
Does this API generate audio?
No, this is a text-only API. It generates the text script or dialogue, which you then send to a separate TTS engine for audio generation. It does not produce audio, images, or video files.
How do I get started with the API?
Sign up on the Get API key page with an email and password. You receive an API key immediately and $0.50 in trial credit valid for 7 days. No credit card or phone number is required to start.
What is the context window size?
The model supports a 100,000-token context window, which includes both the input prompt and the output completion. This allows for processing long documents or maintaining extensive conversation history in your pipeline.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.