vi ▾
Get API key

OverviewDocs

API Quickstart Guide

This guide shows you how to integrate our uncensored LLM inference API into your application using standard OpenAI-compatible clients. You will learn to authenticate, send requests, handle streaming, and manage token costs with full transparency.

https://api.llminferenceproviders.com/v1uncensored

LLM Inference

Base URL and Authentication

The foundation of your integration starts with the correct base URL and API key. Use HTTPS://api.llminferenceproviders.com/v1 as your endpoint. This URL works with any OpenAI-compatible SDK. You obtain your key from the dashboard. The key authenticates your requests to the inference provider. Keep your key secure. It grants access to your prepaid credit. If you lose your key, generate a new one. The old one becomes invalid immediately.

Sending Your First Request

Send a POST request to /v1/chat/completions to generate text. The model ID is always uncensored. This model does not refuse lawful adult content. You send messages in the standard OpenAI format. The API returns a text response. Use this structure for your initial test.

curl https://api.llminferenceproviders.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate 200 tokens of raw text with no content restrictions"}]
  }'

Ensure your payload includes the model field set to uncensored. The API ignores unknown parameters gracefully. You can start with a simple system prompt. Then add user messages. The response will contain the generated text in choices[0].message.content.

Python SDK Integration

Use the official openai Python package for easy integration. Set the base URL and API key in the client configuration. This allows you to use familiar methods like chat.completions.create(). The code handles serialization for you. You can pass messages as a list of dictionaries.

from openai import OpenAI

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

The client manages the connection pool. It retries on transient errors. You can specify max_tokens to control output length. The default max output is 2,048 tokens. Set max_tokens=16000 for longer responses. The context window supports 100,000 tokens total.

Node.js SDK Setup

Install the openai Node.js package. Configure the client with your base URL and key. The Node SDK mirrors the Python client structure. Use OpenAI class initialization. Pass your credentials in the constructor. This ensures compatibility with existing codebases.

import OpenAI from "openai";

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

The SDK handles streaming automatically if you set stream: true. Otherwise, it returns the full response. You can parse the JSON response directly. Error handling is built-in. Catch exceptions for network issues or invalid keys. The API key must be valid. Invalid keys return a 401 error.

Streaming Responses

Enable streaming by setting stream: true in your request. The API sends chunks of text as they are generated. This reduces perceived latency for end users. Each chunk contains partial content. The final chunk includes token usage statistics. Process these chunks to display text in real-time.

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)

Accumulate the content from each chunk. The usage object appears only in the last chunk. This allows you to calculate costs accurately. Streaming works with all parameters. Temperature and top-p affect the stream. The model maintains coherence across chunks. No data is lost during transmission.

Limits, Errors, and Context

You can make 300 requests per minute per key. Concurrent requests are limited to 8 per key. The request body must be under 8 MB. If your key is invalid, you receive a 401 error. If you have no credit, you receive a 402 error. If you exceed the rate limit, you receive a 429 error. The context window is 100,000 tokens. This includes both prompt and completion. Manage your token count carefully. Errors do not consume credit. Refusals are free. This ensures you only pay for valid outputs.

Common questions

LLM Inference
What is the context window size for the uncensored LLM inference provider?

The context window supports 100,000 tokens total, including both the prompt and the completion. You can set a maximum output of 16,000 tokens per request. If you do not specify <code>max_tokens</code>, the default is 2,048 tokens.

How do I handle errors like 401, 402, and 429?

A 401 error means your API key is invalid. A 402 error indicates you have insufficient prepaid credit. A 429 error means you have exceeded the rate limit of 300 requests per minute. Errors do not consume your credit, so you only pay for successful responses.

Is this API compatible with OpenAI SDKs?

Yes, it is fully OpenAI-compatible. You can use any standard OpenAI SDK by changing the <code>base_url</code> to <strong>HTTPS://api.llminferenceproviders.com/v1</strong> and providing your API key. The endpoint structure matches the OpenAI chat completions format exactly.

Get your API key now

Sign up, copy the key, update your base URL. Done.

Get API key