EN ▾
Get API key

Uncensored AIHow to Use an AI Image API

Uncensored AI for Coding: Setup, Tools and Costs

Uncensored AI for coding means a code-capable chat model that does not refuse lawful requests such as security tooling, reverse engineering or scraping scripts. Here is how to wire one into your editor and scripts through an OpenAI-compatible API, and what it costs.

Updated

Glowing terminal above a circuit grid with streams of code blocks, representing coding with an uncensored AI API

01Uncensored AI

Key points

  1. Text APIs handle prompt construction, script writing, and metadata extraction independently of image generation models.

  2. OpenAI-compatible endpoints allow direct integration using standard SDKs without custom protocol development.

  3. Streaming support enables real-time token delivery, essential for interactive prompt refinement workflows.

  4. Token pricing is usage-based, with specific limits on context windows and request rates.

Why coders look for an uncensored model

Most coding work never touches a content filter. You ask for a sorting function and you get one. The friction shows up at the edges. A penetration tester asks for a port scanner for their own network and gets a lecture. A researcher wants to explain how a piece of obfuscated malware decodes its payload and the assistant declines. A scraper script, a game cheat for a single-player title, a fuzzing harness, a bypass for your own licence check: each of these is lawful in the right setting, and each can trigger a refusal from a heavily filtered model.

An uncensored model is tuned to answer such requests without content refusals, for lawful adult use. That does not make it a better programmer. It makes it a more available one for the narrow set of tasks where refusals cost you time. If you are unsure whether it suits your work, run your own prompts through it and compare. No benchmark number on a web page replaces that.

A note on the site name: this API is text only. Despite the domain, it does not generate images. It serves a chat model, and code is text, so it fits this job well. You can read more on the API overview page.

Connect the API in two minutes

The endpoint follows the OpenAI chat-completions format. The base URL is https://api.uncensoredaiimage.com/v1, the model ID is uncensored, and authentication is a bearer token. Two methods exist: POST /v1/chat/completions and GET /v1/models.

Get a key on the API key page. After sign-up, with Google or with email and password, you can claim $0.50 of trial credit with one click. It lasts 7 days, one per person. Then a first call in Python:

from openai import OpenAI

client = OpenAI(
    base_url="https://api.uncensoredaiimage.com/v1",
    api_key="YOUR_API_KEY",
)

resp = client.chat.completions.create(
    model="uncensored",
    messages=[
        {"role": "system", "content": "You are a senior engineer. Answer with code first, then a short note."},
        {"role": "user", "content": "Write a Python port scanner for my own LAN using asyncio."},
    ],
    temperature=0.2,
)
print(resp.choices[0].message.content)

The same thing in Node, using the official openai package:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.uncensoredaiimage.com/v1",
  apiKey: process.env.API_KEY,
});

const resp = await client.chat.completions.create({
  model: "uncensored",
  messages: [{ role: "user", content: "Explain what this regex matches: ^(?=.*\\d)(?=.*[a-z]).{8,}$" }],
  temperature: 0.2,
});
console.log(resp.choices[0].message.content);

Use a low temperature for code, around 0.1 to 0.3. Higher values are for brainstorming and prose.

Use it from your editor and terminal

Many coding tools accept a custom OpenAI-compatible endpoint. The setting is usually called "OpenAI base URL", "API base" or "custom provider". Fill in three values: the base URL above, your key and the model name uncensored. Cursor, Continue and similar editors expose this in their model settings, and the exact menu names change between versions, so check the tool's own documentation if a field looks different.

Command-line assistants work the same way. For Aider, which routes through LiteLLM, you can pass the endpoint with environment variables and prefix the model with openai/:

export OPENAI_API_BASE="https://api.uncensoredaiimage.com/v1"
export OPENAI_API_KEY="YOUR_API_KEY"
aider --model openai/uncensored

Plain scripts are even easier. Anything that reads OPENAI_BASE_URL and OPENAI_API_KEY from the environment can be redirected without a code change.

Two cautions. First, some editor features, such as inline autocomplete, call the model on every pause in typing, so they send many small requests. Check the rate limits below before you enable them. Second, editor tools may use their own hosted models for some features regardless of your custom setting. Read what each feature uses.

Structured output and tool calling

Coding agents live on structured output. Two features matter most here.

JSON mode forces the reply to be a JSON object. Use it for linters, commit-message tools and code reviewers that must produce machine-readable results.

import json

resp = client.chat.completions.create(
    model="uncensored",
    response_format={"type": "json_object"},
    messages=[
        {"role": "system", "content": "Return JSON with keys: severity, line, issue, fix."},
        {"role": "user", "content": "def f(x):\n    return eval(x)"},
    ],
)
print(json.loads(resp.choices[0].message.content))

Tool calling lets the model request a function you define, such as running a test or reading a file. Pass tools and optionally tool_choice, execute the call yourself, and send the output back as a message with role: "tool". Streaming also returns tool_calls incrementally.

tools = [{
    "type": "function",
    "function": {
        "name": "run_tests",
        "description": "Run the project's test suite and return the output",
        "parameters": {
            "type": "object",
            "properties": {"path": {"type": "string"}},
            "required": ["path"],
        },
    },
}]
resp = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Run the tests in ./tests and summarise failures."}],
    tools=tools,
    tool_choice="auto",
)
print(resp.choices[0].message.tool_calls)

Always validate arguments before you execute anything. A model can produce a malformed or unexpected call, and that holds for any model. Run generated code in a sandbox, a container or a throwaway VM, particularly when the task involves security tooling.

Working with large codebases

The context window is 100,000 tokens, prompt plus completion. That is roughly enough for a few dozen medium source files in one request, though the real count depends on the language and your formatting. Completion can use whatever the prompt leaves free, and max_tokens is optional.

A few habits improve results on big inputs:

  • Send only the files that matter. Put the file under review last, after the context, with the instruction right below it.
  • Number the lines of the code you send. The model can then refer to "line 42" and your tooling can apply the fix exactly.
  • Ask for diffs or full replacement functions, not an entire rewritten file. It saves output tokens and makes review easier.
  • Use seed with a low temperature when you want repeatable output for the same prompt, for example in tests of your own tooling.
  • Split large jobs into steps: plan, implement, then review. Each step gets a smaller, cleaner prompt.

The request body can be up to 8 MB, which will not be your limit before the token window is. Pasting minified bundles or lockfiles wastes tokens, so leave them out.

Prompts that get usable code

Removing refusals fixes one failure mode only. The rest of the quality comes from how you ask. Say the language and version, the libraries you allow, and the shape of the answer you want. State the setting as well: "this is my own staging server" or "this is a CTF exercise" gives the model facts that improve the answer, and it records your intent for anyone who reads your logs later.

Ask for tests with the code. A request such as "write the function and three pytest cases, including one for empty input" tends to expose weak spots early. When a result is wrong, paste the exact error and the failing input back into the conversation instead of describing it in words. Short, specific correction loops beat long rewrites, and they cost little: ten rounds of 3,000 input tokens and 500 output tokens come to about $0.0045 plus $0.0025, so under a cent in total.

What coding work costs

Billing is pay as you go from prepaid credit: $0.15 per 1M input tokens and $0.50 per 1M output tokens. No subscription, and failed or refused requests are not charged. Credit never expires.

TaskInputOutputCost
Explain one function1,000 tokens500 tokens$0.00015 + $0.00025 = $0.0004
Review a large file20,000 tokens2,000 tokens$0.003 + $0.001 = $0.004
Agent loop, 30 calls450,000 tokens30,000 tokens$0.0675 + $0.015 = $0.0825

The agent row assumes an average of 15,000 input tokens and 1,000 output tokens per call. An agent that re-sends its growing history on each step is where input costs add up, so trim the history and drop tool outputs you no longer need.

Top-ups are any whole amount from $20 to $500, with a bonus of 5% from $50, 10% from $100 and 15% from $200. This site takes crypto: USDT on TRC20 or USDC on Base. Full details are on the pricing page.

Limits and error handling

A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 and 60. A streamed request holds its concurrency slot until the stream ends, so an agent that streams several long answers in parallel can hit the limit sooner than you expect.

When you go over, the API returns HTTP 429. The error code rate_limited means too many requests per minute and concurrency means too many at the same time. On temporary overload you also get Retry-After: 5. Honour that header, wait, and retry with a growing delay.

curl -i https://api.uncensoredaiimage.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"user","content":"ping"}],"max_tokens":5}'

The response headers include X-Request-Id, X-Balance-USD and the rate-limit headers, which are handy in logs. See the quickstart for the full request reference.

One limit is fixed: the model will not produce sexual content involving minors. Everything else is about lawful use, and that part is your responsibility: test only systems you own or have written permission to test.

02Uncensored AI

Questions and answers

Is an uncensored model better at coding?

Not by default. It is tuned to avoid content refusals, which helps on lawful security and automation tasks. Test it on your own prompts to judge code quality.

Can I use it with Cursor or other editors?

Editors that accept a custom OpenAI-compatible endpoint can use it. Enter the base URL, your key and the model name uncensored.

Does it generate images?

No. Despite the site name, the API is text only: no images, audio or video, no embeddings and no fine-tuning.

How large a codebase can I send?

The context window is 100,000 tokens, prompt plus completion, and the request body can be up to 8 MB.

Uncensored AIuncensoredaiimage.com

Your key is one form away

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

Get API key