ro ▾
Claim trial key

Quickstart: Integrate the uncensored model

Drop this uncensored model into your existing stack. The API behaves exactly like OpenAI, so you swap keys and URLs without rewriting logic.

Prerequisites: Python SDK or cURL

Start with the official openai Python package or plain cURL. Both work out of the box. You need Python 3.8+ installed on your machine. Run pip install openai to get the library. cURL requires no setup at all. You can test immediately in your terminal. Use pip for production scripts. Use cURL for quick debugging sessions. The choice depends on your workflow. We support both equally.

Set your base URL and key

Point your client to our specific endpoint. Use https://api.ollamansfwmodel.com/v1 as your base URL. Set your API key in the standard Authorization header. Pass the key as Bearer YOUR_API_KEY. The model ID is simply uncensored. Do not use the default OpenAI URL. Your existing code will route requests correctly now. Authentication is standard OAuth-style bearer tokens.

Send your first request

Make a POST request to /v1/chat/completions. Include your system prompt and user messages. The model responds with text content directly. There are no extra formatting steps required. You can send short queries or long contexts. The model handles both efficiently. Use this endpoint for all text generation tasks.

Use Python and Node SDKs

Initialize the client with your base URL and key. Call chat.completions.create() with the model name. The response contains the generated text in choices[0].message.content. Node.js users follow the same pattern. Both SDKs handle retries and parsing automatically. You do not need to manage HTTP connections manually. Just import the library and configure it.

Handle streaming responses

Enable streaming by setting stream=True. The API returns data in chunks as tokens are generated. Process each chunk as it arrives. This reduces perceived latency for users. The final chunk contains the total token usage. You can stop streaming early if needed. Real-time applications benefit from this approach. It keeps the connection open until completion.

Use function calling and JSON mode

Define tools in your request payload. The model can return structured data or tool calls. Use response_format: {"type": "json_object"} for strict JSON output. This ensures your parser receives valid syntax. Function calling allows external integrations. The model understands tool definitions and arguments. Set temperature lower for deterministic JSON. Higher temperatures work better for creative tool usage.

cURL

curl https://api.ollamansfwmodel.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Send me to location 51.4072 N 0.0918 W now"}]
  }'

Python

from openai import OpenAI

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

What is the context window for this API?

The model supports a 100,000 token context window. This includes both the prompt and the completion. You can send long documents or conversation histories. The maximum output per request is 16,000 tokens. If you do not set <code>max_tokens</code>, it defaults to 2,048 tokens. Adjust this parameter based on your needs.

How do I handle rate limits and errors?

You are limited to 300 requests per minute per key. If you exceed this, you receive a 429 error. Increase your retry logic with exponential backoff. A 401 error means your API key is invalid. A 402 error indicates insufficient prepaid credit. Check your account balance if you see 402 errors. Each key has a limit of 8 concurrent requests.

Is this the same as the local ollama NSFW model?

No, this is a hosted API service. You do not need to manage GPU resources or model downloads. The hosted version scales automatically under load. Local setups require your own hardware and maintenance. This API offers consistent uptime and performance. Use local models for privacy, this API for scale.

Get your API key

Register, copy the token, update your base URL. That is all you need to configure.

Claim trial key