da ▾
Open account

Quickstart: Integrate the NSFW LLM API

Integrate our uncensored LLM API in minutes using standard OpenAI-compatible tools. This quickstart guides you from API key generation to handling streaming responses and token limits.

Prerequisites: SDKs and Base URL

Start by installing your preferred SDK and configuring the base URL. Our API endpoint is HTTPS://api.nsfwllmmodel.com/v1. This URL works with any OpenAI-compatible client. You need an API key from your dashboard. Generate it on the Get API key page. Use Google or email login. No phone number is required. The key appears immediately. Store it securely. Do not share it publicly. Configure your SDK client to point to this base URL. Pass your key in the Authorization header. This setup ensures compatibility with standard libraries. You are ready to send requests.

Authentication: Setting the API Key

Pass your API key in the Authorization header. Use the Bearer scheme. This authenticates your requests. The API validates the key on every call. If the key is invalid, you receive a 401 error. If you have no credit, you get a 402 error. Ensure your key is current. One active key per account. A new key replaces the old one. Keep your key safe. This simple header structure works across all supported languages. It eliminates complex auth flows. You can start sending requests immediately after setting this header.

Sending Your First Request

Send a POST request to /v1/chat/completions. Use the model id uncensored. This model does not refuse lawful adult content. Include your messages array. Specify the role as user or assistant. The API returns generated text. Here is a curl example to get started:

curl https://api.nsfwllmmodel.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate a JSON object with user login status fields"}]
  }'

This request sends a simple prompt. The response contains the generated text. Check the output for accuracy. The model handles various NSFW topics well. It is suitable for text generation tasks. You can adjust parameters like temperature. Higher values increase randomness. Lower values make output more deterministic. Experiment to find the right balance for your use case.

Handling Streaming Responses

Enable streaming by setting stream: true. The API sends responses as a stream of tokens. This allows real-time display of output. The final chunk includes token usage details. Streaming is useful for chat interfaces. It reduces perceived latency. Users see text as it generates. This improves the user experience significantly. Configure your SDK to handle stream events. Process each token as it arrives. Handle errors gracefully. The API supports SSE for streaming. This is a standard feature in our API.

Using Function Calling and JSON Mode

Our API supports function calling and JSON mode. Use response_format set to json_object for structured output. This is useful for parsing data. You can also define tools for function calling. The model adheres to the specified schema. This enables integration with external systems. Use this for extracting entities or generating structured data. It works well for NSFW content tagging. Ensure your prompts clearly describe the expected format. This increases reliability. The model is trained to follow instructions precisely. This makes it suitable for automated pipelines.

Understanding Token Limits and Pricing

The context window is 100,000 tokens. This includes prompt and completion. Max output is 16,000 tokens per request. Default is 2,048 tokens if max_tokens is not set. Pricing is $0.15 per 1M input tokens. Output tokens cost $0.50 per 1M. Errors are free. Credit never expires. You pay by real usage. No monthly fees. Limits are 300 requests per minute. Max 8 concurrent requests. Request body max 8 MB. These limits ensure fair usage. They prevent abuse. Monitor your usage via the dashboard. Top up with crypto. USDT or USDC. Bonus credit available. This pricing model is transparent and predictable.

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwllmmodel.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

import OpenAI from "openai";

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

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)

Common questions

How do I get started with the NSFW LLM API?

Sign up with Google or email to get an API key instantly. No phone number is needed. Use the base URL HTTPS://api.nsfwllmmodel.com/v1 with any OpenAI-compatible SDK to send your first request.

What is the context window and token limit?

The context window is 100,000 tokens for prompt and completion combined. The maximum output per request is 16,000 tokens. If you do not specify <code>max_tokens</code>, the default is 2,048 tokens.

How does streaming work in this API?

Set <code>stream: true</code> to receive token-by-token updates via SSE. The final chunk contains the total token usage. This allows real-time display of generated text, which is ideal for chat interfaces.

Get your API key instantly

Register, retrieve your key, and point to the new base URL. That’s the entire configuration.