EN ▾
Get API key

Quickstart: Integrate the Uncensored Text API in Minutes

Integrate our uncensored text API into your image and video generation pipelines in minutes using standard OpenAI-compatible SDKs. This guide covers authentication, streaming, JSON mode, and pricing for prompt engineering and post-processing workflows.

Base URL and Authentication

To begin, point your OpenAI-compatible client to our base URL: https://api.unrestrictedaiimage.cc/v1. Authentication relies on a single API key provided upon signup. Pass this key in the Authorization header as a Bearer token. This setup ensures compatibility with existing libraries used for standard LLM integrations. You can generate your key via the Get API key page using Google or email. Keep this key secure; it is the sole credential for your prepaid credit.

Chat Completions Endpoint

Send requests to POST /v1/chat/completions. The API accepts standard message arrays and returns text. Use the model ID uncensored for all requests. This model is tuned to answer without content refusals for lawful adult use, making it ideal for generating creative prompts or scripts without filter interference. Ensure your payload includes the model field set to uncensored. The endpoint supports standard parameters like temperature, top_p, and stop.

curl https://api.unrestrictedaiimage.cc/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."}]
  }'

Python SDK Integration

Use the official openai Python package to interact with the API. Configure the client with our base URL and your API key. This allows you to leverage familiar code patterns for streaming, JSON mode, or function calling. The SDK handles tokenization and request formatting automatically. Remember that the model ID must be explicitly set to uncensored to access the correct server instance. This approach minimizes boilerplate code and integrates smoothly into existing Python-based AI pipelines.

from openai import OpenAI

client = OpenAI(base_url="https://api.unrestrictedaiimage.cc/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 SDK Integration

For JavaScript environments, use the openai Node.js package. Initialize the client with baseURL pointing to our endpoint and provide your API key. This enables you to generate text for captioning, script writing, or data extraction from text. The Node SDK supports async/await patterns for clean, non-blocking code. Ensure you specify the model as uncensored in your completion calls. This method is efficient for server-side processing within your video or image generation workflows.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.unrestrictedaiimage.cc/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 Responses (SSE)

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) for real-time token delivery. This is crucial for applications requiring low latency, such as interactive prompt generation or live script writing. The final chunk of the stream includes token usage statistics. Streaming consumes the same credit as non-streamed requests. Configure your client to handle partial responses and update the UI incrementally. This feature ensures a responsive user experience even for longer text outputs.

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)

JSON Mode and Function Calling

Use response_format: { "type": "json_object" } to enforce structured output. This is essential for extracting data or generating JSON configurations for downstream tools. Function calling (tools) is also supported, allowing the model to invoke external functions. Set tool_choice to control when the model uses tools. These features enable precise text processing for your pipeline. The model returns valid JSON when requested, reducing the need for post-processing validation. This capability is vital for automated workflows involving image or video generation parameters.

Limits, Errors, and Context Window

The context window is 100,000 tokens total. There is no separate output cap (if max_tokens is unset, the response can run to the end of the window). Rate limits are 300 requests per minute and 8 concurrent requests per key. Common errors include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Errors do not consume credit. The request body limit is 8 MB. These limits ensure stable performance for high-volume pipelines. Monitor your usage via the dashboard or response headers to avoid interruptions in your automated workflows.

Technical reference

Use this table to decide whether the API fits your project before you buy credit.

ItemValue
ProtocolOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
MethodsPOST /v1/chat/completions · GET /v1/models
API keyAuthorization: Bearer YOUR_KEY
Base URLhttps://api.unrestrictedaiimage.cc/v1
Model IDuncensored
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
SSE streamingSupported (stream: true), usage included at the end
Other parameterstemperature, top_p, stop, seed and the two penalties are passed through
Structured outputJSON object mode via response_format json_object
Completion lengthup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Context window100,000 tokens, input and output combined
Parallel requestsup to 8 in parallel per key
Max bodyup to 8 MB per request
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Rate limit300/min per key
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Top-upcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Bonus credit+5% from $50, +10% from $100, +15% from $200
Subscriptionpaid credit never expires, no subscription
Free trial$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Keysone active key per account; a new key replaces the old one
Sign-inGoogle or e-mail and password
Content policyadult content allowed; sexual content involving minors is refused

Error reference

The type field is stable, the message is for humans. Errors cost nothing.

CodeTypeMeaning
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditout of credit; add credit and retry
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busymodel busy — retry in a few seconds

Questions and answers

Is this the Flux API or a standard image generation API?

No. This is an uncensored text API. It does not generate images, audio, or video. You can use it to write prompts for the Flux API or other image generation tools, but this service only processes text.

How is the context window calculated?

The 100,000 token limit includes both the input prompt and the output completion. There is no separate output cap. If you do not set max_tokens, the response can run to the end of the window. This total limit applies to the entire conversation history sent in the request.

What happens if I exceed my rate limit?

You will receive a 429 status code. The limit is 300 requests per minute and 8 concurrent requests per key. Exceeding this does not charge credit. Wait for the rate window to reset before sending more requests. You can monitor your usage to stay within these bounds.

Your key is one form away

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

Start with trial credit

Email and password, key on screen right away.