API queen API documentation
Get started with the uncensored LLM API by authenticating with your API key and sending requests to the OpenAI-compatible endpoint.
https://api.apiqueen.cc/v1
Base URL and Authentication
Authentication uses a standard Bearer token passed in the Authorization header. This approach ensures compatibility with existing OpenAI SDKs without requiring custom logic. Your API_KEY is generated instantly upon signup via Google or email. All requests must point to the specific base URL provided for the service.
- Base URL:
https://api.apiqueen.cc/v1 - Header:
Authorization: Bearer API_KEY
curl https://api.apiqueen.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Return current status for service api queen"}]
}'
Sending Requests to /v1/chat/completions
Send text data to the endpoint to receive direct model responses. The model ID is always uncensored, which handles diverse topics without standard refusals. You can specify parameters like temperature and top_p to control creativity. The system expects a list of messages in the standard chat format.
from openai import OpenAI
client = OpenAI(base_url="https://api.apiqueen.cc/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)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.apiqueen.cc/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);
Model Parameters: Temperature, Top-P, and Stop
Control response generation using standard LLM parameters. Set temperature between 0 and 2 for varying randomness. Use top_p to filter low-probability words. Define stop sequences to halt output at specific triggers. These settings allow precise tuning for creative writing or factual retrieval tasks.
The API ignores unsupported parameters gracefully. Focus on temperature, top_p, and stop for optimal results. Adjust these values based on your application's noise tolerance.
Streaming Responses and Token Usage
Enable streaming by setting stream: true in your request. The API returns data chunks via Server-Sent Events (SSE). Token usage details appear only in the final chunk of the stream. This allows real-time rendering of responses in your UI.
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 partial responses carefully. Ensure your client buffers data until the stream closes.
Function Calling and JSON Mode
Use function calling for structured data extraction. Define tools in the tools parameter. The model returns valid JSON when response_format is set to {"type": "json_object"}. This ensures consistent parsing in downstream applications.
Set tool_choice to force specific function calls. This is useful for automated workflows requiring strict output formats.
Error Handling and Rate Limits
Monitor HTTP status codes for common issues. A 401 error means your API key is invalid. A 402 error indicates insufficient prepaid credit. Errors do not consume your token balance. Rate limits enforce 300 requests per minute per key. Concurrent requests are capped at 8. The context window supports 100,000 tokens total.
Handle retries with exponential backoff. Check the error object in JSON responses for details.
Common queries
How much does the API queen cost?
Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credit is prepaid and never expires, with bonus credits for larger top-ups.
What is the context window size?
The model supports a 100,000-token context window, including both prompt and completion tokens. Maximum output per request is 16,000 tokens.
Is the uncensored AI model suitable for production?
Yes, it is designed for reliable text generation with standard OpenAI-compatible endpoints. It handles diverse topics without content refusals for lawful adult use.
Unlock your API key
Register, retrieve your key, and update the base URL. That is the entire configuration.