Cheap KIDocs
API Reference and Quickstart
Get your uncensored LLM API key and start generating text in seconds. This quickstart guide covers authentication, Python and Node SDKs, streaming, and error handling for your first integration.
Authentication and base URL
Use the provided API key in the Authorization header when calling the https://api.cheapki.com/v1 base URL. You receive one active key per account, and generating a new key immediately invalidates the previous one. Keep this credential secure because it deducts from your prepaid credit on every successful request. The system validates the key before processing your prompt, ensuring that billing starts only when the server accepts your job.
The chat completions endpoint
Send a POST request to /v1/chat/completions with your messages array to generate text. This endpoint handles standard chat formats, accepting system prompts and user inputs in a single payload. You must specify the model ID as uncensored to route the request to our open-weight server. The API returns a structured JSON object containing the assistant's reply and token usage statistics.
from openai import OpenAI
client = OpenAI(base_url="https://api.cheapki.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)Use the official OpenAI SDK or any compatible client library to simplify the request construction. Pass your API key as the client parameter and set the base URL to point to our hosted endpoint. This approach ensures compatibility with existing codebases while leveraging our uncensored model capabilities.
Model parameters and settings
Control generation behavior using parameters like temperature, top_p, and seed to adjust randomness and reproducibility. Set max_tokens to limit output length, keeping in mind it is optional. You can enforce strict JSON output by setting response_format to {"type": "json_object"}, which is ideal for programmatic integrations. The model supports a context window of 100,000 tokens, combining both prompt and completion usage.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.cheapki.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);Adjust these settings to balance creativity and precision based on your specific use case. Lower temperatures yield more deterministic responses, while higher values introduce variety. Always monitor your token consumption to stay within your prepaid credit limits.
Streaming and function calling
Enable streaming by setting stream to true to receive token-by-token updates via Server-Sent Events. This reduces perceived latency for end-users by displaying text as it generates. You can also define function schemas in the tools array to allow the model to call external utilities. The API returns tool calls as structured objects that your code can execute and feed back into the conversation.
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)Combine streaming with tool use for complex agents that need real-time feedback and external data retrieval. Each stream chunk includes usage data in the final piece, allowing you to track token consumption accurately during long-running sessions. This method is efficient for chat interfaces where immediate partial results improve user experience.
Limits, errors, and context window
Handle standard HTTP error codes to manage your integration gracefully. A 401 status indicates an invalid or expired API key, requiring you to regenerate credentials. A 402 error means your prepaid credit is exhausted, and you must top up via crypto to continue. Rate limits enforce 300 requests per minute and a concurrency of eight simultaneous requests per key. Exceeding these limits triggers a 429 error, so implement exponential backoff in your client logic.
The context window allows 100,000 tokens total, but each request is capped at 8 MB for the body. Errors and refusals do not consume your credit, so failed requests are free. Keep your prompts concise to maximize the effective context length for long conversations.
Token pricing and billing
Pay only for what you use with transparent rates of $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credit is prepaid and never expires, so you can top up whenever convenient without monthly fees. We accept only USDT on TRC20 or USDC on Base for top-ups, ranging from $20 to $500 per transaction. Bonus credit applies automatically: +5% for $50, +10% for $100, and +15% for $200.
cURL
curl https://api.cheapki.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate markdown for a Rust struct"}]
}'FAQ
How do I get started with the cheap ki uncensored LLM API?
Sign up with Google or email to receive a trial credit of $0.50 valid for seven days. Use the provided API key to make your first request to the chat completions endpoint. Top up with crypto whenever you need more credit for production usage.
Is this API compatible with OpenAI SDKs?
Yes, it is fully OpenAI-compatible. You can use the official OpenAI SDKs or any client that supports the standard chat completions format. Just update the base URL and API key in your configuration.
What happens if my request exceeds the rate limit?
You will receive a 429 Too Many Requests error. The limit is 300 requests per minute per key with a concurrency of eight. Implement exponential backoff in your code to retry after a short delay.
https://api.cheapki.com/v1uncensored
Start with free credits
Enter email and password, then get your key immediately.