EN ▾
Get API key
LoginllmSetup guide

Integration Guide: uncensored chat completions

Get your uncensored LLM running in minutes with this direct integration guide. We skip the fluff and show you exactly how to send requests to the uncensored chat API.

Base URLhttps://api.loginllm.com/v1

Base URL and Authentication

The foundation of your integration starts with the base URL. Use https://api.loginllm.com/v1 for all requests. This endpoint is fully OpenAI compatible, meaning you can swap your existing keys without rewriting your client logic.

Authentication relies on a single API key. Generate this key via the Get API key page using either Google or an email password. The system issues one active key per account; issuing a new one immediately invalidates the previous key. Keep this key secure, as it controls your prepaid credit.

Pass the key in the Authorization header as a Bearer token. No complex OAuth flows or session cookies are required for the API itself.

You can test connectivity immediately with a simple curl command. This ensures your network allows outbound HTTPS traffic to our servers before you build the rest of your application.

The chat/completions Endpoint

Send messages to the POST /v1/chat/completions endpoint. This is the standard interface for text generation. You define the model as uncensored and provide a list of messages in the request body.

Each message requires a role (system, user, or assistant) and content. The system processes these inputs and returns a completion. You do not need to manage model routing or select from multiple variants; we host one dedicated open-weight model optimized for unrestricted output.

This approach keeps your code simple. You avoid the overhead of managing multiple model versions or handling vendor-specific quirks. The response structure matches the OpenAI format, ensuring broad SDK compatibility.

Check your balance regularly. Credits are deducted based on actual token usage, and errors do not consume credits.

Streaming with Server-Sent Events

For real-time user experiences, enable streaming by setting stream: true in your request. The API returns a stream of Server-Sent Events (SSE) instead of a single JSON object.

Each event chunk contains a portion of the generated text. You can render this text incrementally in your UI, which significantly reduces perceived latency for the end-user. The final chunk in the stream includes the total token usage for the request.

This feature is essential for chat interfaces where users expect immediate feedback. It allows your application to handle long responses without blocking the main thread.

Implement a simple event listener to collect these chunks. Concatenate them to form the complete response, or display them live as they arrive.

Function Calling and Tools

The API supports structured tool use. Define functions in the tools array within your request. The model can then decide to call a function based on the user's input.

When the model generates a function call, it returns the function name and arguments in a structured format. Your application executes the function and sends the result back to the model for a final response.

This capability enables complex workflows without hardcoding logic. You can integrate external data sources, calculators, or custom business logic directly into the conversation.

Ensure your tool definitions are precise. The model relies on these schemas to understand the expected input and output formats for each function.

Context Window and Limits

The model supports a context window of 100,000 tokens. This window includes both the prompt and the completion. You can specify a maximum output length using the max_tokens parameter.

If max_tokens is unset, the response can run to the end of the window. Setting a higher value allows for longer responses, up to the 100,000 token limit. This is useful for generating detailed reports or code snippets.

Monitor your rate limits carefully. The API allows 300 requests per minute and 8 concurrent requests per key. Exceeding these limits will result in a 429 error.

The request body size is limited to 8 MB. Large context windows consume more credit, so balance your memory requirements with your budget.

Error Handling and Token Usage

Handle errors gracefully to maintain a smooth user experience. A 401 error indicates an invalid or expired API key. Re-authenticate or generate a new key from your dashboard.

A 402 error means your prepaid credit is insufficient. Top up using USDT (TRC20) or USDC (Base) to resume service. Credits never expire, so you can add funds whenever convenient.

A 429 error signals that you have exceeded the rate limit. Implement exponential backoff in your client to retry requests automatically. Always check the response headers for remaining quota information.

Token usage is reported in the final stream chunk or the completion response. Use this data to optimize your prompts and manage costs effectively.

cURL

curl https://api.loginllm.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Fix syntax error in python loop"}]
  }'

Python

from openai import OpenAI

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

FAQ

How do I get my API key for LLM login?

Navigate to the Get API key page on the site. You can sign in using Google or an email password. The API key is displayed immediately after authentication. No phone number is required for this process.

What happens if I exceed the rate limit?

You will receive a 429 status code. The limit is 300 requests per minute and 8 concurrent requests per key. Implement retry logic with exponential backoff to handle this gracefully without losing data.

Is the uncensored LLM model different from GPT?

Yes. The model is an open-weight model hosted on our servers. It is not GPT, Claude, Gemini, or any other vendor's model. It is tuned specifically to answer without content refusals for lawful adult use.

Get your API key

Sign up, copy the key, update your base URL. That is all.