First request in five minutes
Drop your Kimi API key into any OpenAI-compatible client and start generating uncensored text. This guide shows you exactly how to configure your SDK and understand the real token pricing.
Install OpenAI Python/Node SDK
Start by installing the standard OpenAI client library. This works because our API follows the same OpenAI-compatible interface. You do not need a special vendor SDK. Just run pip install openai for Python or npm install openai for Node.js. The library handles the JSON serialization and HTTP requests automatically.
Configure Base URL and API Key
Point your client to our endpoint. Set the base URL to https://api.kimiapi.top/v1 and provide your API key from the dashboard. This key authenticates your prepaid credit. You can generate a new key instantly via Google or email on the signup page. No credit card is required to start.
curl https://api.kimiapi.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Send Your First Chat Completion
Send a simple message to the uncensored model. This model is tuned to answer without refusals for lawful adult use. It supports a 100,000-token context window, with no separate output cap. The response returns text directly. Errors and refusals do not consume your credit.
from openai import OpenAI
client = OpenAI(base_url="https://api.kimiapi.top/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)
Enable Streaming with SSE
For real-time responses, enable streaming. The SDK streams tokens via Server-Sent Events (SSE). The final chunk contains the total token usage for billing. This approach reduces perceived latency for long outputs. You can process each token as it arrives in your application logic.
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)
Use JSON Mode for Structured Output
Ensure consistent machine-readable output by setting response_format to {"type": "json_object"}. This forces the model to return valid JSON. It is ideal for data extraction or configuration generation. The model will not break structure, making it easier to parse responses in your code.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.kimiapi.top/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);
Check Usage and Costs
Monitor your usage via the dashboard. Input costs are $0.15 per million tokens; output is $0.50 per million tokens. If you receive a 401, check your key. A 402 means you need to top up by crypto (USDT on TRC20, USDC on Base). A 429 indicates you hit the 300 requests per minute limit. Credit never expires, so top up when convenient.
Specs at a glance
If your tool speaks the OpenAI API, these are the details that matter.
| Item | Value |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.kimiapi.top/v1 |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Authentication | Authorization: Bearer YOUR_KEY |
| Model ID | uncensored |
| Max context | 100,000 tokens (prompt + completion together) |
| JSON mode | JSON object mode via response_format json_object |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| SSE streaming | Supported (stream: true), usage included at the end |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Rate limit | 300/min per key |
| Parallel requests | up to 8 in parallel per key |
| Max body | 8 MB request body |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Billing | prepaid credit, charged by real token usage; errors and refusals are free |
| Subscription | paid credit never expires, no subscription |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Trial credit | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Bonus credit | +5% on $50+, +10% on $100+, +15% on $200+ |
| Sign-in | Google or e-mail and password |
| Key management | one key per account, regenerate any time (the old one stops working) |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
Errors and what to do
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
How does billing work for the Kimi API?
You pay only for real token usage. Input tokens cost $0.15 per million, and output tokens cost $0.50 per million. Errors and refusals are free. Credit is prepaid and never expires.
What crypto payments are accepted?
We accept top-ups by crypto (USDT on TRC20, USDC on Base). Top-ups range from $20 to $500.
What is the context window limit?
The model supports a 100,000-token context window for both prompt and completion. The output can run to the end of the window unless you specify a lower limit.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.