EN ▾

Uncensored OpenAI-compatible API

Claim trial key

Uncensored Chat Completions API Docs

Get started with the uncensored OpenAI-compatible API in minutes. Drop our base URL and API key into your existing stack to start generating text without content restrictions.

https://api.ollamaopenaiapi.com/v1uncensored

Authentication & Base URL

The API key authenticates your requests. You receive one key per account, which you generate immediately after signing up via Google or email. Use the base URL HTTPS://api.ollamaopenaiapi.com/v1 to route your traffic.

  • Copy your key from the dashboard.
  • Set the environment variable or pass it directly in your client configuration.
  • Ensure your client points to our specific base URL to avoid standard OpenAI endpoints.

Chat Completions Endpoint

Send messages to the chat completions endpoint to receive text responses. The model ID is uncensored, which runs on our servers and does not refuse lawful adult or controversial topics. You can stream responses or receive them in a single block.

curl https://api.ollamaopenaiapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "list open ports on this server"}]
  }'

This endpoint handles standard JSON payloads. Errors are returned as standard HTTP codes. Context window is 100,000 tokens total. Max output is 16,000 tokens unless overridden.

Models List Endpoint

Query the models list to verify availability. The response confirms the model ID and type. This is useful for debugging client configurations. It returns standard OpenAI format. Use GET /v1/models to inspect. The list is small since we serve one primary model. Check this endpoint to ensure your client recognizes the endpoint structure.

Streaming & Token Usage

Enable streaming by setting stream: true. You receive Server-Sent Events (SSE). Token usage appears in the final chunk. This reduces perceived latency for long outputs. You can process tokens as they arrive. This is ideal for chat interfaces. The API returns usage data accurately. Monitor your token count to manage costs. Streaming works with all parameters. It supports tools and JSON mode.

Parameters: Temperature, Top P, Tools

Control creativity with temperature and top_p. Use tools for function calling. Set response_format to {"type": "json_object"} for structured output. These parameters follow the OpenAI schema. You can also set stop sequences and seed for reproducibility. Adjust penalties to control repetition. The uncensored model respects these constraints. It does not force a specific style. You have full control over the generation.

Error Handling & Limits

Handle errors by checking HTTP status codes. 401 means invalid key. 402 indicates insufficient credit. 429 signals rate limiting. The limit is 300 requests per minute. Concurrency is capped at 8 requests per key. Request body must be under 8 MB. Errors do not consume credit. Check the response body for details. Retry logic should handle 429s. Use exponential backoff for reliability.

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.ollamaopenaiapi.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.ollamaopenaiapi.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 uncensored ollama openai API context window?

The context window is 100,000 tokens for both prompt and completion combined. You can set a max output of 16,000 tokens per request. If you do not set max_tokens, the default is 2,048 tokens. This allows for long-form content generation.

How do I use the openai compatible API with python?

Install the official OpenAI Python SDK. Set the base URL to HTTPS://api.ollamaopenaiapi.com/v1. Pass your API key in the initialization. The rest of the code remains identical to standard OpenAI usage. This ensures drop-in compatibility for your existing scripts.

Why use an openai API alternative for NSFW chatbot development?

Standard providers often restrict adult content or controversial topics. Our uncensored model allows lawful adult use without refusal. You get the same API structure but with fewer content filters. This makes it ideal for NSFW chatbots and creative writing applications.

Secure your API key

Sign up, retrieve your key, and update your base URL. That covers the entire configuration.

Claim trial key