Integrate the Codex Key API
Get your uncensored AI API key and start generating unfiltered text in minutes with our OpenAI compatible API. This quickstart guide covers authentication, code samples, and streaming for immediate integration.
- Base URL
https://api.codexkey.cc/v1- Model
uncensored
Authentication and Base URL
Configure your client with the base URL HTTPS://api.codexkey.cc/v1 and your unique API key. You receive the key immediately after signing up via Google or email, ensuring zero friction. The standard Authorization header expects the format Bearer followed by your string.
- Header:
Authorization: Bearer YOUR_API_KEY - Endpoint:
https://api.codexkey.cc/v1
Keep your credentials secure. Each account supports one active key at a time; generating a new one invalidates the previous. This setup works with any standard OpenAI-compatible client library.
Sending Your First Request
Send a POST request to /v1/chat/completions with the model identifier "uncensored". The endpoint accepts standard parameters like temperature and max_tokens. You get direct text responses without extra metadata for simple queries.
curl https://api.codexkey.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list available endpoints"}]
}'Use the uncensored model ID to bypass standard content filters. The system processes lawful adult topics, creative writing, and research without refusal. Ensure your payload includes a messages array with your desired prompt structure.
Python SDK Integration
Install the official openai package and point it to our base URL. This approach lets you use familiar Python code to interact with the uncensored LLM. Set the base_url variable to match our endpoint.
from openai import OpenAI
client = OpenAI(base_url="https://api.codexkey.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)The SDK handles serialization automatically. You can adjust temperature for creativity or top_p for precision. This method is ideal for backend services or local scripts requiring direct text generation.
Node SDK Configuration
Initialize the Node client with the same base URL structure. This allows JavaScript and TypeScript applications to consume the API seamlessly. You can integrate it into web servers or command-line tools.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.codexkey.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);Handle errors gracefully. The API returns standard HTTP status codes for authentication or rate limit issues. This integration keeps your code clean and compatible with existing Node.js ecosystems.
Streaming Responses via SSE
Enable streaming by setting stream: true in your request. The server sends Server-Sent Events (SSE) token by token. This reduces perceived latency for end-users during long generations.
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)Token usage statistics appear in the final chunk of the stream. This feature is critical for real-time chat interfaces. You can start displaying text immediately as it arrives, rather than waiting for the full completion.
Limits, Errors, and Context Window
The model supports a 100,000 token context window for combined input and output. Max output per request is 16,000 tokens, or 2,048 if unspecified. Rate limits allow 300 requests per minute per key.
Handle 401 errors by verifying your API key. A 402 error indicates insufficient prepaid credit; top up via crypto to continue. A 429 status means you hit the rate limit; wait briefly before retrying. Errors do not consume credit, ensuring fair usage.
Frequently asked questions
What is the base URL for the codex key API?
The base URL is HTTPS://api.codexkey.cc/v1. You must configure your client libraries to point to this endpoint to access the uncensored model. This URL works with any standard OpenAI-compatible SDK.
How do I handle authentication errors?
A 401 error indicates an invalid or missing API key. Verify your key in the dashboard and ensure the Authorization header includes the Bearer prefix. The key is shown immediately upon signup, so check for copy-paste errors.
What happens if I run out of credit?
You receive a 402 error when prepaid credit is exhausted. Credit never expires, so you can top up later via USDT or USDC. Errors and refusals do not consume credit, so you only pay for actual usage.
Get your API key
Register, copy the key, update your base URL. That’s the entire configuration.