Opensfw API Quickstart Guide
Get your uncensored model running with our OpenAI-compatible API. Send text, get responses, and track your prepaid credits without subscription locks.
Authentication and Base URL
Start by generating your key on the dashboard. Use the https://api.opensfw.com/v1 base URL and set your API key in the Authorization header. This setup works with any standard OpenAI SDK client.
Making your first chat completion request
Send a POST request to /v1/chat/completions with your model ID and messages. The uncensored model processes your input and returns the generated text. Use the curl example below to verify connectivity.
curl https://api.opensfw.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What is the current release version of the model?"}]
}'
Streaming responses and token usage
Enable streaming by setting stream: true in your request. You receive chunks of text as they generate. The final chunk contains the complete token usage statistics for billing. Use the Python example to handle the stream.
from openai import OpenAI
client = OpenAI(base_url="https://api.opensfw.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)
Function calling and JSON mode
Define tools in your request for structured outputs. Use response_format: {"type": "json_object"} for strict JSON responses. This works seamlessly with standard function calling parameters.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.opensfw.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);
Handling errors and rate limits
Check for 401 if your key is invalid, 402 for insufficient credit, and 429 for rate limits. You get 300 requests per minute and 8 concurrent requests per key. Errors do not consume tokens.
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)
Understanding context windows and limits
The uncensored model supports a 100,000 token context window. Max output is 16,000 tokens per request. Keep your request body under 8 MB. This ensures consistent performance for large inputs.
Common questions
What is the opensfw API pricing?
You pay $0.15 per 1M input tokens and $0.50 per 1M output tokens. Prepaid credit is charged by real usage, and errors are free. Credit never expires.
How do I pay for the uncensored LLM API?
Top up with crypto only: USDT (TRC20) or USDC (Base). Minimum $20, maximum $500. You get bonus credit for larger deposits, like +15% for $200.
Is this an uncensored AI model?
Yes. The model does not refuse lawful adult, fictional, or controversial topics. It only blocks sexual content involving minors. It is not GPT or Claude.
Get your API key
Register, copy your key, update the base URL. That is all you need to do.