es ▾
Create key

OpenAI-Compatible API Documentation

Get started with our uncensored LLM API in minutes. Swap your base URL and API key to run standard OpenAI-compatible client code against a single, unrestricted model.

Base URL & Authentication

The base URL for all requests is https://api.kimikeyapi.com/v1. You authenticate by passing your api-key in the HTTP header. This standard header works with the official OpenAI SDKs and any compatible client library. Your API key is shown immediately after signup via Google or email. Keep this key secure, as it controls your prepaid credit. You only need one active key per account; generating a new one replaces the old.

Chat Completions Endpoint

Send your prompts to POST /v1/chat/completions. The model ID to use is uncensored. This endpoint accepts standard message structures and returns text completions. It supports function calling and JSON mode for structured outputs. You can configure parameters like temperature and top_p to control creativity. Errors and refusals do not consume credit, so you can test freely. The maximum output length is 16,000 tokens per request.

curl https://api.kimikeyapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Check current server status and uptime metrics"}]
  }'

Python SDK

Use the official openai Python package to integrate quickly. Set the base URL to our endpoint and provide your API key. The client handles authentication and request formatting automatically. You can stream responses or retrieve full text in one call. This approach works seamlessly with existing codebases that target OpenAI. No special headers are required beyond the standard authorization token. The SDK supports both sync and async operations for high-volume workloads.

from openai import OpenAI

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

Node SDK

Initialize the OpenAI Node client with your custom base URL. Pass the API key in the configuration object. The client mirrors the OpenAI interface, allowing you to call chat.completions.create. This method works with any standard JavaScript or TypeScript project. You can configure timeouts and retries as needed. The response includes token usage details in the final chunk when streaming. This setup ensures your code remains portable across different LLM providers.

import OpenAI from "openai";

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

Streaming & Token Usage

Enable streaming by setting stream: true in your request. The API returns data in real-time chunks. Token usage statistics are included in the final chunk of the stream. This allows you to track costs without waiting for the full response. Streaming is ideal for interactive applications and chat interfaces. You can process tokens as they arrive to reduce perceived latency. The SSE format is standard and widely supported by client libraries.

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)

Limits, Errors & Context Window

Your context window is 100,000 tokens for prompt and completion combined. The rate limit is 300 requests per minute per key. Concurrent requests are capped at eight per key. A 401 error indicates an invalid or expired API key. A 402 error means your prepaid credit is exhausted. A 429 error signals that you have exceeded the rate limit. Request bodies must not exceed 8 MB. Credit never expires, so you can top up anytime using crypto.

Frequently asked questions

Does the API key kimi alternative work with standard OpenAI SDKs?

Yes, it is fully compatible with the official OpenAI SDKs and any client that supports the standard base URL and header format. You only need to update the base URL and API key in your configuration. This allows you to swap in our uncensored model without changing your application logic.

What happens if I get a 402 error?

A 402 error indicates that your prepaid credit has been exhausted. You can top up immediately using USDT on TRC20 or USDC on Base. Credit never expires, so you can resume your work at any time without losing your previous data or settings.

How large is the context window?

The context window supports 100,000 tokens for both the prompt and the completion combined. This allows you to process large documents or long conversations in a single request. The maximum output per request is 16,000 tokens, which can be adjusted via the <code>max_tokens</code> parameter.

Get your API key

Sign up, copy the key, update your base URL. Simple as that.