Quickstart: Connect Your Client
Start sending requests immediately using our base URL. Replace YOUR_API_KEY with the key from your dashboard. Our API uses standard headers for authentication.
- Base URL:
https://api.nsfwollama.com/v1 - Model ID:
uncensored
curl https://api.nsfwollama.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Summarize this log file"}]
}'
Endpoint: /v1/chat/completions
Send messages to generate text. POST to /v1/chat/completions with your model ID and messages array. The context window supports 100,000 tokens total. This includes both prompt and completion tokens combined.
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwollama.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)
Endpoint: /v1/models
Discover available models. GET /v1/models to list endpoints. Our API serves one large language model optimized for uncensored responses. It does not support embeddings or image generation. Check the model list to confirm availability.
Parameters: Temperature, Top P, and More
Control generation style with standard parameters. Set temperature for creativity. Adjust top_p for nucleus sampling. Use response_format with json_object for structured output. You can also set seed for reproducibility. These parameters work exactly like the OpenAI SDK.
Streaming Responses & Token Usage
Receive real-time output via Server-Sent Events. Streaming reduces perceived latency for long responses. Token usage details appear in the final chunk. This allows you to track costs accurately. Our API charges only for actual tokens processed. Errors are free.
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)
Error Handling & Limits
Handle standard HTTP errors gracefully. A 401 means your API key is invalid. A 402 indicates insufficient prepaid credit. A 429 signals you have exceeded the 300 requests per minute limit. The maximum request body size is 8 MB. You get 8 concurrent requests per key. Refunds are not issued for credits, but support can fix billing errors.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.nsfwollama.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);