API Documentation: Integrate Uncensored Text Generation
Integrate our uncensored text API into your image and video pipelines with a standard OpenAI-compatible endpoint. This guide covers authentication, request structures, streaming, and error handling for prompt generation and metadata extraction.
Base URL and Authentication
Start by pointing your OpenAI-compatible SDK or HTTP client to the base URL provided in your dashboard. Authentication uses a Bearer token passed in the Authorization header. Your API key is generated immediately upon signup via Google or email. Keep this key secure; it is the only active key per account.
The endpoint for text generation is https://api.uncensoredimagegenerator.cc/v1. This base URL works with standard libraries that expect an OpenAI structure. You do not need to modify the SDK initialization logic, only the base URL and API key values.
Chat Completions Endpoint
Send requests to POST /v1/chat/completions. The model identifier is always uncensored. This endpoint accepts standard chat parameters like messages, temperature, and max_tokens. It returns pure text, making it ideal for generating prompts, captions, or structured data for your visual models.
Ensure your payload adheres to the 8 MB request body limit. The model supports a 100,000 token context window for the combined input and output. There is no separate output cap, and if you do not specify max_tokens the response can run to the end of the window. Use the following example to send a basic completion request:
curl https://api.uncensoredimagegenerator.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 or any compatible library. Initialize the client with your base URL and API key. This approach simplifies parameter handling and type safety for your backend services. It is particularly useful when you need to process text outputs programmatically before passing them to image generation tools.
The following snippet demonstrates how to configure the client and send a message to generate a prompt for an image model:
from openai import OpenAI
client = OpenAI(base_url="https://api.uncensoredimagegenerator.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 or TypeScript environments, use the openai Node.js package. Configure the base URL to point to our infrastructure. This allows you to integrate uncensored text generation directly into your web servers or serverless functions. You can handle the response synchronously or asynchronously depending on your application architecture.
Here is how to initialize the client and make a request in a Node.js environment:
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.uncensoredimagegenerator.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
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE), allowing you to process tokens as they are generated. This reduces perceived latency for large outputs. The final chunk in the stream contains token usage statistics, helping you track costs accurately.
Streaming is recommended for long prompt generations or when building user-facing interfaces that benefit from real-time feedback. Use this pattern to handle the stream correctly in your client code:
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)
Rate Limits, Errors, and Context
Each API key is limited to 300 requests per minute and 8 concurrent requests. If you exceed these limits, the API returns a standard error response indicating the quota has been reached. Ensure your application handles retries with exponential backoff to avoid overwhelming the endpoint.
Common issues include authentication failures and insufficient credit. An invalid key returns a 401 error, while a lack of prepaid balance returns a 402 error. A 429 status indicates rate limiting. Always monitor your prepaid credit, as errors and refusals do not consume tokens but do not return credit either. Context window limits apply to the total input and output tokens combined.
What the API supports
The numbers below are the real limits of this API, not marketing. Compare them with what your app needs.
| Feature | Support |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Model | uncensored |
| API key | Authorization: Bearer YOUR_KEY |
| Base URL | https://api.uncensoredimagegenerator.cc/v1 |
| Max context | 100,000 tokens (prompt + completion together) |
| Other parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| JSON mode | response_format: {"type": "json_object"} |
| Streaming | Supported (stream: true), usage included at the end |
| Tools / tool calls | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Rate limit | 300 requests per minute per key |
| Concurrency | 8 requests at the same time per key |
| Max body | 8 MB request body |
| Credit expiry | paid credit never expires, no subscription |
| Billing | prepaid credit, charged by real token usage; errors and refusals are free |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| Top-up | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| 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 |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
| Account | Google or e-mail and password |
| Keys | one active key per account; a new key replaces the old one |
When a request fails
The type field is stable, the message is for humans. Errors cost nothing.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
Does this API generate images or video directly?
No. This is a text-only chat-completions API. It generates text prompts, captions, and metadata that you can send to image or video models. It does not process or return visual media.
What happens if I exceed the context window?
The total tokens for the prompt and completion must fit within the 100,000 token context window. If the output reaches the end of the window, the response will be truncated. You can adjust max_tokens to control the output length.
Is my data used for training?
No. Prompts sent to this API are not used for training the model. Your data remains private to your requests.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.