EN ▾
Try with trial credit

Dolphin uncensored API Documentation

Dolphin uncensored provides an openai compatible API that lets you swap in our base_url and start generating text immediately. This quickstart guides you through the exact steps to connect your existing code to our hosted endpoint.

Prerequisites and Environment Setup

Start by ensuring your environment has the necessary dependencies installed before making any requests. You will need an active API key from our dashboard and a supported runtime like Python or Node.js. Our API requires you to send requests to a specific base URL rather than the default OpenAI endpoint.

Keep your API key secure and store it in an environment variable. This prevents accidental exposure in your code repository. You can generate a new key instantly after signing up with Google or email.

You do not need to configure complex routing or select specific models. The endpoint serves a single uncensored large language model designed for direct text output.

Installing the Official OpenAI SDK

Install the official SDK package to handle authentication and request formatting automatically. This library supports both Python and Node.js environments with consistent interfaces.

For Python users, run the standard pip install command to add the library to your virtual environment. Node.js developers should use npm to install the equivalent package.

The SDK manages the JSON payload structure for you, so you only need to focus on the prompt content and parameters like temperature or top_p.

You can verify the installation by importing the library in your script or module. This ensures the client is ready to connect to our servers.

Configuring Base URL and API Key

Point your SDK client to our specific base URL to route requests to our uncensored infrastructure. Use https://api.dolphinuncensored.com/v1 as your endpoint.

Set your API key in the authorization header or client configuration object. The client will attach this key to every request automatically.

Ensure you specify the model ID as "uncensored" in your configuration. This tells the server which model version to use for your generation.

Making Your First Chat Completion Request

Send a simple message to verify connectivity and receive a response. This confirms your key is valid and the endpoint is reachable.

Use the chat-completions endpoint with a system prompt and a user message. The response will contain the generated text in the content field.

Understanding Streaming and Token Usage

Enable streaming to receive tokens as they are generated rather than waiting for the full response. This improves perceived latency for long outputs.

The API returns usage statistics in the final chunk of the stream. You can track input and output token counts for billing transparency.

Set the stream parameter to true in your request body. Iterate through the chunks to build your final text or process it in real-time.

Handling Errors and Refusals

Handle HTTP 401 errors by verifying your API key is correct and not expired. A 402 error indicates insufficient prepaid credit; top up via crypto to continue.

A 429 status means you hit the rate limit of 300 requests per minute. Wait briefly before retrying or reduce your concurrency.

The model refuses requests involving sexual content with minors, which is a hard limit. Other controversial or adult topics are generally allowed. Errors and refusals do not consume your token credit.

cURL

curl https://api.dolphinuncensored.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "fetch the list of installed python packages"}]
  }'

Python

from openai import OpenAI

client = OpenAI(base_url="https://api.dolphinuncensored.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)

Node.js

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.dolphinuncensored.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);

Streaming

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)

Common questions

What is the context window size for this API?

The context window supports 100,000 tokens for both prompt and completion combined. You can generate up to 16,000 tokens per request by default.

Is this the same as the official OpenAI API?

It is OpenAI-compatible, meaning you use the same SDK code but point to our base URL. The model is uncensored and distinct from GPT models.

How do I pay for the API?

We accept USDT on TRC20 or USDC on Base.

Get your key in one step

Sign up, copy the key, update your base URL. That’s the entire configuration.

Try with trial credit