EN ▾

Integrate the Uncensored API

Drop the official OpenAI SDK into your project and point it at our uncensored LLM API. This quickstart guides you through authentication, first requests, streaming, and error handling with zero configuration drift.

Install the official OpenAI SDK

Start by adding the standard library to your environment. This ensures you are using the same client code that works with other providers.

  • Run pip install openai for Python.
  • Run npm install openai for Node.js.

These packages handle the HTTP logic so you can focus on prompts. You do not need a custom client or a separate routing layer. The SDK manages retries and JSON serialization automatically.

Configure your base URL and key

Point the SDK to our server by overriding the default base URL. Use the key generated on your dashboard and set the model ID to uncensored.

  • Base URL: https://api.pricingkeyapiopenai.com/v1
  • Model: uncensored

This configuration works with any OpenAI-compatible client. You can keep your existing code structure and just swap the endpoint. No subscription lock applies here.

Here is how to set up the client in Python:

from openai import OpenAI

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

Send your first chat completion

Make a standard POST request to the chat completions endpoint. Send your system and user messages in the required JSON format. The API returns a text response that ignores standard content filters for lawful adult topics.

Test the connection with a simple prompt to verify latency and token usage. If you get a response, your integration is working correctly.

Example request structure:

curl https://api.pricingkeyapiopenai.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Convert this curl request to Python using standard libraries"}]
  }'

Enable streaming for real-time tokens

Set stream to true to receive tokens as they are generated. This is essential for chat interfaces and real-time applications. The SDK yields chunks as they arrive from the server.

Each chunk contains the delta of the response. You can concatenate these deltas to build the final text. Streaming reduces perceived latency significantly for long outputs.

Enable streaming in your Node.js client:

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.pricingkeyapiopenai.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);

Use JSON mode and function calling

Request structured output by setting response_format to {"type": "json_object"}. This forces the model to return valid JSON instead of plain text. Use tools for function calling capabilities.

Define your tool schemas in the request. The model will output tool calls that you can execute in your code. This works exactly like the standard OpenAI function calling interface.

Configure JSON mode in your SDK:

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)

Handle errors and usage limits

Watch for specific HTTP status codes to manage your application flow. A 401 error means your API key is invalid or expired. A 402 error indicates you have no prepaid credit left. A 429 error signals you have hit the rate limit of 300 requests per minute.

Your context window is 100,000 tokens total. If you exceed this, the API will return an error. Refusals and errors do not consume your token balance. Keep your request bodies under 8 MB.

Common questions

What is the openai API key pricing structure?

We charge $0.15 per 1M input tokens and $0.50 per 1M output tokens. There is no monthly subscription or idle capacity fee. You only pay for the tokens you actually use from your prepaid crypto balance.

Is this an uncensored LLM model?

Yes, our model does not refuse lawful adult, fictional, or controversial topics. The only hard limit is that we refuse requests involving sexual content with minors. It is not GPT, Claude, or any other vendor's model.

Which payment methods do you accept?

Crypto only: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500. Bonus credit applies from $50.

Generate your API key

Sign up, retrieve your token, update your base URL. That is the entire configuration.

Start now