EN ▾
NSFW Search APIGet API key

Uncensored LLM API. Pay per token.

NSFW Search: Uncensored LLM API Quickstart

Get started with the uncensored LLM API by authenticating with your key and sending text requests. This quickstart covers the essential endpoints, streaming, JSON mode, and limits for building reliable NSFW-tolerant applications.

Authentication and Base URL

Our API follows the standard OpenAI chat-completions interface. You authenticate using an API key passed in the Authorization header. You can generate a key immediately by signing up with Google or an email address on the Get API key page. Once created, the key is displayed once, so save it securely.

The base URL for all requests is https://api.nsfwsearch.top/v1. You can use this with any OpenAI-compatible SDK by setting the base URL configuration. The only model ID you need to specify is uncensored, which runs our own tuned open-weight model optimized for high-volume text generation without content refusals.

There are no monthly fees or subscriptions. You pay strictly per token, with credits that never expire. If you encounter issues, contact support directly.

Sending Your First Request

To test the API, send a simple POST request to the /v1/chat/completions endpoint. The model will return text output based on your prompt. Ensure your request body includes the model field set to uncensored and a messages array with your user input.

The API accepts standard parameters like temperature and top_p to control creativity. For most use cases, you do not need to set these; defaults work well for general uncensored generation. Remember that errors and refusals do not consume your token credits, so you can retry failed requests safely.

Below is a basic example using curl to send a prompt and receive a completion.

curl https://api.nsfwsearch.top/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

Using the official OpenAI Python SDK is the most straightforward way to integrate our API. Set the base_url to our endpoint and provide your API key. The SDK handles serialization and response parsing automatically.

Since our API is strictly text-in, text-out, you can use the same code structure you would for GPT-4 or other standard models. Just ensure you are using the latest version of the SDK for best compatibility. The model parameter should always be set to uncensored.

This approach works for both synchronous and asynchronous applications. If you need to handle large volumes of requests, consider using async methods to improve throughput without hitting rate limits immediately.

Here is how you can initialize the client and make a request in Python.

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwsearch.top/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 SDK Usage

For JavaScript and TypeScript developers, the OpenAI Node.js SDK works seamlessly with our base URL. Configure the client with your API key and the custom base URL provided above.

Node.js developers often need to handle streams for long-running responses. Our API supports streaming via Server-Sent Events (SSE), which allows you to receive tokens in real-time. This is crucial for chat applications where users expect immediate feedback.

Make sure to handle errors appropriately. If your credit balance is insufficient, you will receive a 402 error. If your API key is invalid, you will get a 401. Check the Pricing page to top up your credits using crypto.

See the example below for a standard Node.js request.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.nsfwsearch.top/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 the stream parameter to true in your request. The API will return a sequence of Server-Sent Events (SSE) instead of a single JSON response. Each event contains a partial token, allowing your application to render text progressively.

The final chunk in the stream contains the full token usage statistics for the request. This is important for tracking your credit consumption accurately. Streaming does not change the pricing; you still pay per input and output token.

This feature is ideal for chat interfaces, real-time data processing, or any application where latency matters more than waiting for the full completion. It also allows you to cancel requests early if the user changes their input, potentially saving tokens.

Here is an example of handling a stream in your client.

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)

JSON Mode, Tools, and Limits

Our API supports structured output and function calling. Set response_format to {"type": "json_object"} to force JSON output, which is useful for data extraction or programmatic workflows. You can also use the tools parameter for function calling, allowing the model to invoke specific functions based on your prompt.

Be aware of the hard limits: 300 requests per minute per key, 8 concurrent requests, and an 8 MB request body limit. The context window is 100,000 tokens, with no separate output cap. If you do not specify max_tokens, the response can run to the end of the window.

Content filtering is minimal but not absent: we strictly block sexual content involving minors. All other lawful adult, fictional, or controversial topics are allowed. This makes our API a reliable choice for NSFW-tolerant applications without the overhead of multimodal features you might not need.

What the API supports

Before you integrate, here is exactly what you get with a key.

ParameterDetails
API formatOpenAI Chat Completions schema; official openai SDKs work unchanged
AuthenticationAuthorization: Bearer YOUR_KEY
Modeluncensored
Base URLhttps://api.nsfwsearch.top/v1
MethodsPOST /v1/chat/completions · GET /v1/models
StreamingYes — server-sent events; the last chunk carries token usage
Max context100,000 tokens, input and output combined
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Completion lengthprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Structured outputresponse_format: {"type": "json_object"}
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Rate limit300 requests per minute per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Parallel requests8 requests at the same time per key
Max body8 MB request body
Bonus credit+5% from $50, +10% from $100, +15% from $200
Paymentcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
How you payprepaid credit, charged by real token usage; errors and refusals are free
Credit expirypaid credit never expires, no subscription
Free trial$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Content policyuncensored for adults; the only hard rule: no sexual content involving minors
Keysone active key per account; a new key replaces the old one
Sign-insign in with Google or with e-mail + password

HTTP errors

Errors come back as JSON with a stable type; failed and refused requests are not billed.

StatusTypeReason
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busymodel busy — retry in a few seconds

Questions and answers

Do errors or refusals consume my credit?

No. Errors and refusals are free, so you can retry failed requests without losing tokens. You only pay for successful token generation.

How do I top up my credits?

You can top up using crypto only (USDT on TRC20 or USDC on Base). Amounts range from $20 to $500, with bonus credits for larger deposits. We do not accept cards or PayPal.

What is the context window size?

The total context window is 100,000 tokens for both prompt and completion. There is no separate output cap, and if you do not set the max_tokens parameter, the response can run to the end of the window.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.