EN ▾
Uncensored ModelsGet your key

Uncensored API Quickstart Guide

Connect your client to our hosted, OpenAI-compatible API using the base URL and your API key. This guide covers the essential endpoints, streaming, and parameters for rapid integration.

Authentication and Base URL

Start by pointing your SDK to our base URL and passing your key in the authorization header. We provide a direct, single-model service without proxy routing fees. Use the standard Authorization: Bearer scheme to authenticate requests. Your key is generated immediately after signup via Google or email. Ensure you replace the placeholder key in your client configuration with the one displayed on your dashboard. The base URL is https://api.uncensoredmodelsollama.com/v1. This endpoint supports standard OpenAI-compatible clients, allowing you to switch providers without rewriting your application logic. Keep your key secure, as it grants access to your prepaid credit balance.

Chat Completions Endpoint

Send text requests to the /v1/chat/completions endpoint to generate responses. This endpoint handles standard conversation histories and system prompts. You must specify the model ID as uncensored in the request body. The API returns JSON formatted responses containing the generated text and token usage statistics. Errors such as insufficient credit or invalid keys are returned with appropriate HTTP status codes. Use this endpoint for all standard text generation tasks. It does not support embeddings, images, or fine-tuning. Keep your payload under 8 MB to ensure reliable processing. The model processes input and output tokens within a shared context window.

Streaming Responses

Enable streaming by setting the stream parameter to true in your request. The API returns Server-Sent Events (SSE) containing incremental chunks of text. This approach reduces perceived latency for users waiting for long outputs. You receive token usage information in the final chunk of the stream. Implement a stream handler in your client to process these events efficiently. Streaming is ideal for chat interfaces and real-time applications. Ensure your client library supports SSE parsing to handle the continuous data flow correctly. The total context window remains 100,000 tokens regardless of streaming mode.

Function Calling and JSON Mode

Use the tools parameter to enable function calling capabilities. Define your functions in the request body to allow the model to return structured data. Set response_format to {"type": "json_object"} for strict JSON output. This feature is useful for extracting data or generating structured payloads. The model supports tool choice parameters to control function invocation behavior. Use these features to integrate the API into automated workflows. Ensure your function definitions match the expected input schema for reliable results. The API returns tool calls in the standard OpenAI format for easy parsing.

Parameters and Rate Limits

Adjust generation behavior using parameters like temperature, top_p, and seed. Set max_tokens to limit output length, defaulting to 2,048 if unspecified. The API enforces a rate limit of 300 requests per minute per key. Concurrent requests are capped at 8 per key. If you exceed these limits, the API returns a 429 status code. Requests are charged based on actual token usage, with errors and refusals being free. Credit never expires, and prepaid amounts are transparent. Manage your keys carefully, as each account supports only one active key at a time.

Limits, Errors, and Context

The context window supports 100,000 tokens for combined input and output. Requests exceeding the 8 MB body limit will fail. Common errors include 401 for invalid keys and 402 for insufficient credit. Handle these errors gracefully in your application logic. The API refuses requests containing sexual content involving minors, regardless of other settings. Other content remains uncensored for lawful adult use. Monitor your token usage to avoid unexpected charges. The prepaid credit system ensures you pay only for what you use. No subscription fees or hidden costs apply to your integration.

cURL

curl https://api.uncensoredmodelsollama.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "List all available models in the ollama library."}]
  }'

Python

from openai import OpenAI

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

Frequently asked questions

What is the uncensored models ollama base URL?

The base URL is HTTPS://api.uncensoredmodelsollama.com/v1. Use this endpoint with any OpenAI-compatible SDK by updating the base_url configuration. This URL serves the single uncensored model directly without proxy routing.

How do I handle streaming responses in Python?

Set the stream parameter to true in your request. The API returns Server-Sent Events containing incremental text chunks. Process these events using your SDK's stream handler to display real-time output. Token usage data is provided in the final chunk of the stream.

What happens if I exceed the rate limit?

The API returns a 429 status code when you exceed 300 requests per minute or 8 concurrent requests. Your key remains active, but further requests will fail until the rate window resets. Monitor your usage to avoid interruptions in your application's workflow.

Get your key in one step

Register, copy the key, update your base URL. Done.

Get your key