Prerequisites
To use the apertus API, you need an account and an API key. Sign up via Google or email on the Get API key page. You receive a key immediately; no phone number is required. If you want to test first, new users get $0.50 in trial credit, one per person, valid for 7 days. Claim this credit with one click on your API key page. No card is needed for the trial. For production, top up with crypto (USDT on TRC20 or USDC on Base). The credit never expires, and errors do not consume balance. You get one active key per account; generating a new one replaces the old. Keep your key secure and pass it in the Authorization header as a bearer token. The API is strictly text-based, serving one uncensored model optimized for answering without content refusals.
Base URL and Authentication
Direct all requests to https://api.apertus.cc/v1. This base URL works with the official OpenAI SDKs and any compatible client by simply changing the endpoint. Include your API key in the header: Authorization: Bearer YOUR_API_KEY. The only supported endpoint is POST /v1/chat/completions. A GET /v1/models endpoint is also available to verify connectivity. The model ID to use is uncensored. This is an open-weight model running on our servers, distinct from GPT, Claude, or other vendors. It handles text input and returns text output. Do not expect embeddings, images, or audio. The API is designed for developers who want a straightforward integration without model routing complexity.
First Request
Send a basic completion request to verify your setup. Use the curl command to POST to the chat completions endpoint. Set the model to uncensored and include a simple message. This confirms your API key works and the base URL is correct. You can adjust parameters like temperature or max_tokens as needed. The response will contain the model's text output. If you receive a 401 error, check your key. A 402 error indicates insufficient credit. A 429 error means you have hit the rate limit. This simple request demonstrates the raw API access without any middleware. It is the fastest way to validate your integration before building more complex logic.
Python Integration
Use the official openai Python SDK to interact with the API. Initialize the client with the base URL https://api.apertus.cc/v1 and your API key. Set the model to uncensored. Send messages as a list of dictionaries. The SDK handles serialization and error parsing automatically. This approach is ideal for backend services or data processing scripts. You can stream responses or get full blocks. The client code is identical to what you would use for OpenAI, just with a different base URL. This reduces friction when switching from other providers. Ensure you have the latest SDK version for best compatibility. The integration is minimal, requiring only configuration changes to your existing client setup.
Node.js Integration
For JavaScript or TypeScript environments, use the openai npm package. Configure the client with the same base URL and key as in Python. Call chat.completions.create() with the uncensored model. Pass your messages in the standard format. This works well for serverless functions or Node.js backends. The SDK manages the HTTP requests and response parsing. You can handle errors gracefully by checking the response status. The code remains portable across different OpenAI-compatible services. This makes it easy to swap providers if needed. The Node.js integration supports both synchronous and asynchronous patterns. Use it for building APIs, bots, or automated workflows that require uncensored text generation.
Streaming Responses
Enable streaming by setting stream: true in your request. The API returns chunks of text as they are generated. This improves perceived latency for long responses. Each chunk contains part of the completion. The final chunk includes token usage statistics. Streaming is supported via Server-Sent Events (SSE). Use the SDK's streaming helpers to process chunks efficiently. This is useful for chat interfaces or real-time applications. Note that streaming consumes the same tokens as non-streaming. Errors can occur mid-stream, so handle interruptions. The uncensored model supports streaming by default. This feature allows you to display text incrementally. It is a standard feature in modern LLM APIs. Ensure your client code handles partial responses correctly.
Limits, Errors, and Context
The context window is 100,000 tokens total, including prompt and completion. There is no separate output cap, and if max_tokens is unset, the response can run to the end of the window. Rate limits are 300 requests per minute and 8 concurrent requests per key. Request bodies must be under 8 MB. Common errors include 401 for invalid keys, 402 for no credit, and 429 for rate limits. The model refuses sexual content involving minors. It does not refuse other lawful adult, fictional, or controversial topics. Pricing is transparent: $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors are free. Credit is prepaid and never expires. Use these limits to plan your application's scale. The API is designed for high-volume, cost-effective text generation.
cURL
curl https://api.apertus.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
from openai import OpenAI
client = OpenAI(base_url="https://api.apertus.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.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apertus.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
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)