EN ▾
Get API key

Unrestricted AI Image: Quickstart: Integrate the Uncensored Text API

Integrate the uncensored text API into your multi-modal pipeline using standard OpenAI-compatible clients. This guide covers authentication, request structure, and streaming for prompt engineering and content extraction.

Set Your Base URL

Start by pointing your SDK client to the correct base URL. The API is fully compatible with the OpenAI protocol, so you only need to change the base_url and provide your API key. This ensures your existing visual pipelines work without major refactoring.

  • Base URL: https://api.unrestrictedaiimage.com/v1
  • Authentication: Pass your key in the Authorization: Bearer <key> header.

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 prompts or extracting data without intermediate filters blocking your workflow.

Make Your First Request

Send a standard chat completion request to generate text. Use the POST /v1/chat/completions endpoint with the uncensored model. This works for any task, from writing image captions to building context for multi-agent systems.

The API accepts standard parameters like temperature, top_p, and stop. You can also use response_format to enforce JSON output or tools for function calling. Requests are processed instantly, and you are billed only for real token usage.

Ensure your input fits within the 100,000 token context window. Output can run to the end of that window.

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

Python SDK Integration

Use the official OpenAI Python SDK to integrate the API into your backend. Set the base URL to point to our servers, and pass your API key. The SDK handles serialization and error parsing automatically.

This is the recommended approach for building Python-based multi-modal agents. You can chain text generation with image or video processing libraries seamlessly. The API supports streaming and structured output, making it easy to parse results for further logic.

Install the SDK using pip: pip install openai. Then initialize the client with your base URL and key. All standard parameters like max_tokens and seed are supported.

from openai import OpenAI

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

For JavaScript or TypeScript environments, use the openai npm package. Configure the client with the same base URL and authentication header. This allows you to integrate uncensored text generation directly into your web servers or Node.js scripts.

Node.js is ideal for real-time applications where text needs to be generated and passed to a visual pipeline immediately. The SDK supports both synchronous and asynchronous requests, ensuring your application remains responsive.

Handle errors gracefully. The API returns standard HTTP status codes for issues like invalid keys or rate limits. You can also use the stream option to process tokens as they arrive.

import OpenAI from "openai";

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

Handle Streaming Responses

Enable streaming by setting stream: true in your request. The API returns data in chunks using Server-Sent Events (SSE). Each chunk contains partial text and metadata.

Streaming is useful for real-time applications where you want to display text as it is generated. The final chunk includes token usage statistics, allowing you to track costs accurately. You can also set max_tokens to limit output length even in streaming mode.

Handle partial responses carefully. If the stream is interrupted, you may need to reconstruct the full text from the chunks you received. The API ensures that each chunk is valid JSON when using structured output modes.

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)

Limits, Errors, and Context

The API enforces strict limits to ensure stability. You can make 300 requests per minute per key, with up to 8 concurrent requests. The request body must not exceed 8 MB. If you exceed these limits, you will receive a 429 rate limit error.

Authentication errors return 401 if the key is invalid. Payment issues return 402 if you have insufficient credit. Errors are free, so you are not charged for failed requests. The context window is 100,000 tokens, with no separate output cap. Use max_tokens to control output length.

For structured output, use JSON mode. This ensures the response is valid JSON, making it easier to parse in your application. The API supports function calling, allowing you to define tools for the model to use.

Under the hood: specs

Before you integrate, here is exactly what you get with a key.

SpecValue
API formatOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
Model IDuncensored
AuthenticationBearer token in the Authorization header
Base URLhttps://api.unrestrictedaiimage.com/v1
EndpointsPOST /v1/chat/completions · GET /v1/models
Completion lengthup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
StreamingSupported (stream: true), usage included at the end
Other parameterstemperature, top_p, stop, seed and the two penalties are passed through
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Context window100,000 tokens (prompt + completion together)
JSON modeJSON object mode via response_format json_object
Request sizeup to 8 MB per request
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Parallel requests8 requests at the same time per key
Requests per minute300 requests per minute per key
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Subscriptionno monthly fee; paid credit does not expire
Paymentcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Trial credit$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
Key managementone active key per account; a new key replaces the old one
Contentadult content allowed; sexual content involving minors is refused
Sign-inGoogle or e-mail and password

Error reference

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

StatusTypeReason
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_foundonly /v1/chat/completions and /v1/models exist
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 is the maximum output length per request?

There is no separate output cap per request. If you do not set the max_tokens parameter, the response can run to the end of the window. The total context window is 100,000 tokens, including both input and output.

How do I handle rate limits?

The API allows 300 requests per minute per key and up to 8 concurrent requests. If you exceed these limits, you will receive a 429 error. You can monitor your usage and adjust your request rate accordingly.

Is the API compatible with other OpenAI SDKs?

Yes, the API is fully OpenAI-compatible. You can use any SDK that supports the OpenAI protocol by setting the base URL to https://api.unrestrictedaiimage.com/v1. This includes Python, Node.js, and other languages.

Your key is one form away

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

Get API key