Quickstart for Ltx NSFW pipelines
Get started with the uncensored text completion API in seconds. Use the OpenAI-compatible endpoint to send prompts and receive text outputs for your pipeline scripts.
Base URL and Authentication
Start by pointing your client to https://api.ltxnsfw.com/v1. The interface follows the standard OpenAI chat-completions contract, so you only need to adjust the base URL and provide your API key in the Authorization header. Create a key on the Get API key page using Google or email. Keep your key secure; there is one active key per account, and generating a new one replaces the old.
First Request
Send a standard POST /v1/chat/completions request with the model ID uncensored. The model is open-weight and tuned for lawful adult use without standard refusals. Send your prompt in the messages array. The response contains the generated text in choices[0].message.content.
curl https://api.ltxnsfw.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."}]
}'This returns the raw text response, ready for your post-processing or script pipeline.
Python SDK Integration
Use the official OpenAI Python SDK for clean integration. Initialize the client with your base URL and API key. Call chat.completions.create with the uncensored model. This is ideal for generating video scripts or captions in Python-based workflows.
from openai import OpenAI
client = OpenAI(base_url="https://api.ltxnsfw.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)The library handles JSON serialization automatically. You can access the generated text directly from the response object.
Node SDK Integration
For JavaScript or TypeScript pipelines, use the OpenAI Node SDK. Configure the basePath to our API URL. Pass the uncensored model ID to the completions endpoint. This works well for Node.js-based image or video generation tools that need text prompts.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ltxnsfw.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);The response structure matches the standard OpenAI format, making it easy to drop into existing codebases.
Streaming Responses
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE). Each chunk contains a partial text update. Token usage details are included in the final chunk. This is useful for real-time UI updates or progressive text generation.
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)Process each chunk as it arrives. The final chunk contains the complete usage statistics.
Limits, Errors, and Context
The context window is 100,000 tokens total. There is no separate output cap (if not set, the response can run to the end of the window). Rate limit is 300 requests per minute. Errors include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Requests exceeding body size (8 MB) are rejected. Errors do not consume credit.
API facts in one table
A quick checklist for developers: format, limits, features, billing.
| Feature | Support |
|---|---|
| Protocol | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Authentication | Authorization: Bearer YOUR_KEY |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Base URL | https://api.ltxnsfw.com/v1 |
| Model ID | uncensored |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| Completion length | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Context window | 100,000 tokens (prompt + completion together) |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Structured output | response_format: {"type": "json_object"} |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Request size | up to 8 MB per request |
| Parallel requests | up to 8 in parallel per key |
| Rate limit | 300 requests per minute per key |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| 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 |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Credit expiry | no monthly fee; paid credit does not expire |
| Sign-in | sign in with Google or with e-mail + password |
| Key management | one key per account, regenerate any time (the old one stops working) |
| Content policy | adult content allowed; sexual content involving minors is refused |
Errors and what to do
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| HTTP | Type | What to do |
|---|---|---|
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 | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | temporary overload, retry shortly |
Questions and answers
Does this API generate images or video?
No. This is a text-only chat-completions API. It generates text prompts, scripts, or captions. You need a separate media generation service for images or video.
How do I pay for credits?
You can top up using crypto: USDT (TRC20) or USDC (Base). Payments are between $20 and $500. Credit never expires and errors are free.
Is the model uncensored?
Yes, the uncensored model does not refuse lawful adult, fictional, or controversial topics. It blocks only sexual content involving minors.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
No subscription. Prepaid credit never expires.