繁中 ▾
Uncensored LLM API, prepaid tokens, crypto onlyhttps://api.apipricing.cc/v1

Uncensored API integration guide

This guide explains how to integrate the uncensored chat-completions API with zero code changes using standard OpenAI-compatible clients.

https://api.apipricing.cc/v1

Prerequisites and model ID

Start by generating your API key via the Get API key page, which supports Google sign-in or email and password. You will send requests to the base URL https://api.apipricing.cc/v1 using the model identifier uncensored. This model supports a 100,000-token context window and does not require embeddings or fine-tuning endpoints.

Authentication with your API key

Pass your key in the Authorization header as a bearer token for every request. The API returns a 401 error if the key is invalid or expired. Your single active key replaces any previous key immediately upon generation, so ensure you update your client configuration when rotating keys.

Sending your first chat completion request

Use a standard POST request to /v1/chat/completions with your system and user messages. The model processes text input and returns text output, supporting JSON mode and function calling. Ensure you include the correct model ID and your API key in the header.

Handling streaming responses and token counts

Enable streaming by setting the stream parameter to true. The API returns server-sent events (SSE) containing partial tokens. You can track token usage by inspecting the final chunk, which includes the total input and output tokens for the request.

Using the Python SDK

Install the official OpenAI package and configure the base URL to point to our service. This allows you to use familiar methods like chat.completions.create without modifying your application logic significantly. The SDK handles the HTTP communication and JSON parsing automatically.

Using the Node SDK and error handling

Initialize the client with your API key and the custom base URL. You will encounter 402 errors if your prepaid credit is exhausted or 429 errors if you exceed 300 requests per minute. Always handle these errors gracefully by checking the response status code and adjusting your retry logic accordingly.

cURL

curl https://api.apipricing.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Calculate total cost for 10 million tokens"}]
  }'

Python

from openai import OpenAI

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

Frequently asked questions

How does the API pricing work for errors?

You are charged only for tokens consumed in successful responses. Errors and refusals are free, meaning you do not pay for tokens processed when the request fails or returns an error status code.

Can I use the uncensored AI API with existing OpenAI clients?

Yes, the interface is fully OpenAI-compatible. You only need to update the base URL and API key in your client configuration. This allows you to integrate the model with zero code changes to your existing application logic.

What is the context window limit?

The model supports a 100,000-token context window, which includes both the prompt and the completion. The maximum output per request is 16,000 tokens, or 2,048 tokens if you do not specify the <code>max_tokens</code> parameter.

Get your API key

Sign up, grab the key, and update your base URL. Done.

Claim trial key