API Documentation for Developers
This guide helps developers integrate our uncensored, OpenAI-compatible API for adult content generation. Use our single model endpoint with standard SDKs to bypass content filters.
Authentication & Base URL
Your API key authenticates every request. Pass it in the Authorization header as a bearer token. The base URL is https://api.keyapiglm.com/v1. This endpoint works with any OpenAI-compatible client. You can replace the standard OpenAI base URL in your code. Our service handles the routing to our uncensored model.
First Request
Send a POST request to /v1/chat/completions. Include your model ID and prompt. The response contains the generated text. You can start with a simple text completion. Our API returns raw tokens without extra formatting.
curl https://api.keyapiglm.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Verify endpoint latency for high traffic loads"}]
}'
Verify your key works immediately. Check the response for the choices array. Each choice has a message with your generated content. Errors return standard HTTP codes.
Python SDK Integration
Install the openai package. Set the base URL to our endpoint. Initialize the client with your API key. Call the chat.completions.create method. Pass the model ID uncensored. This works with existing OpenAI code. No extra wrappers needed.
from openai import OpenAI
client = OpenAI(base_url="https://api.keyapiglm.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)
Handle the response object. Extract the text from the first choice. Your script runs smoothly. Debugging is easy with standard logging.
Node SDK Setup
Import the OpenAI client in Node. Configure the base URL. Pass your key to the constructor. Call the chat completion function. Use the same model ID. This approach saves time. You reuse familiar patterns. The API responds quickly.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.keyapiglm.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);
Log the generated text. Check for errors in the catch block. Your Node app integrates seamlessly. No custom HTTP clients required. Standard JSON responses arrive as expected.
Streaming Responses (SSE)
Enable streaming by setting stream: true. The API sends Server-Sent Events. Each chunk contains partial text. Concatenate these chunks for the full response. This reduces perceived latency. Users see text appear instantly.
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)
Handle each chunk in your event loop. The final chunk includes token usage. Stop streaming when the model finishes. This method works with any SSE client. Your UI updates in real time.
Limits & Errors
Rate limits are 300 requests per minute. Concurrent requests max out at 8 per key. Request bodies cannot exceed 8 MB. Context window is 100,000 tokens. Errors return standard codes. Use 401 for invalid keys. Use 402 for insufficient credit. Use 429 for rate limits. Check the response body for details. Retry logic handles temporary issues. Your integration stays stable.
Frequently asked questions
Which payment methods do you accept?
Crypto only: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500. Bonus credit applies from $50.
Is this the GLM API?
No, we run our own uncensored model. It is compatible with OpenAI clients. Use our base URL and key. Our model is not GLM or any other vendor's product.
What is the context window?
The context window is 100,000 tokens. This includes prompt and completion. Max output is 16,000 tokens. Errors and refusals do not cost tokens.
Get your API key
Sign up, copy your key, update your base URL. That is all you need to do.
Open account