OpenAI Compatible API Documentation
Integrate our uncensored model by updating your base URL and API key. This openai compatible API works with standard openai SDK compatible clients, requiring no code changes beyond connection settings.
- per 1M input tokens
- $0.15
- Output tokens / 1M
- $0.50
- token context
- 100,000
- trial credit
- $0.50
- requests per minute
- 300
Prerequisites: SDK and Base URL
Start by installing your preferred library and pointing it to our endpoint. The base_url is https://api.apicompatible.com/v1. This openai compatible API documentation confirms that standard libraries work immediately. You do not need a router or complex gateway setup. Change the URL and key, then run your existing code.
Authentication: Header and Key Format
Send your key in the Authorization header. Use the format Bearer your_api_key. Our API uses the standard openai compatible API key structure. Keys are generated instantly via Google or email login. Keep your key secure, as it grants access to your prepaid credit.
Chat Completions Endpoint
Post requests to /v1/chat/completions. Specify the model as uncensored. The API returns text responses directly. Use the following curl command to verify connectivity:
curl https://api.apicompatible.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List available models"}]
}'
This openai SDK compatible approach ensures you get unrestricted text generation. The model handles complex prompts without unnecessary refusals for lawful content.
Streaming Responses with SSE
Enable streaming by setting stream: true. Responses arrive via Server-Sent Events (SSE). Token usage details appear in the final chunk. This openai compatible API documentation supports standard streaming protocols. Use this for real-time user experiences:
from openai import OpenAI
client = OpenAI(base_url="https://api.apicompatible.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)
Streaming reduces perceived latency significantly. It works seamlessly with standard client-side libraries.
Parameters: Temperature, Top-P, and Tools
Control generation with standard parameters. Set temperature for randomness or top_p for nucleus sampling. Enable tools for function calling. JSON mode is available via response_format. The uncensored model respects these constraints effectively:
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apicompatible.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);
These parameters allow fine-tuned control over output style. You can enforce strict JSON structures for programmatic use cases.
Limits: Rate Limits and Body Size
Each key allows 300 requests per minute. Concurrent requests are limited to 8 per key. The maximum request body size is 8 MB. The context window supports 100,000 tokens total. Handle 401 errors by checking your key. Resolve 402 errors by topping up credit. Manage 429 errors by implementing backoff logic.
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)Common questions
Is this API compatible with the official OpenAI SDK?
Yes. Our endpoint follows the standard OpenAI protocol. You can use the official SDK by simply updating the base URL. This openai SDK compatible design means minimal code changes.
What is the context window size?
The model supports a 100,000 token context window. This includes both input and output tokens. Each request can output up to 16,000 tokens.
How do I handle streaming responses?
Set the stream parameter to true. The API returns Server-Sent Events (SSE). Token usage information is included in the final chunk. This openai compatible API documentation confirms standard streaming support.
Get your key in seconds
Sign up, copy the token, update the endpoint URL. That is the entire configuration.