EN ▾
Get API key

Unrestricted Image Generator: Quickstart: Integrate the Uncensored Text API

This quickstart shows how to integrate the uncensored text API into your visual pipeline. Use it to refine prompts, extract structured data, or post-process generated media without content refusals.

Prerequisites: SDKs and Base URL

Before sending requests, ensure you have an active API key. Sign up using Google or email on the key page to receive your credentials immediately. No phone number is required. The base URL for all requests is https://api.unrestrictedimagegenerator.com/v1. This endpoint is compatible with standard OpenAI SDKs, allowing you to swap your base URL and API key without changing the rest of your code.

  • Supported languages include Python, Node.js, and cURL.
  • The API serves a single uncensored model with ID uncensored.
  • No additional dependencies are needed beyond your standard HTTP client or SDK.
curl https://api.unrestrictedimagegenerator.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
  }'
from openai import OpenAI

client = OpenAI(base_url="https://api.unrestrictedimagegenerator.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)
import OpenAI from "openai";

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

Authentication: Using Your API Key

Include your API key in the Authorization header of every request. The format is Bearer YOUR_API_KEY. If you lose your key or want to rotate it, generate a new one from the key page; this immediately invalidates the previous key because only one key is active per account. Keep your key secure, as it grants access to your prepaid credit.

Authentication errors return a 401 status code if the key is invalid or missing. Ensure your key is passed correctly in the header to avoid unnecessary costs.

Basic Request: Sending a Prompt

Send a POST request to /v1/chat/completions with your prompt in the messages array. The model field must be set to uncensored. The max_tokens field is optional; if omitted, the response can run to the end of the window. The total context window is 100,000 tokens, combining both input and output.

This API is designed for text processing. It does not generate images, audio, or video directly. Use it to generate descriptions, scripts, or metadata for your visual pipeline.

Streaming Responses via SSE

Enable streaming by setting the stream parameter to true in your request. The API returns a Server-Sent Events (SSE) stream, delivering tokens incrementally. This is ideal for real-time applications or when dealing with longer outputs.

The final chunk of the stream includes token usage statistics, allowing you to track costs accurately. Errors during streaming do not consume your prepaid credit, ensuring you only pay for successful token deliveries.

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)

Function Calling and Tool Use

Support for function calling allows your application to define tools and let the model decide which to invoke. Specify tools in the tools parameter and control behavior with tool_choice. This is useful for extracting structured data from unstructured text or automating workflows.

The model returns structured JSON when appropriate, enabling seamless integration with your backend logic. Use this feature to parse complex responses or trigger specific actions based on the content.

JSON Mode for Structured Output

For consistent parsing, use JSON mode by setting response_format to {"type": "json_object"}. The model will output strictly valid JSON, reducing the need for post-processing validation. This is particularly useful when generating configurations, metadata, or data structures for your image pipeline.

Combine JSON mode with function calling for robust, automated text processing. Ensure your schema is well-defined to maximize the model's accuracy in producing parseable output.

Capabilities and limits

Everything the endpoint can and cannot do, in one place — check it before you top up.

ItemValue
API formatOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
EndpointsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.unrestrictedimagegenerator.com/v1
Model IDuncensored
AuthenticationAuthorization: Bearer YOUR_KEY
Other parameterstemperature, top_p, stop, seed and the two penalties are passed through
Completion lengthprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
StreamingYes — server-sent events; the last chunk carries token usage
Context window100,000 tokens (prompt + completion together)
JSON modeJSON object mode via response_format json_object
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Parallel requestsup to 8 in parallel per key
Request size8 MB request body
Requests per minute300 requests per minute per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Subscriptionno monthly fee; paid credit does not expire
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Trial credit$0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Billingprepaid credit, charged by real token usage; errors and refusals are free
Paymentcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Sign-inGoogle or e-mail and password
Keysone active key per account; a new key replaces the old one
Content policyadult content allowed; sexual content involving minors is refused

HTTP errors

Errors come back as JSON with a stable type; failed and refused requests are not billed.

CodeTypeMeaning
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundunknown endpoint
413request_too_largebody over 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busymodel busy — retry in a few seconds

Questions and answers

What happens if I exceed my rate limit?

You will receive a 429 status code. The API allows 300 requests per minute per key. Exceeding this limit pauses your requests until the window resets. Errors like 429 do not consume your prepaid credit.

Is the uncensored model free?

No, it is a paid service. You pay per token usage with prepaid credit. New accounts receive $0.50 in trial credit valid for 7 days. Claim this credit with one click on your API key page. Credit is topped up via crypto (USDT or USDC) and never expires.

Does the model refuse all adult content?

The model is uncensored for lawful adult, fictional, and controversial topics. However, a hard limit always applies: sexual content involving minors is refused. This ensures compliance while maintaining flexibility for other adult themes.

Your key is one form away

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

Get API key