Quickstart for Xtts pipelines
Integrate our uncensored text API into your voice cloning pipeline with this quickstart guide. Learn to generate scripts, captions, and raw text responses using standard OpenAI-compatible endpoints.
Authentication & Base URL
Start by navigating to the Get API key page and signing in with Google or an email password. You will receive a unique API key immediately. Use the base URL https://api.xtts.cc/v1 for all requests. This URL is compatible with official OpenAI SDKs and any client that supports the OpenAI chat-completions format.
Include your key in the Authorization header as a bearer token. The model identifier you must send is uncensored. This open-weight model is hosted on our servers and is tuned to answer without content refusals for lawful adult use, ensuring your voice pipeline receives the raw text it needs.
Generate Uncensored Text
Send a POST request to /v1/chat/completions with your system and user prompts. The API returns structured JSON containing the generated text. This endpoint is designed for prompt writing, script generation, and post-processing tasks in your voice cloning workflow.
The request body includes the model name, your message history, and optional parameters like temperature or top_p. You can control the output length with the max_tokens parameter. If you do not set max_tokens, the response can run to the end of the window.
curl https://api.xtts.cc/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
Use the official OpenAI Python SDK to interact with our API. Set the base_url to our endpoint and provide your API key. This approach allows you to leverage existing code structures while benefiting from our uncensored model's behavior.
Create a client instance with the base URL and then call chat.completions.create. Pass the uncensored model ID and your messages. The response object contains the generated text in content. This method is ideal for batch processing scripts or integrating text generation into larger Python applications.
from openai import OpenAI
client = OpenAI(base_url="https://api.xtts.cc/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
For JavaScript environments, use the OpenAI Node SDK. Configure the client with our base URL and API key. This setup enables you to generate text directly in your web or server-side applications.
Call the chat completions endpoint with the uncensored model. The response provides the generated text, which you can then pass to your voice synthesis engine. This integration is suitable for real-time text generation in web apps or backend services that prepare scripts for voice cloning.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.xtts.cc/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
Enable streaming by setting stream to true in your request. The API returns Server-Sent Events (SSE) for each generated token. This feature is useful for real-time text display or progressive voice synthesis preparation.
Each event chunk contains partial text. The final chunk includes usage statistics, such as token counts. Streaming ensures your application can process text as it is generated, reducing perceived latency for users. Handle the stream events to accumulate the complete response.
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)
Rate Limits & Parameters
Each API key is limited to 300 requests per minute and 8 concurrent requests. The request body must not exceed 8 MB. If you send an invalid key, you will receive a 401 error. If your prepaid credit is exhausted, you will receive a 402 error. Exceeding the rate limit results in a 429 error.
The context window supports 100,000 tokens total, including both the prompt and the completion. There is no separate output cap, and you can specify a lower max_tokens if you want a shorter reply. Errors and refusals do not consume your prepaid credit. Support for function calling and JSON mode is available for structured data extraction.
Under the hood: specs
One table with every limit, feature and price that applies to your key.
| Feature | Support |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| API key | Bearer token in the Authorization header |
| Model ID | uncensored |
| Base URL | https://api.xtts.cc/v1 |
| Tools / tool calls | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| JSON mode | JSON object mode via response_format json_object |
| Context window | 100,000 tokens, input and output combined |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Request size | up to 8 MB per request |
| Parallel requests | up to 8 in parallel per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Rate limit | 300 requests per minute per key |
| Trial credit | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Token prices | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Subscription | paid credit never expires, no subscription |
| Sign-in | Google or e-mail and password |
| Keys | one active key per account; a new key replaces the old one |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
When a request fails
The type field is stable, the message is for humans. Errors cost nothing.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | unknown endpoint |
413 | request_too_large | body over 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
How do I top up my prepaid credit?
You can top up by crypto (USDT on TRC20, USDC on Base). Accepted amounts range from $20 to $500. You receive a 5% bonus for top-ups of $50 or more, and a 10% bonus for $100 or more. Credit never expires.
Does the API generate audio or video?
No, this API is strictly for text generation. It provides an uncensored text response that you can feed into your own voice synthesis or video pipelines. It does not produce audio, images, or video files directly.
What is the trial offer?
New users get $0.50 of trial credit, one per person, valid for 7 days. Claim this credit with one click on your API key page. No credit card is required to sign up. This allows you to test the API before purchasing prepaid credit.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.