API Quickstart
Start generating text with the openai compatible API in minutes. You only pay for tokens used, no minimum spend required.
Base URL and authentication
Configure your client to point to the correct endpoint and provide your key. Use https://api.getcheapai.cc/v1 as the base URL. Pass your API key in the Authorization header using the Bearer scheme. This setup works with any standard OpenAI-compatible SDK.
Sending your first request
Make a simple POST request to generate text. The model id is uncensored. Send a prompt and receive a completion. Errors and refusals are free, so you only pay for actual tokens. Use the curl example below to test connectivity.
curl https://api.getcheapai.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Generate 500 lines of dummy JSON data"}]
}'
Python SDK integration
Initialize the client with your key and the base URL. Set the model to uncensored. Pass messages in the standard format. The SDK handles serialization automatically. This approach reduces boilerplate code significantly.
from openai import OpenAI
client = OpenAI(base_url="https://api.getcheapai.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)
Node SDK usage
Import the library and configure the base URL. Call chat.completions.create with your messages. Handle the response asynchronously. This pattern fits well into modern JavaScript environments.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.getcheapai.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);
Streaming responses
Enable streaming by setting stream: true. Receive tokens as they are generated. This improves perceived latency for large outputs. The final chunk contains token usage statistics for billing.
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 and error handling
Handle specific HTTP status codes to manage your application flow. A 401 means your key is invalid. A 402 indicates insufficient credit. A 429 signals you hit the 300 requests per minute limit. The context window is 100,000 tokens total. Errors do not consume tokens.
Common questions
What is the getcheapai base URL?
Use HTTPS://api.getcheapai.cc/v1 for all requests. This endpoint supports standard OpenAI-compatible protocols.
How do I pay for tokens?
Top up with USDT or USDC. Credit never expires and you only pay for used tokens.
What happens if I get an error?
Errors like 429 or 400 do not charge tokens. You only pay for successful completions.
Get your API key now
Sign up, grab your key, and update your endpoint URL. That is it.