AI Gateway: Switch your client in three lines
Connect your existing OpenAI SDK client to our uncensored endpoint by updating two variables. This quickstart guides you through authentication, standard requests, streaming, and tool usage.
Prerequisites: Install Your Preferred SDK
Before making requests, ensure your development environment has the appropriate SDK installed. Since our endpoint follows the openai compatible api standard, you can use the official library or any compatible client. For Python, run pip install openai. For Node.js, use npm install openai. No additional configuration files are required beyond the environment variables you will set in the next step.
Step 1: Configure Base URL and API Key
Our ai gateway endpoint operates at a distinct base URL. You need to retrieve your API key from the dashboard and configure your SDK client to point to https://api.openaigatewayapi.com/v1. This ensures all requests bypass standard OpenAI infrastructure and route directly to our uncensored model servers. You do not need to change the model name; simply set the base URL and provide your key.
Step 2: Send a Standard Chat Completion Request
With the client configured, you can send a standard chat completion request. The model ID is uncensored. This request demonstrates the basic text-in, text-out capability. The system will process your prompt and return a completion without the typical content filters applied by major providers, provided the content is not sexually explicit involving minors. Use the following command to verify connectivity.
Step 3: Enable Streaming with Server-Sent Events
For lower latency and better user experience, enable streaming by setting stream=true. The endpoint supports Server-Sent Events (SSE), allowing you to receive tokens as they are generated. This is particularly useful for long-form generation or interactive applications. The response stream will emit partial chunks until the completion is finished, providing real-time feedback without waiting for the entire context window to be processed.
Step 4: Use Function Calling for Tool Integration
The endpoint supports tool calling, allowing you to define functions and let the model decide when to invoke them. This enables complex workflows by integrating external APIs or data sources directly into your LLM logic. Define your tools in the tools parameter, and the model will return structured JSON output when appropriate. This feature works identically to the standard OpenAI format, making it easy to swap providers without rewriting your tool integration logic.
Step 5: Handle Errors and Rate Limits
Monitor your API key usage and handle potential errors gracefully. If the key is invalid, you will receive a 401 error. If your prepaid credits are exhausted, a 402 error indicates you need to top up. The system enforces a limit of 300 requests per minute per key; exceeding this will trigger a 429 rate limit error. Additionally, keep your request body under 8 MB to avoid rejection. The context window supports up to 100,000 tokens for both prompt and completion combined.
cURL
curl https://api.openaigatewayapi.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
from openai import OpenAI
client = OpenAI(base_url="https://api.openaigatewayapi.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
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.openaigatewayapi.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);Streaming
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)What the API supports
Everything the endpoint can and cannot do, in one place — check it before you top up.
| Item | Value |
|---|---|
| API format | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Model ID | uncensored |
| Authentication | Authorization: Bearer YOUR_KEY |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Base URL | https://api.openaigatewayapi.com/v1 |
| Structured output | JSON object mode via response_format json_object |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Streaming | Yes — server-sent events; the last chunk carries token usage |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Context window | 100,000 tokens (prompt + completion together) |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Request size | up to 8 MB per request |
| Parallel requests | up to 8 in parallel per key |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Requests per minute | 300 requests per minute per key |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Subscription | paid credit never expires, no subscription |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Free trial | $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 |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| Key management | one active key per account; a new key replaces the old one |
| Sign-in | sign in with Google or with e-mail + password |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
Error codes
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | sexual content involving minors — refused, not billed |
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 |
Questions and answers
What is the context window size?
The model supports a 100,000 token context window, which includes both the input prompt and the output completion. This allows for substantial document processing or conversation history retention within a single request.
How do I top up my credits?
You can top up your prepaid credits from $20 by crypto (USDT on TRC20, USDC on Base). Credits never expire. You also receive a +5% bonus for deposits of $50 or more, a +10% bonus for deposits of $100 or more, and a +15% bonus for deposits of $200 or more.
Does this service use my data for training?
No. Your prompts are not used for training. The service requires only an email and password for signup, ensuring privacy while providing direct access to the uncensored model without hidden clauses or data retention policies.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.