chatbotapis.comDocs
Chatbot API Quickstart Guide
Get started with the Chatbot API in minutes. This guide covers authentication, basic requests, streaming, and tool calling using our OpenAI-compatible endpoint.
Base URL & Authentication
Replace the standard OpenAI base URL with https://api.chatbotapis.com/v1 to route requests to our uncensored LLM. You authenticate using a standard API key passed in the Authorization header. Your key is generated immediately after signup on the Get API Key page and is tied to one account. You can regenerate the key at any time, which revokes the previous one instantly. There is no need for a credit card to start, and the trial credit lasts for 7 days.
Basic Completion Request
Send a standard chat/completions request to get text output. The model ID is always uncensored. This API supports text input and text output with a 100,000 token context window. Use this endpoint for direct LLM interactions without embeddings or image generation.
curl https://api.chatbotapis.com/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."}]
}'The response includes the generated text in the content field. If your key is invalid, you get a 401 error. If you have no prepaid credit, you get a 402 error.
Python SDK Quickstart
Install the official OpenAI Python library and point it to our base URL. This allows you to use the same SDK you already know for OpenAI, but access our uncensored model directly. Set the api_key and base_url before making requests.
from openai import OpenAI
client = OpenAI(base_url="https://api.chatbotapis.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)This setup works for both simple completions and complex tool calling. The SDK handles the JSON formatting automatically. Remember that prompts are not used for training your account data.
Node.js SDK Integration
For JavaScript developers, the Node.js OpenAI SDK works identically. Initialize the client with your key and the specific base URL for ChatBotApis. This is useful for building backend services or serverless functions that need raw LLM output.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.chatbotapis.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);Ensure you handle errors properly. A 429 status code means you have hit the rate limit of 300 requests per minute. A 400 error usually indicates a malformed request body or exceeding the 8 MB limit.
Streaming Responses via SSE
Use Server-Sent Events (SSE) for low-latency text generation. Set stream: true in your request. The API returns chunks of text as they are generated, allowing your application to display tokens in real-time. This reduces perceived latency significantly compared to waiting for the full response.
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)Stream mode works with both the Python and Node SDKs. It is ideal for chat interfaces where users expect instant feedback. The context window still applies to the total prompt plus completion tokens.
Rate Limits, Errors & Context
Our API enforces strict limits to ensure stability. You are allowed 300 requests per minute per key. The maximum request body size is 8 MB. If you exceed the limit, you receive a 429 error. The context window is 100,000 tokens, counting both input and output. This model is uncensored for lawful adult use but blocks sexual content involving minors. There are no SLA guarantees or certifications, but the pricing is transparent and prepaid credit never expires.
API specifications
Before you integrate, here is exactly what you get with a key.
| Spec | Value |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Model | uncensored |
| API key | Bearer token in the Authorization header |
| Base URL | https://api.chatbotapis.com/v1 |
| Context window | 100,000 tokens (prompt + completion together) |
| Structured output | JSON object mode via response_format json_object |
| Streaming | Yes — server-sent events; the last chunk carries token usage |
| Max output | 16,000 tokens max; 2,048 if max_tokens is not set |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Request size | up to 8 MB per request |
| Rate limit | 300/min per key |
| Concurrency | up to 8 in parallel per key |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Price | $0.25 per 1M input tokens · $1.00 per 1M output tokens |
| Trial credit | $0.50 of credit valid 7 days, no card needed |
| Credit expiry | no monthly fee; paid credit does not expire |
| Bonus credit | +5% on $50+, +10% on $100+ |
| Top-up | USDT (TRC20) or USDC (Base), any whole amount from $10 to $500 |
| Keys | one active key per account; a new key replaces the old one |
| Sign-in | sign in with Google or with e-mail + password |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
Errors and what to do
The type field is stable, the message is for humans. Errors cost nothing.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | sexual content involving minors — refused, not billed |
404 | not_found | unknown endpoint |
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
Is this the official OpenAI API?
No. We are an independent service that uses the OpenAI-compatible API format. Our model is an open-weight model hosted on our own servers, not GPT-4 or GPT-3.5.
How do bonus credits work?
You receive +5% bonus credit when you top up $50 or more, and +10% when you top up $100 or more. Credits are added to your prepaid balance and never expire.
What happens if I regenerate my API key?
The old key is immediately revoked and can no longer be used. The new key is valid instantly. You do not lose any prepaid credit or history by changing keys.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
ChatBotApis
chatbotapis.com