EN ▾
Get your key

Uncensored API, per token.

https://api.tokenllm.cc/v1

API Documentation

This is a quickstart guide for our uncensored LLM token API. Use the standard OpenAI-compatible endpoint to send requests and get text back without content refusals.

Base URL and Authentication

Connect to https://api.tokenllm.cc/v1 using your unique API key. This base URL works with any standard OpenAI SDK by setting the base_url variable. You receive one active key per account; generating a new key replaces the previous one. Authentication relies on the Authorization: Bearer <key> header. We do not track your prompts for training, and you can sign up with Google or email without a phone number. Errors and refusals consume zero tokens, so you only pay for actual inference.

The Chat Completions Endpoint

Send text to POST /v1/chat/completions to generate responses. This endpoint handles text-in, text-out workflows with our uncensored model. You do not need embeddings or image generation for standard chat tasks. The model ID is always "uncensored". Requests are processed on our own servers, ensuring no third-party vendor filters your output. Keep your payload under 8 MB to avoid truncation issues.

Required and Optional Parameters

Include a messages array with your conversation history. Set model to "uncensored" to ensure correct routing. You can adjust temperature for creativity or top_p for diversity. Use max_tokens to cap output at 16,000 tokens, or default to 2,048. The context window supports 100,000 tokens total for prompt and completion. Optional parameters like seed and stop give you precise control over generation.

Streaming Responses via SSE

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) for real-time token delivery. Each chunk contains partial text, and the final chunk includes total token usage statistics. This approach reduces perceived latency for long responses. You can process tokens as they arrive, which is ideal for chat interfaces. Streaming works with all standard parameters.

Function Calling and JSON Mode

Define tools in the tools parameter for function calling capabilities. The model can output structured JSON when you set response_format to {"type": "json_object"}. This ensures reliable parsing for downstream applications. You can specify tool_choice to force or allow automatic selection. These features work within the same uncensored model, so you do not need a separate structured output provider.

Error Handling and Token Usage

Handle HTTP 401 for invalid keys and 429 for rate limits. You are limited to 300 requests per minute and 8 concurrent requests per key. If you get a 402, your prepaid credit is exhausted. Refusals due to content filters (like minor sexual content) do not charge tokens. The API never expires your credit, so you can top up anytime. Always check the response body for detailed error messages.

cURL

curl https://api.tokenllm.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "What is the current price of one llm token"}]
  }'

Python

from openai import OpenAI

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

FAQ

What is the base URL for the API?

Use HTTPS://api.tokenllm.cc/v1 as your base URL. It is fully compatible with standard OpenAI SDK configurations. You only need to update the base_url variable in your client setup.

How do I handle rate limits?

You are allowed 300 requests per minute and 8 concurrent requests per key. If you exceed these limits, you will receive a 429 status code. Implement exponential backoff in your code to handle retries gracefully.

Do I need to set the model ID?

Yes, always set the model parameter to "uncensored". This ensures your request goes to the correct model on our servers. The endpoint expects this specific ID for proper routing and inference.

Get your key instantly

Sign up, grab your API key, and update your base URL. That’s it.

Get your keyView documentation