EN ▾
Get API key
per 1M input tokens
$0.15
Output tokens / 1M
$0.50
token context
100,000
trial credit
$0.50
requests per minute
300

Uncensored text API for developers

Unfiltered AIOpenAI API in Node.js with an Uncensored Endpoint

OpenAI API in Node.js with an Uncensored Endpoint

For open ai api node projects you do not need a special library. The official openai package works as it is: you change the base URL and the key, and use the model ID from the docs. This page shows working code for chat, streaming, tools and rate limits.

Updated

A glowing node connected by a cable to an API server, representing Node.js talking to an OpenAI-compatible endpoint

Key points

  • Install the openai package, set baseURL and apiKey, and pass the single model ID.
  • Streaming, tool calling and JSON mode follow the normal OpenAI request shape.
  • A full key allows 8 concurrent requests, so cap parallel jobs and let the SDK retry on 429.
  • Failed or refused requests are not charged, and usage comes back with every response.

What you change in an existing Node project

If your code already talks to a chat completions endpoint through the openai package, the migration is two lines. Pass a different baseURL and a different apiKey to the client constructor, and use uncensored as the model. Everything else in your request stays in the usual shape.

The service is a hosted API for one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. It is not the official API of any model vendor and it does not route between vendors, so there is only one model ID. Two methods are available: POST /v1/chat/completions and GET /v1/models. It is text only. There are no image endpoints and no embeddings, which matters if your project calls those.

You will need a key. Sign-up uses Google or email and password, and the API key page has a one-click claim for $0.50 of trial credit with no card required. The trial is valid for 7 days.

Install and make the first request

You need a recent Node release with ES modules. Create a folder, install the package and keep the key in an environment variable rather than in the source:

mkdir uncensored-node && cd uncensored-node
npm init -y
npm install openai
npm pkg set type=module
export UNFILTERED_API_KEY="paste-your-key-here"

Now a minimal script. Save it as chat.js and run node chat.js:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.unfilteredaigenerator.top/v1",
  apiKey: process.env.UNFILTERED_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "uncensored",
  messages: [
    { role: "system", content: "You are a blunt editor. Answer in plain language." },
    { role: "user", content: "Rewrite this sentence so it is shorter: The meeting that we had yesterday was a meeting about budgets." },
  ],
  temperature: 0.7,
});

console.log(completion.choices[0].message.content);
console.log(completion.usage);

The response has the familiar structure: text in choices[0].message.content and token counts in usage. The reply headers also carry X-Request-Id and X-Balance-USD, which are useful when you want to log what a request cost or check how much credit is left. You can read headers in the SDK by calling .withResponse() on the request promise.

If you prefer CommonJS, replace the import with const OpenAI = require("openai"), drop the top-level await and wrap the body in an async function.

Streaming tokens as they arrive

Long replies feel slow if you wait for the whole thing. Set stream: true and the endpoint sends server-sent events, one chunk per piece of text, with usage reported at the end of the stream.

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.unfilteredaigenerator.top/v1",
  apiKey: process.env.UNFILTERED_API_KEY,
});

const stream = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Tell a two-paragraph story about a lighthouse keeper." }],
  stream: true,
});

let usage = null;
for await (const chunk of stream) {
  const delta = chunk.choices[0]?.delta?.content;
  if (delta) process.stdout.write(delta);
  if (chunk.usage) usage = chunk.usage;
}
console.log("\n", usage);

Two details trip people up. First, the optional chaining on chunk.choices[0]?.delta?.content matters, because some chunks carry no text, including the closing one. Second, a streamed request holds its concurrency slot until the stream finishes. If your user closes the tab and your server keeps reading, you are still occupying a slot, so abort the stream when the client disconnects.

Tool calling and JSON mode

Tool calling uses the same fields you know: tools, tool_choice, and results returned with role: "tool". When streaming, the tool calls arrive in pieces and you assemble the argument string before parsing it. Here is a complete round trip without streaming:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.unfilteredaigenerator.top/v1",
  apiKey: process.env.UNFILTERED_API_KEY,
});

const tools = [
  {
    type: "function",
    function: {
      name: "get_order_status",
      description: "Look up an order by its numeric ID",
      parameters: {
        type: "object",
        properties: { order_id: { type: "integer" } },
        required: ["order_id"],
      },
    },
  },
];

const messages = [{ role: "user", content: "Where is order 4812?" }];

const first = await client.chat.completions.create({
  model: "uncensored",
  messages,
  tools,
  tool_choice: "auto",
});

const call = first.choices[0].message.tool_calls?.[0];
if (call) {
  const args = JSON.parse(call.function.arguments);
  const result = { order_id: args.order_id, status: "shipped" };

  messages.push(first.choices[0].message);
  messages.push({
    role: "tool",
    tool_call_id: call.id,
    content: JSON.stringify(result),
  });

  const second = await client.chat.completions.create({
    model: "uncensored",
    messages,
    tools,
  });
  console.log(second.choices[0].message.content);
}

Always parse arguments inside a try block in real code. A model can produce malformed JSON now and then, and a retry with the error message appended is usually enough to fix it.

When you only need structured output and no tool, JSON mode is shorter. Set response_format and also tell the model in the prompt which keys you want, since the format flag asks for a JSON object but does not enforce your schema:

const res = await client.chat.completions.create({
  model: "uncensored",
  response_format: { type: "json_object" },
  messages: [
    { role: "system", content: "Reply with a JSON object with keys title and tags (an array of strings)." },
    { role: "user", content: "Summarise: a short guide to composting kitchen scraps." },
  ],
});

const data = JSON.parse(res.choices[0].message.content);
console.log(data.title, data.tags);

Rate limits, retries and parallel jobs

Limits depend on the key. A full key allows 8 concurrent requests and 300 requests per minute. The trial key allows 2 concurrent and 60 per minute. Go over and you get HTTP 429 with the error code rate_limited for the per-minute cap or concurrency for too many requests at once. On temporary overload the API also returns 429, with a Retry-After: 5 header.

The openai package retries 429 responses by default and honours Retry-After, and you can raise the count with the maxRetries option. For batch work, add a limiter so that you queue instead of colliding. The p-limit package does this in a few lines:

import OpenAI from "openai";
import pLimit from "p-limit";

const client = new OpenAI({
  baseURL: "https://api.unfilteredaigenerator.top/v1",
  apiKey: process.env.UNFILTERED_API_KEY,
  maxRetries: 4,
});

const limit = pLimit(6); // stay under the 8 concurrent requests allowed on a full key

const prompts = ["Idea one", "Idea two", "Idea three"];

const results = await Promise.all(
  prompts.map((p) =>
    limit(async () => {
      const r = await client.chat.completions.create({
        model: "uncensored",
        messages: [{ role: "user", content: p }],
        max_tokens: 400,
      });
      return r.choices[0].message.content;
    })
  )
);

Keep the limiter at or below the concurrency of your key. With a trial key, use 2. If you stream, remember that each open stream counts for its whole duration, so a chat server with many users needs its own queue.

To tell the two 429 types apart in your own handler, inspect the code:

try {
  const r = await client.chat.completions.create({ model: "uncensored", messages });
} catch (err) {
  if (err instanceof OpenAI.APIError && err.status === 429) {
    console.log("code:", err.code, "retry after:", err.headers?.["retry-after"]);
  } else {
    throw err;
  }
}

A small Express endpoint for a web front end

Never put the key in browser code. The usual pattern is a thin server route that holds the key and forwards messages. This one streams text to the client as server-sent events:

import express from "express";
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.unfilteredaigenerator.top/v1",
  apiKey: process.env.UNFILTERED_API_KEY,
});

const app = express();
app.use(express.json());

app.post("/api/chat", async (req, res) => {
  res.setHeader("Content-Type", "text/event-stream");
  res.setHeader("Cache-Control", "no-cache");

  try {
    const stream = await client.chat.completions.create({
      model: "uncensored",
      messages: req.body.messages,
      stream: true,
    });
    for await (const chunk of stream) {
      const text = chunk.choices[0]?.delta?.content ?? "";
      if (text) res.write("data: " + JSON.stringify({ text }) + "\n\n");
    }
    res.write("data: [DONE]\n\n");
  } catch (err) {
    res.write("data: " + JSON.stringify({ error: err.status ?? 500 }) + "\n\n");
  } finally {
    res.end();
  }
});

app.listen(3000);

Add your own authentication and a cap on messages length before exposing it, since anyone who can call the route spends your credit. The maximum request body is 8 MB, and the context window is 100,000 tokens for prompt plus completion, so trim old messages once a conversation gets long. A simple rule is to keep the system message and the most recent turns, and to drop the oldest turns first. Count roughly four characters per token for English text when you need a quick estimate, then confirm with the usage field that comes back with each response.

What a request costs

Billing is $0.15 per 1M input tokens and $0.50 per 1M output tokens from prepaid credit. Take a request with 1,500 input tokens and 400 output tokens. Input costs 1,500 × $0.15 / 1,000,000 = $0.000225, and output costs 400 × $0.50 / 1,000,000 = $0.0002. That is $0.000425 per request, so 10,000 such requests cost $4.25.

Because failed or refused requests are not charged, retries after an error do not add to the bill. Top-ups are whole amounts from $20 to $500, and the credit never expires. Larger top-ups add a bonus: +5% from $50, +10% from $100 and +15% from $200. You can pay by crypto (USDT on TRC20, USDC on Base). The pricing page lists the details, and the API documentation covers every parameter that is passed through, such as temperature, top_p, stop, seed and the penalties.

Prompts are not used for training. For a hobby project that is a comfortable default, and for a product it is a point you can state in your own privacy notice. Sexual content involving minors is not allowed under any circumstances, and the model is meant for lawful adult use.

Questions and answers

Do I need a special SDK for Node.js?

No. The official openai package works. Set baseURL to the endpoint on this site, use your key as apiKey, and pass the model ID shown in the docs.

Does it work with fetch instead of the SDK?

Yes. Send a POST to /v1/chat/completions with an Authorization: Bearer header and a JSON body. The SDK only adds retries and typed helpers.

Can I use the embeddings or image endpoints?

No. The API is text only, with chat completions and a models list. There are no embeddings, image, audio or video endpoints.

Why do I get a 429 error?

Either you sent more than 300 requests per minute, or too many at once (8 on a full key, 2 on a trial key). The error code tells you which one, and the SDK retries automatically.

Is my data used for training?

No. Prompts are not used for training.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key