Install your preferred OpenAI-compatible SDK
Start by installing the official SDK for your language. The library handles the underlying HTTP requests, so you can focus on logic. We support any client that speaks the OpenAI protocol.
- Python: pip install openai
- Node.js: npm install openai
- Ruby: gem install openai
This ensures compatibility with our standard endpoints. You do not need to install specialized proxies or aggregators. The standard library works out of the box with our base URL.
Configure base_url and your API key
Point your SDK client to our dedicated endpoint. Change the base_url to https://api.claudeapicosts.com/v1. Use the API key you generated on our dashboard.
This configuration ensures all requests route directly to our uncensored model. No hidden routing fees apply. Your code remains identical to standard OpenAI implementations.
from openai import OpenAI
client = OpenAI(base_url="https://api.claudeapicosts.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)The base URL is the only change required. Authentication uses the standard Bearer token header.
Send your first chat completion request
Make a POST request to /v1/chat/completions. Send your prompt and set the model to uncensored. This model answers without content refusals for lawful adult use.
Use the curl command below to test connectivity. Replace YOUR_API_KEY with your actual key. The response returns a text completion.
curl https://api.claudeapicosts.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "List the current pricing tiers for the model."}]
}'This confirms your integration is working. You can now send any prompt to the uncensored model. Input tokens are charged at $0.15 per 1M.
Handle streaming responses and token usage
Enable streaming to receive tokens in real-time. Set stream: true in your request. The API uses Server-Sent Events (SSE) for delivery.
Token usage details appear in the final chunk. This allows you to track costs accurately. You can parse the last event to get the total input and output tokens.
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)Streaming reduces perceived latency. It is ideal for chat interfaces and long-form generation. The model supports a context window of 100,000 tokens.
Enable function calling and JSON mode
Use the tools parameter for function calling. This enables structured data extraction and tool use. Set response_format to {"type": "json_object"} for strict JSON output.
These features work exactly as they do with standard OpenAI models. You can define tool schemas and let the model choose actions. JSON mode ensures predictable parsing.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.claudeapicosts.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);Both features are fully supported. You can combine them for complex automation tasks. The model handles tool definitions efficiently.
Monitor your usage and prepaid credit
Track your spending via the dashboard. Credit is charged by real token usage. Errors and refusals are free. Prepaid credit never expires.
You can top up with crypto only. USDT (TRC20) or USDC (Base) are accepted. Minimum top-up is $20. Bonuses apply for larger amounts.
- $50+ adds +5% bonus credit
- $100+ adds +10% bonus credit
- $200+ adds +15% bonus credit
Monitor your balance to avoid service interruption. The dashboard shows real-time usage. No monthly fees or subscriptions.