Prompts and scripts over one endpoint
Get your text completion API running in minutes with this quickstart guide for Ltx NSFW pipelines. We cover authentication, standard OpenAI-compatible requests, and streaming responses so you can integrate uncensored text models into your existing stacks.
Base URL & Auth
Start by configuring your client with the base URL https://api.ltxnsfw.cc/v1. This endpoint is fully compatible with the official OpenAI SDKs and any library that supports the OpenAI API standard. You will need an API key, which you can generate on our Get API key page using Google or an email password. Keep this key secure, as it authenticates all requests to the uncensored model.
Authentication is handled via the Authorization header. Pass your key as a Bearer token. Our API expects the header format Authorization: Bearer YOUR_API_KEY. Ensure you are using the correct key, as each account is limited to one active key at a time.
Send a Request
Make a standard POST request to the /v1/chat/completions endpoint. You must set the model field to uncensored. This model is an open-weight LLM tuned for lawful adult content without refusals. It is not GPT, Claude, or any other vendor model.
Include your system and user messages in the messages array. The API returns text completions. Errors and refusals do not consume your prepaid credit, so you can test freely. Below is a basic cURL example to get started.
curl https://api.ltxnsfw.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
Use the official openai Python package to interact with the API. Set the base_url to our endpoint and provide your API key. This approach allows you to leverage existing code structures while switching to our uncensored model.
The following example demonstrates how to initialize the client and send a simple chat completion request. This method is ideal for backend services or data engineering pipelines that process text sequentially.
from openai import OpenAI
client = OpenAI(base_url="https://api.ltxnsfw.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
For JavaScript and TypeScript developers, the Node SDK provides a clean interface for integration. Configure the client with the same base URL and API key as the Python example.
This approach is suitable for web servers or edge functions where you need to generate text on the fly. The SDK handles serialization and error parsing automatically. Ensure your environment supports the required Node version for the SDK you are using.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ltxnsfw.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: true in your request. The API returns Server-Sent Events (SSE), allowing you to receive tokens as they are generated. This reduces perceived latency for end-users.
Each chunk contains a partial completion. The final chunk includes token usage statistics, which are used to calculate your prepaid credit deduction. Streaming is efficient for long-form content generation or interactive chat interfaces.
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 & Context Window
Your API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. The context window is 100,000 tokens total (input + output). There is no separate output cap per request, and if max_tokens is not set, the response can run to the end of the window.
Common errors include 401 (invalid key), 402 (insufficient credit), and 429 (rate limit). Credit is charged only for successful token generation; errors do not consume funds. Prepaid credit never expires, so you can top up via crypto (USDT TRC20 or USDC Base) at any time.
API specifications
If your tool speaks the OpenAI API, these are the details that matter.
| Parameter | Details |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Base URL | https://api.ltxnsfw.cc/v1 |
| Model | uncensored |
| API key | Authorization: Bearer YOUR_KEY |
| Structured output | response_format: {"type": "json_object"} |
| Context window | 100,000 tokens (prompt + completion together) |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Request size | 8 MB request body |
| Concurrency | up to 8 in parallel per key |
| Requests per minute | 300 requests per minute per key |
| Credit expiry | no monthly fee; paid credit does not expire |
| Trial credit | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Keys | one active key per account; a new key replaces the old one |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
| Account | Google or e-mail and password |
HTTP errors
Every error is JSON with a type you can switch on. You are never charged for an error.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | balance is empty — top up, requests resume at once |
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
Is this an official OpenAI service?
No, we are an independent service offering an open-weight uncensored model. Our API is compatible with the OpenAI format, so you can use their SDKs, but we do not serve GPT models.
How is billing calculated?
You pay $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credit is charged only for successful completions; errors and refusals are free. Prepaid credit never expires.
What payment methods are accepted?
We accept crypto only: USDT (TRC20) or USDC (Base). Minimum top-up is $20. No cards, PayPal, or bank transfers are supported. New accounts receive $0.50 in trial credit.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Get API key