Unrestricted AI Generator: API Quickstart
Get started with the Unrestricted AI Generator API in minutes. This quickstart guide covers authentication, chat completions, streaming, and function calling using standard OpenAI-compatible clients.
Base URL & Authentication
Our API is fully compatible with the OpenAI Chat Completions interface. To begin, use the base URL provided below. You need an API key to authenticate your requests. If you haven't created one yet, visit the Get API key page to sign up with Google or email.
- Base URL: https://api.unrestrictedaigenerator.cc/v1
- Model ID:
uncensored
Include your key in the Authorization header as a Bearer token. The service supports standard parameters like temperature, top_p, and stop. Errors and refusals do not consume your prepaid credit, so you can test freely without worrying about token costs.
Send a Chat Completion
The core endpoint is POST /v1/chat/completions. It accepts standard message structures and returns text responses. This is the primary method for generating prompts, scripts, or post-processing text for your media pipelines.
Below is a basic example using cURL to send a simple text request.
curl https://api.unrestrictedaigenerator.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."}]
}'The response contains the generated text in choices[0].message.content. You can integrate this directly into your application logic. Remember that the model does not apply content filters for lawful adult or controversial topics, making it ideal for creative or research use cases.
Python SDK Integration
For Python developers, the official openai SDK works out of the box with minimal configuration. You only need to update the base URL and provide your API key.
This approach is ideal for backend services or data processing scripts where you need structured text output. The SDK handles serialization and error parsing automatically.
from openai import OpenAI
client = OpenAI(base_url="https://api.unrestrictedaigenerator.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)Ensure you have the latest version of the SDK installed. The client will automatically format requests to match the OpenAI standard, ensuring compatibility with our uncensored model.
Node.js SDK Integration
If you are building in JavaScript or TypeScript, the Node.js SDK provides a straightforward way to integrate our text API. Like the Python client, it requires a base URL override.
This is particularly useful for web applications or serverless functions that generate dynamic text content. The SDK supports async/await patterns for clean, non-blocking code.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.unrestrictedaigenerator.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);Handle potential network errors or API rate limits appropriately in your code. The API returns standard HTTP status codes, making it easy to debug integration issues.
Enable Streaming (SSE)
For real-time text generation, set stream: true in your request. The API returns Server-Sent Events (SSE) containing partial chunks of text.
Streaming is essential for user-facing applications where immediate feedback is required. The final chunk of the stream includes the total token usage for billing purposes.
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)Process each chunk as it arrives to display text incrementally. This reduces perceived latency for your users and provides a smoother experience compared to waiting for the full response.
Rate Limits & Constraints
Our API enforces strict limits to ensure stability. You are allowed 300 requests per minute per key and 8 concurrent requests at any given time. The maximum request body size is 8 MB.
Common HTTP errors include 401 for invalid keys, 402 if your prepaid credit is exhausted, and 429 for rate limit violations. The context window is 100,000 tokens (input + output combined), with no separate output cap.
If you exceed limits, implement exponential backoff in your client. Note that concurrent requests are counted per key, so managing concurrency is crucial for high-throughput pipelines.
Questions and answers
What is the context window size?
The context window is 100,000 tokens, combining both input and output. Your response can run to the end of the window, including when you do not specify a max_tokens value.
Does the API support function calling?
Yes, the API supports function calling with tools and tool_choice parameters. This allows you to define structured outputs and integrate the model into complex workflows.
How are errors handled in billing?
Errors such as invalid keys or rate limits do not consume your prepaid credit. If a request is processed but results in a refusal (except for the hard limit on minor sexual content), it is also free. Errors are charged only if the request is successfully processed and tokens are generated.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Under the hood: specs
If your tool speaks the OpenAI API, these are the details that matter.
| Feature | Support |
|---|---|
| Compatibility | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Base URL | https://api.unrestrictedaigenerator.cc/v1 |
| API key | Bearer token in the Authorization header |
| Model | uncensored |
| Streaming | Yes — server-sent events; the last chunk carries token usage |
| Context window | 100,000 tokens, input and output combined |
| Structured output | JSON object mode via response_format json_object |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Rate limit | 300 requests per minute per key |
| Max body | up to 8 MB per request |
| Parallel requests | 8 requests at the same time per key |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| 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 |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Subscription | no monthly fee; paid credit does not expire |
| Account | sign in with Google or with e-mail + password |
| Content policy | adult content allowed; sexual content involving minors is refused |
| Keys | one active key per account; a new key replaces the old one |
HTTP errors
Every error is JSON with a type you can switch on. You are never charged for an error.
| Code | Type | Meaning |
|---|---|---|
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 | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | model busy — retry in a few seconds |