EN ▾
Create key

API Documentation: OpenAI-Compatible Endpoints

Get started with our uncensored LLM API in minutes. Use the standard OpenAI-compatible endpoints to send requests and receive text responses.

uncensoredhttps://api.apikeykimi.com/v1

Authentication & Base URL

Access the API by setting your unique key and the base URL in your environment variables. The endpoint lives at https://api.apikeykimi.com/v1. You must include the header Authorization: Bearer YOUR_API_KEY with every request. This key is generated instantly upon signup via Google or email. It is the only credential required for authentication. No scopes or permissions need configuration.

curl https://api.apikeykimi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "convert this json object to python dictionary syntax"}]
  }'

Chat Completions Endpoint

Send messages to the model using the standard /v1/chat/completions endpoint. Specify the model ID as uncensored in the request body. The API returns generated text based on your prompt history. You can adjust parameters like temperature and top_p to control creativity. The model supports function calling and JSON mode for structured outputs.

from openai import OpenAI

client = OpenAI(base_url="https://api.apikeykimi.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 Responses (SSE)

Enable real-time token delivery by setting stream: true in your request. The server returns a Server-Sent Events stream. Each chunk contains partial text until the response is complete. This is ideal for chat interfaces and live coding displays. Token usage details appear in the final chunk of the stream.

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)

Function Calling & JSON Mode

Define tools or force JSON output using the response_format parameter. Set json_object to ensure valid JSON responses. You can also pass tool definitions for function calling. The model adheres to these constraints strictly. This allows for reliable integration with external services. Use tool_choice to control how tools are invoked.

Token Limits & Constraints

The context window supports up to 100,000 tokens for input and output combined. The maximum output per request is 16,000 tokens. If you do not set max_tokens, the limit defaults to 2,048 tokens. Requests are capped at 8 MB in body size. You are limited to 300 requests per minute. Only 8 requests can run simultaneously per key.

Error Handling & Usage Limits

Handle errors by checking the HTTP status code. A 401 indicates an invalid or expired API key. A 402 error means your prepaid credit is exhausted. A 429 response signals that you have exceeded the rate limit of 300 requests per minute. Errors and refusals do not consume tokens. Check your balance on the dashboard to avoid interruptions.

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apikeykimi.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);

Frequently asked questions

What is the base URL for the kimi apikey endpoint?

The base URL is HTTPS://api.apikeykimi.com/v1. You must include your API key in the Authorization header. This endpoint is compatible with standard OpenAI clients.

How do I handle streaming responses in Python?

Set the stream parameter to true in your request. The API returns a stream of events. Each event contains a part of the generated text. You can process these events in real-time.

What happens if I exceed the rate limit?

You will receive a 429 Too Many Requests error. The limit is 300 requests per minute. You must wait until the window resets. Consider batching requests or reducing concurrency to stay within limits.

Access key in seconds

Register, retrieve key, update base URL. Setup is complete.

Create key