Base URL and Authentication
Authentication requires a single API key passed in the Authorization header.
Every request must target the base URL https://api.dolphinaisincensura.com/v1 and include the key as Bearer YOUR_API_KEY.
This setup works with any OpenAI-compatible SDK by simply updating the base_url configuration.
Errors like 401 indicate an invalid or missing key, while 402 signals insufficient prepaid credit.
curl https://api.dolphinaisincensura.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list the python imports for requests and json"}]
}'
Sending a Chat Completion
Send a POST request to /v1/chat/completions with a model field set to uncensored.
Include a messages array containing your prompt history to maintain conversation context.
The API returns a text response directly in the content field of the first choice.
This single-model approach eliminates proxy fees and ensures predictable pricing at $0.15 per 1M input tokens.
from openai import OpenAI
client = OpenAI(base_url="https://api.dolphinaisincensura.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)
Handling Streaming (SSE)
Enable streaming by setting stream to true in your request payload.
The server responds with Server-Sent Events (SSE) that deliver tokens incrementally.
Parse each SSE chunk to extract the generated text without waiting for the full response.
Token usage statistics are provided in the final chunk of the stream for accurate 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)
Function Calling and JSON Mode
Use the tools parameter to define function schemas for structured data extraction.
Set response_format to {"type": "json_object"} to force strict JSON output for reliable parsing.
Specify temperature and top_p to control creativity versus determinism in your results.
These features allow you to build autonomous agents that interact with external APIs or databases.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.dolphinaisincensura.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);
Understanding Token Limits and Context
The context window supports 100,000 tokens for both prompt and completion combined.
The maximum output per request is 16,000 tokens, or 2,048 if max_tokens is unset.
Rate limits allow 300 requests per minute and 8 concurrent requests per API key.
Requests exceeding the 8 MB body limit or hitting concurrency caps return 429 errors.
Error responses and refusals do not consume your prepaid credit.
Rate Limits and Concurrency
Each API key is limited to 300 requests per minute and 8 simultaneous active connections.
A 429 status code indicates you have exceeded these concurrency or rate thresholds.
You can generate a new key to replace an existing one, but only one active key is allowed per account.
Monitor your usage via the response headers to stay within the 8 MB request body limit.