EN ▾

NSFW llm api quickstart

Integrate our uncensored LLM API into your chatbot pipeline in minutes using standard OpenAI-compatible endpoints. Get your API key, set your base URL, and start sending prompts with zero content refusals for lawful adult content.

Base URL and Authentication

Start by securing your access key on the Get API key page. You can sign in with Google or use an email and password. The interface shows your key immediately. No phone number is required. Copy this key for your environment variables. It authenticates all requests to our infrastructure. Your prompts are not used for training. Privacy is maintained without extra steps. Create a dedicated account for each production service. One active key per account ensures clean billing. If you need a new key, generating one replaces the old. This keeps your credentials simple. Security remains straightforward without complex rotations.

Making Your First Request

Send your first prompt to the chat completions endpoint. Use the standard chat/completions path. Our uncensored model responds without filtering lawful adult content. Set the base URL to our API domain. Pass your key in the authorization header. The model ID is fixed as uncensored. You get text output for text input. No embeddings or image generation here. Check the response for the generated text. Errors return standard HTTP codes. Credit is only used for successful tokens.

curl https://api.apillmnsfw.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate a summary of the latest transformer architecture paper"}]
  }'

Python SDK Integration

Use the official OpenAI Python library for quick integration. Set the base URL to our endpoint. Initialize the client with your API key. Call chat.completions.create with your model. The uncensored model handles your prompts. Streaming is supported via SSE. You can also use JSON mode. Set response_format to {"type": "json_object"}. This ensures structured output for your pipeline. Errors are raised as standard exceptions. Check the usage stats in the response. Debugging becomes trivial with standard libraries.

from openai import OpenAI

client = OpenAI(base_url="https://api.apillmnsfw.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.js Client Setup

Integrate with Node.js using the standard SDK. Configure the base URL for our API. Pass your key during initialization. Request completions from the uncensored model. The interface matches OpenAI exactly. You can stream responses easily. Use async/await for clean code. Handle errors with try/catch blocks. The model supports function calling. Define tools in your request body. Parse the tool calls in your code. This fits into existing Node workflows. No custom adapters are needed. Your code stays standard and portable.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apillmnsfw.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

Stream tokens for lower latency in chat apps. Set stream to true in your request. The API returns Server-Sent Events (SSE). Each chunk contains partial text. Token usage details appear in the final chunk. This allows real-time user updates. You can cancel streams if needed. The uncensored model supports this feature. It works with all standard SDKs. Handle stream events in your loop. Display text as it arrives. This improves perceived performance significantly. Users see answers faster. Error handling remains consistent across modes.

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

Our API enforces clear operational limits. You get 300 requests per minute per key. Concurrency is capped at 8 simultaneous requests. Request bodies must stay under 8 MB. The context window spans 100,000 tokens total. Max output is 16,000 tokens per request. Errors return standard codes like 401 or 429. A 402 error means your credit is low. Refusals for minor content are free. Credit never expires for prepaid accounts. Streaming works without extra cost. Monitor your usage in the dashboard. Limits ensure stable performance for all users.

Frequently asked questions

What is the NSFW LLM API context window size?

The context window is 100,000 tokens, counting both the prompt and the completion together. You can request up to 16,000 tokens of output per call. If you do not set max_tokens, the limit defaults to 2,048 tokens. This allows long conversations or large document processing.

Does the API support function calling and JSON mode?

Yes, the API supports both function calling and JSON mode. You can define tools in your request and set response_format to json_object. This enables structured outputs and tool use in your chatbot pipeline. The model handles these features natively.

What happens if I get a 402 error?

A 402 error indicates that your prepaid credit is insufficient. You must top up via crypto to continue using the API. Errors and refusals do not consume credit, so you only pay for valid tokens. Your credit never expires, so you can top up whenever needed.

Get your API key in seconds

Sign up, copy the token, update your endpoint. That is all you need to do.

Start now