Authentication and Base URL
Place your key in the Authorization header as a bearer token.
The base URL is https://api.howtogetcodexapikey.com/v1.
Every request requires this header to validate your account.
Errors like 401 indicate an invalid key.
You get one active key per account.
Get it via Google or email.
No phone number is needed.
Use the key in your SDK configuration.
Chat Completions Endpoint
Send messages to POST /v1/chat/completions.
Use the model id uncensored.
It handles text in and text out.
No embeddings or images here.
Supports tools and JSON mode.
Adjust temperature and top_p.
Set stop sequences easily.
Stream results if you want.
Check the docs for parameters.
It is fast and direct.
curl https://api.howtogetcodexapikey.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List my active api keys for the codex service."}]
}'
Model Listing and IDs
Call GET /v1/models to see available options.
You will see the id uncensored.
It is an open-weight model.
Run on our own servers.
Not GPT or Claude.
No vendor lock-in here.
Check the endpoint for details.
It lists the model version.
Keep your client updated.
Use the standard list format.
from openai import OpenAI
client = OpenAI(base_url="https://api.howtogetcodexapikey.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 and Token Usage
Enable streaming with stream: true.
Receive data via SSE chunks.
Token usage appears in the last chunk.
Count tokens accurately.
Pay only for what you use.
Errors are free of charge.
Set max_tokens to 16000.
Default is 2048 if missing.
Handle partial responses gracefully.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.howtogetcodexapikey.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);
Error Handling and Limits
Rate limit is 300 requests per minute.
Max 8 concurrent requests per key.
Request body must be under 8 MB.
402 means you need more credit.
429 means you hit the limit.
401 means your key is wrong.
Retry with exponential backoff.
Log the error code.
Check your balance often.
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)
Context Window and Constraints
Context window is 100,000 tokens.
Includes prompt and completion.
Output max is 16,000 tokens.
Long inputs fit easily.
Refusals happen for minors only.
Adult content is allowed.
Use the right model id.
Keep your prompts concise.
Test with small chunks first.
Scale up when ready.