Integrate the codex api quickly
The uncensored LLM API is ready for immediate integration with standard OpenAI-compatible clients. Get your codex API key and start sending requests to a dedicated model that handles adult content without refusals.
Base URL and authentication header
Start every request by pointing your client to the dedicated base URL. This endpoint accepts standard headers and replaces the default OpenAI proxy without requiring code changes in most SDKs.
- Base URL:
https://api.apicodex.cc/v1 - Auth header:
Authorization: Bearer YOUR_API_KEY
The API key is generated instantly upon signup. You can rotate keys if needed, but each account holds only one active key at a time.
curl https://api.apicodex.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "fix syntax error in python loop"}]
}'
POST /v1/chat/completions parameters
Send text completion requests using the standard chat format. The model ID is always uncensored and accepts parameters like temperature and top_p for controlling creativity.
- Context window: 100,000 tokens total.
- Max output: 16,000 tokens per request.
- Default max_tokens: 2,048 if not specified.
Input and output tokens are billed separately. Errors do not consume credit.
from openai import OpenAI
client = OpenAI(base_url="https://api.apicodex.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)
GET /v1/models endpoint details
Query available models to confirm connectivity. This endpoint returns metadata about the uncensored model hosted on our servers.
- Model ID:
uncensored - Type: chat-completion
Use this endpoint to verify your API key works before sending heavy payloads. It returns immediately with low latency.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apicodex.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 responses and token usage
Enable streaming by setting stream: true. The server sends Server-Sent Events (SSE) for each token generated. Token usage statistics appear in the final chunk of the stream.
- Real-time token delivery.
- Final chunk contains usage data.
Streaming reduces perceived latency for large outputs. Monitor the final chunk to calculate exact costs.
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)
JSON mode and function calling
Request structured output by setting response_format to {"type": "json_object"}. This forces the model to return valid JSON without markdown wrappers.
- Function calling: supported via standard tools format.
- Tool choice: configurable.
JSON mode is ideal for parsing data into applications. Function calling enables agent workflows with external tools.
Error handling and rate limits
Handle errors by checking standard HTTP status codes. A 401 error means your API key is invalid or missing. A 402 error indicates insufficient prepaid credit. A 429 error signals that you have exceeded the rate limit.
- Rate limit: 300 requests per minute per key.
- Concurrent requests: max 8 per key.
- Max request body: 8 MB.
Refunds are not issued for credit, but errors are free. Contact support for billing issues.
Common questions
What is the base URL for the codex API?
The base URL is HTTPS://api.apicodex.cc/v1. Use this endpoint with any OpenAI-compatible SDK by updating the base_url configuration.
How much context does the uncensored LLM support?
The model supports a 100,000 token context window for both prompt and completion. The maximum output per request is 16,000 tokens.
What happens if I get a 402 error?
A 402 error means your prepaid credit is exhausted. Top up using USDT (TRC20) or USDC (Base) to resume service. Errors do not consume credit.
Get your API key
Sign up, copy the token, and point your client to our base URL. Done.