Dolphin AI API Quickstart
Connect your code to our uncensored LLM API using standard OpenAI-compatible endpoints. This quickstart guides you through authentication, basic requests, and streaming.
Base URL & Authentication
Start by setting your base URL and API key in your client configuration. All requests authenticate via the Authorization header using your unique key. Our service acts as an independent provider for the openrouter dolphin AI model variant, meaning you do not need an account on OpenRouter to use this endpoint. Simply grab your key from the dashboard and plug it into your environment variables.
- Base URL:
https://api.openrouterdolphinai.com/v1 - Header:
Authorization: Bearer YOUR_API_KEY
This setup works with any standard OpenAI SDK because we mimic their exact endpoint structure. You will only interact with the chat completions endpoint, keeping your integration simple and focused on text generation.
First Request
Send your first message to generate text using the simple POST method. The model ID is always uncensored, which ensures you get the specific uncensored variant tuned for unrestricted dialogue. You do not need to specify complex routing parameters since we host this single model directly.
Use the following curl command to test your connection immediately:
curl https://api.openrouterdolphinai.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Fix the syntax error in this python function"}]
}'If you receive a JSON response with content, your key is active and credits are deducted correctly. Errors like 401 indicate an invalid key, while 402 means you need to top up via crypto. This direct approach avoids the variability of multi-model routers.
Python SDK Integration
Integrate quickly using the official OpenAI Python library by pointing it to our base URL. This allows you to use familiar methods like chat.completions.create() without rewriting your entire logic. The library handles the serialization automatically, so you can focus on prompt design rather than HTTP details.
Configure the client with your base URL and key:
from openai import OpenAI
client = OpenAI(base_url="https://api.openrouterdolphinai.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)Remember that our context window is 100,000 tokens, so you can pass substantial conversation history. The SDK will handle the tokenization and transmission efficiently, ensuring your prompts reach the model without unnecessary overhead or formatting errors.
Node SDK Usage
Node developers can achieve the same results using the openai npm package. Just like the Python version, you must override the default base URL to point to our dedicated servers. This ensures your requests go directly to the uncensored model without hitting third-party rate limits or routing delays.
Initialize the client with the correct endpoint:
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.openrouterdolphinai.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);This pattern works for both synchronous calls and async/await patterns. You can stream responses or request JSON mode directly within the same function call, giving you flexibility for different application architectures without changing your core authentication setup.
Streaming Responses
Enable real-time text generation by setting stream: true in your request parameters. The API returns a Server-Sent Events (SSE) stream, allowing you to display tokens as they are generated. This reduces perceived latency for users, making the experience feel much faster than waiting for a full response.
Handle the stream chunks to accumulate the final text:
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)Each chunk includes token usage data in the final piece, so you can track costs accurately. Streaming is ideal for chat interfaces where immediate feedback improves user engagement. You can stop the stream at any time if the user sends a new message, saving credits on partial responses.
Limits, Errors & Context
Understand the technical boundaries to avoid unexpected interruptions in your application. Our API enforces a 100,000 token context window for each request, combining both prompt and completion. If you exceed the 16,000 token output limit, the generation will stop, so set max_tokens accordingly to control costs.
Common HTTP status codes include 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. You are limited to 300 requests per minute per key. These constraints ensure fair usage across all users. Use the 429 error to implement exponential backoff in your client code, ensuring smooth operation during peak traffic periods.
Frequently asked questions
Is this the same as the openrouter dolphin AI service?
No, we are an independent provider hosting the uncensored model on our own dedicated servers. You do not need an OpenRouter account, and our pricing and limits are separate from theirs. We serve the same model capabilities but with direct access and predictable latency.
What happens if I get a 402 error?
A 402 error indicates that your prepaid credit balance is zero. You can top up instantly using USDT (TRC20) or USDC (Base) via crypto. Once the transaction confirms, your credit is added immediately, and you can resume making requests without any downtime.
Can I use this for roleplay or NSFW content?
Yes, the model is uncensored and does not refuse lawful adult, fictional, or controversial topics. The only hard limit is content involving minors, which is always refused. You can use this API for unrestricted text generation without worrying about sudden content filters blocking your requests.
Get your API key
Sign up, copy the key, and update your base URL. That is all there is to it.