OpenAI API Alternative: Switch your client in three lines
Drop-in uncensored OpenAI API alternative
Connect your existing OpenAI-compatible client to our uncensored LLM API by updating the base URL and API key. This quickstart guides you through authentication, basic completions, streaming, and function calling with our single open-weight model.
Authentication & Base URL
Our API follows the standard OpenAI chat-completions interface. You only need to change two things in your client configuration: the base URL and the API key. Sign up at the Get API key page to receive your key immediately. No credit card is required for the trial.
The base URL for all requests is https://api.openaiapialternative.com/v1. This endpoint serves a single uncensored large language model. Unlike multi-model routers, we do not route between vendors; we run our own open-weight model on our own GPU servers. This simplifies your stack because you interact with one consistent model behavior rather than navigating different API quirks across GPT, Claude, or Gemini variants.
First Request
Make a POST request to /v1/chat/completions. The response object structure matches the standard OpenAI specification for text completion, but powered by our uncensored model. You can pass messages, tools, and temperature settings in the same format you would for any OpenAI-compatible endpoint.
This structure ensures that if your client already supports OpenAI's protocol, you can switch providers by changing the base URL and key. The model id you must send is "uncensored". Note that we do not offer embeddings, images, or audio, so keep your payload focused on text.
curl https://api.openaiapialternative.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
Use the official OpenAI Python SDK or any compatible client library. Initialize the client with your key and the new base URL. Then call chat.completions.create with the model id "uncensored". This approach keeps your existing codebase intact while gaining access to an uncensored model without content refusals for lawful adult or controversial topics.
The Python SDK handles the serialization of your messages and tools automatically. Ensure you pass the correct base URL so requests do not go to OpenAI's servers. This method is ideal for developers who want to test the model's behavior with their existing prompt templates and system instructions.
from openai import OpenAI
client = OpenAI(base_url="https://api.openaiapialternative.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 SDK
For JavaScript and TypeScript developers, the Node SDK works identically. Configure the API key and base URL in your client instance. The model id remains "uncensored". This allows you to integrate our uncensored LLM API into your Node.js applications without rewriting your prompt logic.
The Node SDK supports the same chat-completions endpoint. You can use it for serverless functions, backend services, or client-side applications that need direct text generation. Since we do not offer model routing, you get predictable behavior from this single open-weight model. Check the pricing page for token costs.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.openaiapialternative.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 Responses (SSE)
We support Server-Sent Events (SSE) for streaming responses. This is essential for real-time applications where you want to display tokens as they are generated. Set the stream parameter to true in your request. The client will receive a series of events containing partial text.
Streaming reduces the perceived latency for users. Our API handles the SSE protocol exactly as the OpenAI specification defines. You can integrate this into chat interfaces, code generators, or any application that benefits from incremental text delivery. The model processes the prompt and yields tokens continuously until completion.
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 & Context Window
Our context window is 100,000 tokens for the combined prompt and completion. This allows for long documents or extensive conversation histories. Be aware of the rate limit: 300 requests per minute per key. If you exceed this, you will receive a 429 Too Many Requests error.
Common errors include 401 Unauthorized if your key is invalid, and 402 Payment Required if your prepaid credit is exhausted. Each account has one key that can be regenerated at any time. The request body limit is 8 MB. If you need embeddings or image generation, this API is not the right choice; we focus solely on text completion.
API facts in one table
The numbers below are the real limits of this API, not marketing. Compare them with what your app needs.
| Parameter | Details |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| API key | Bearer token in the Authorization header |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Model ID | uncensored |
| Base URL | https://api.openaiapialternative.com/v1 |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| SSE streaming | Supported (stream: true), usage included at the end |
| Function calling | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| JSON mode | response_format: {"type": "json_object"} |
| Context window | 100,000 tokens, input and output combined |
| Max body | up to 8 MB per request |
| Rate limit | 300/min per key |
| Parallel requests | 8 requests at the same time per key |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| 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 |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Subscription | paid credit never expires, no subscription |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| Content policy | adult content allowed; sexual content involving minors is refused |
| Sign-in | sign in with Google or with e-mail + password |
| Keys | one active key per account; a new key replaces the old one |
When a request fails
Every error is JSON with a type you can switch on. You are never charged for an error.
| HTTP | Type | What to do |
|---|---|---|
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 | sexual content involving minors — refused, not billed |
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
Is this a proxy for OpenAI's models?
No. We serve a single open-weight uncensored large language model run on our own servers. It is not GPT, Claude, Gemini, or any other vendor's model. The API interface is compatible, but the underlying model is independent.
What happens if I run out of credit?
You will receive a 402 Payment Required error. We use a pay-as-you-go prepaid credit system. You can top up from $20 by crypto (USDT on TRC20, USDC on Base). Credit never expires, and you get bonus credit for larger purchases.
Does the model refuse content?
The model is uncensored for lawful adult, fictional, security-research, and controversial topics. The only hard limit is that sexual content involving minors is always blocked. We do not apply subjective refusals to standard adult content.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.