de ▾

Quickstart: Uncensored LLM API

Connect your existing OpenAI SDK clients to our uncensored API in minutes. The process requires only a base URL update and a single API key, letting you bypass vendor lock-in without changing your code.

Authentication and Base URL

Start by pointing your client to https://api.ollamakey.com/v1 and passing your key in the Authorization header.

Generate your key via Google or email on the dashboard. Each account holds one active key; generating a new one invalidates the old key immediately.

This setup works with any standard OpenAI-compatible library. The header format remains Bearer YOUR_KEY for Python, Node, and other SDKs.

Sending Chat Completions

Send a POST request to /v1/chat/completions with your model and messages.

Use the model ID uncensored for unrestricted responses.

Input tokens cost $0.15 per million, and output tokens cost $0.50 per million.

Errors do not consume credit, so you can test freely.

Streaming Responses

Enable streaming by setting stream: true in your request.

The API returns Server-Sent Events (SSE) for real-time token delivery.

The final chunk contains the total token usage for the request.

This approach is ideal for chat interfaces and long-form generation.

Function Calling and Tools

Define tools in your request to enable function calling.

Set tool_choice to auto or a specific tool ID.

The model returns tool calls in the response format.

Execute the tools client-side and send the results back in subsequent turns.

JSON Mode

Force structured output by setting response_format to {"type": "json_object"}.

The model guarantees valid JSON syntax in the response.

This feature is useful for parsing data or generating configuration files.

Combine it with temperature: 0 for deterministic results.

Error Handling and Limits

Handle HTTP 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits.

The rate limit is 300 requests per minute and 8 concurrent requests per key.

The context window is 100,000 tokens for input and output combined.

Max output per request is 16,000 tokens, or 2,048 if not specified.

cURL

curl https://api.ollamakey.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "List the top five npm packages for date formatting"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.ollamakey.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.ollamakey.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 base URL for the uncensored API?

Use <code>https://api.ollamakey.com/v1</code> as your base URL. This endpoint is compatible with standard OpenAI SDKs.

How do I handle errors when the API key is invalid?

The API returns a 401 status code if the key is invalid. Check your key in the dashboard and regenerate if necessary.

What happens if I exceed the rate limit?

You receive a 429 status code. The limit is 300 requests per minute and 8 concurrent requests per key. Wait and retry.

Get your key in one step

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

Try with trial credit