EN ▾
Get API key

Switch your client in three lines

Get started with the Ollama NSFW uncensored API in minutes using standard OpenAI-compatible clients. This quickstart covers authentication, basic requests, and streaming for your text generation workflows.

Base URL & Auth

Our API is fully OpenAI-compatible, meaning you likely already have the client code you need. You only need to adjust the base URL and provide your API key. Sign up on the Get API key page using Google or email to receive your key instantly. No phone number or credit card is required for the trial. Use https://api.ollamansfw.top/v1 as your base URL and pass your key in the Authorization header. This setup works with any standard OpenAI SDK or HTTP client, giving you direct control over your prompts without vendor lock-in.

Basic Completion

Send a simple POST request to /v1/chat/completions to generate text. The model ID is uncensored. This endpoint handles standard text-in, text-out interactions. You can specify the system prompt to guide the model's behavior. Since this is an uncensored model, it will answer directly without unnecessary refusals for lawful content. Remember that errors and refusals do not consume your prepaid credit.

Python SDK Integration

Using the official openai Python library makes integration trivial. Initialize the client with your custom base URL and key. Set the model to uncensored. This approach lets you leverage familiar Python patterns for your content generation tasks. You can easily handle responses and iterate on your prompts. The SDK handles the JSON serialization and HTTP details for you.

Node SDK Usage

For JavaScript or TypeScript projects, the openai Node package works identically. Configure the base URL and API key just like in Python. This allows frontend developers or Node backends to generate content directly. The streaming and JSON modes are equally accessible. This flexibility is key for developers who want a privacy focused api that integrates into existing codebases without major refactoring.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream. Each chunk contains partial text, allowing you to display output in real-time. Token usage details are included in the final chunk. This is essential for chat interfaces where latency matters. The streaming api behavior matches standard OpenAI expectations, so your existing stream handlers should work with minimal changes.

Limits, Errors & Context

Your context window is 100,000 tokens total (prompt + completion). There is no separate output cap, and if unspecified, the response can run to the end of the window. Limits are 300 requests per minute and 8 concurrent requests per key. Common errors include 401 (invalid key), 402 (insufficient credit), and 429 (rate limit). Errors are free, so you won't be charged for failed requests. Keep your request body under 8 MB. These constraints ensure stable performance for your text generation api workflows.

cURL

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

from openai import OpenAI

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

import OpenAI from "openai";

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

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)

Under the hood: specs

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

FeatureSupport
CompatibilityOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
Base URLhttps://api.ollamansfw.top/v1
MethodsPOST /v1/chat/completions · GET /v1/models
API keyBearer token in the Authorization header
Modeluncensored
StreamingSupported (stream: true), usage included at the end
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Function callingSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Max context100,000 tokens (prompt + completion together)
Completion lengthprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Structured outputresponse_format: {"type": "json_object"}
Max body8 MB request body
Requests per minute300/min per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Parallel requestsup to 8 in parallel per key
Billingpay as you go from prepaid credit; nothing is charged for failed or refused requests
Credit expirypaid credit never expires, no subscription
Volume bonus+5% on $50+, +10% on $100+, +15% on $200+
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
Token prices$0.15 per 1M input tokens · $0.50 per 1M output tokens
PaymentUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Contentuncensored for adults; the only hard rule: no sexual content involving minors
Sign-inGoogle or e-mail and password
Key managementone key per account, regenerate any time (the old one stops working)

HTTP errors

The type field is stable, the message is for humans. Errors cost nothing.

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_blockedsexual content involving minors — refused, not billed
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_busytemporary overload, retry shortly

Questions and answers

Do I need to install a special SDK?

No, you can use any standard OpenAI-compatible SDK. The official Python and Node libraries work perfectly by simply updating the base URL. You can also use raw HTTP requests if you prefer.

How does billing work for errors?

You are only charged for successful token usage. If you get a 429 rate limit or 400 bad request, you are not charged. This means you can experiment freely without worrying about unexpected costs for failed attempts.

Is the model trained on my data?

No, prompts are not used for training. Your data remains yours. We offer a straightforward prepaid credit model with no monthly subscriptions, ensuring you retain full control over your content and usage.

Your key is one form away

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