Character api Integration Quickstart
This quickstart gets your character API working with standard OpenAI SDKs in minutes. You will configure the base URL, inject your API key, and send your first uncensored request.
Install the SDK
Start by installing the official client library for your language. This ensures compatibility with the OpenAI-compatible endpoint we provide. The library handles serialization and retry logic for you.
For Python, use pip. For Node.js, use npm. This step takes seconds and sets up the environment for the code samples that follow.
Configure Your Base URL
Point your SDK client to our endpoint to access the uncensored model. The base URL is HTTPS://api.apicharacter.com/v1. This replaces the default OpenAI URL in your configuration.
Without this change, requests will fail or hit the wrong service. You only need to set this once when initializing your client instance.
Set Your API Key
Inject your key into the environment variable or client config. Authentication is required for every request to track your prepaid credit usage. Your key grants access to the uncensored LLM endpoint.
Keep this value secure. It acts as your sole credential for the account. No phone number or additional verification is needed for basic access.
Make Your First Request
Send a simple chat completion to verify connectivity. The model ID is "uncensored". This confirms your authentication and base URL are correct before you build your application.
See the example below for a standard cURL request.
curl https://api.apicharacter.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "set my name to Alex"}]
}'
Handle Streaming Responses
Enable streaming for lower latency in your chat interfaces. Set the stream parameter to true in your request. The SDK will yield tokens as they are generated.
This is critical for responsive user experiences. You handle the partial chunks as they arrive via Server-Sent Events.
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, and Context
Understand your constraints to avoid service interruptions. You get 100,000 tokens context window. Max output is 16,000 tokens unless you specify otherwise.
Rate limit is 300 requests per minute. A 401 error means invalid key. A 402 means zero credit. A 429 means you hit the rate limit. Keep these in mind for production scaling.
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.apicharacter.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.apicharacter.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);FAQ
How do I get my character API key?
Sign up with Google or email on the dashboard. Your API key appears immediately without phone verification. You can generate a new key if needed, replacing the old one.
Is this an openai compatible API?
Yes, it follows the standard chat-completions format. You just need to change the base URL and API key. Most OpenAI SDKs work out of the box with minor config changes.
What happens if I get a 402 error?
It means your prepaid credit is exhausted. Top up via crypto to resume service. Errors and refusals do not consume credit, so you only pay for actual usage.
Get your key instantly
Sign up, grab your key, update the base URL. That’s it.