How to use an uncensored model with the OpenAI SDK | Rend
To use an uncensored model with the OpenAI SDK, point the client at an OpenAI-compatible provider that offers one, set its model id and add the provider's uncensored switch to the request body. On the Rend API, use the base URL https://api.rend.ai/v1 and a model such as rend-1, and send "uncensored": true from an account that has confirmed it is 18 or over.
Most guides skip how the flag gets sent. The OpenAI SDK has no uncensored parameter, so Python has to send it through extra_body and TypeScript needs a type override. If you get that wrong, the SDK either rejects the call or sends it without the flag. This guide covers each step, with code for curl, Python and JavaScript, and the two error codes to plan for.
What do you need before you start?
The Rend API is in early access on the rend-1 page. It follows the OpenAI chat-completions format, with POST /chat/completions and GET /models, so the official OpenAI SDKs work once you change the base URL.
You need:
- A Rend account that has confirmed it is 18 or over (you do this once, in rend.ai/chat)
- An API key starting with
rnd_api_, created in Settings, Connections, Rend API - Python with pip, Node.js with npm, or curl
Prices for each model are on the Rend facts page, which shows the current numbers. We don't repeat them here because they change.

Which Rend model should you pick?
The Rend API offers three model ids: rend-1, rend-1-regular and rend-pro. Each has a context window of 1M tokens and accepts up to 10 images and 128 tools per request.
| Model id | Context window | Max output per response |
|---|---|---|
| rend-1 | 1M tokens | 131,072 tokens |
| rend-pro | 1M tokens | 128,000 tokens |
| rend-1-regular | 1M tokens | See GET /models and the facts page |
rend-1 is our own writing model for hooks, scripts and ad copy, and it can search the web while it writes. Start there if your job is marketing copy. Compare the other two on the facts page before you commit a pipeline to one.
Set up your account and key
- Confirm that your account is 18 or over in Rend chat. You only do this once per account. Until you do, any request with
"uncensored": truereturns403 adult_confirm. - Create an API key in Settings, Connections, Rend API. Check that the value you copied starts with
rnd_api_. - Store the key in an environment variable so it stays out of your code and your repository.
export REND_API_KEY="rnd_api_your_key_here"
Connect the OpenAI SDK to Rend
- Install the OpenAI SDK, with
pip install openaifor Python ornpm install openaifor Node.js. - Set the client's base URL to
https://api.rend.ai/v1and pass your key. The SDK sends the key as a Bearer token. - List the models to check the key and URL before you send a real prompt. If you see
rend-1in the output, the connection works.
Python:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.rend.ai/v1",
api_key=os.environ["REND_API_KEY"],
)
for model in client.models.list():
print(model.id)
curl:
curl https://api.rend.ai/v1/models \
-H "Authorization: Bearer $REND_API_KEY"
How do you send the uncensored flag with the OpenAI SDK?
- Add
"uncensored": trueto the body of a/chat/completionsrequest. How you do this depends on the client, because the flag is a Rend field and the SDK has no named parameter for it.
curl
With curl, the flag is one more key in the JSON body.
curl https://api.rend.ai/v1/chat/completions \
-H "Authorization: Bearer $REND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "rend-1",
"uncensored": true,
"messages": [
{"role": "user", "content": "Write three blunt hooks for a hangover drink ad."}
]
}'
Python
The Python SDK raises an error if you pass uncensored=True as a keyword. Put it in extra_body instead, and the SDK merges it into the JSON it sends.
resp = client.chat.completions.create(
model="rend-1",
messages=[
{"role": "system", "content": "You write ad copy for an adult audience."},
{"role": "user", "content": "Write three blunt hooks for a hangover drink ad."},
],
max_tokens=400,
extra_body={"uncensored": True},
)
print(resp.choices[0].message.content)
JavaScript and TypeScript
The Node SDK posts the object you pass as the request body, so plain JavaScript can include the field directly. In TypeScript the compiler flags uncensored as an unknown property, so mark that line.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.rend.ai/v1",
apiKey: process.env.REND_API_KEY,
});
const resp = await client.chat.completions.create({
model: "rend-1",
// @ts-expect-error uncensored is a Rend field (remove this line in plain JS)
uncensored: true,
messages: [
{ role: "user", content: "Write three blunt hooks for a hangover drink ad." },
],
});
console.log(resp.choices[0].message.content);
You know the call worked when you get a normal completion back with text in choices[0].message.content. A 403 means the account check is missing, which the next section explains.
Common mistakes and how to spot them
Most failures come from the flag, the base URL or the account check. Find the symptom in the table, then apply the fix.
| What you see | Cause | Fix |
|---|---|---|
| Python error: unexpected keyword argument 'uncensored' | The flag was passed as a Python keyword | Move it into extra_body={"uncensored": True} |
| TypeScript error: 'uncensored' does not exist in type | The typed params reject unknown fields | Add the @ts-expect-error line or cast the params object |
| 401 invalid API key | The client still points at the SDK's default URL | Set base_url (Python) or baseURL (JS) to https://api.rend.ai/v1 |
| 403 adult_confirm | The account has not confirmed it is 18 or over | Confirm once in Rend chat, then send the request again |
| 503 | A busy moment on our side | Retry with a short wait (see below) |
finish_reason is length | max_tokens cut the answer short | Raise it, up to 131,072 on rend-1 or 128,000 on rend-pro |
Retrying a 403 changes nothing. The account check happens in Rend chat, outside the API, so the request will keep failing until it is done.
When you build a wrapper or use a framework, make sure it passes the extra body field through. A library that rebuilds the request from known OpenAI fields can drop uncensored without warning, and the request then runs without the flag.
How do you handle 503 errors from the Rend API?
The Rend API has no per-account rate limit, so a 503 points to a busy moment on our side and says nothing about how many requests you send. Retry the same request after a short wait.
The OpenAI SDK already retries server errors on its own before it raises one. You can give it more attempts when you create the client, and you don't need a second retry loop on top:
client = OpenAI(
base_url="https://api.rend.ai/v1",
api_key=os.environ["REND_API_KEY"],
max_retries=5,
)
If you write your own retry loop, set max_retries=0 so the two loops don't add up.
To log a 403 clearly in Python, catch the SDK's permission error and print the body:
from openai import PermissionDeniedError
try:
resp = client.chat.completions.create(
model="rend-1",
messages=[{"role": "user", "content": "Test"}],
extra_body={"uncensored": True},
)
except PermissionDeniedError as e:
print(e.status_code, e.body)
What does uncensored mode still refuse?
Uncensored mode on the Rend API keeps hard limits that the flag does not change:
- Anything sexual involves adults only.
- No content that sexualises minors.
- No real people without their consent.
- No harassment.
- No copyright infringement.
Build these limits into your product rules as well. If your app lets end users write prompts, your terms and moderation have to cover these limits, because the flag is set on your account and your key.
When should you stop and contact us?
Email support@rend.ai if a 403 continues after you have confirmed your age in Rend chat, if 503 errors continue past several retries, or if Settings, Connections does not show a Rend API option for your account. Include the model id, the error code and the time of the request. Never send the key itself.
Where Rend fits if you make video or ads
Most people who call rend-1 are writing hooks, scripts or ad copy, and that text usually ends up in a video. The same account gives you an AI video agent. You describe the video you want, and a crew of specialist agents takes it from idea to export on a timeline you can open and change by hand. You can browse the tools the video agent uses, including captions, voice, music and export.
If you already work in Claude or ChatGPT, you can connect it to Rend in one line, and Rend gives it storage, rendering and every tool. Editing is free, and you pay only when Rend renders or generates something. Projects run in a browser, so you don't need to install anything or have a local GPU. To check ad formats before you render, use the video ad size and safe zone checker.
Create a free Rend account to get an API key, or compare Rend plans and credits if you expect to render video as well.
Frequently asked questions
Do I have to confirm my age again for each new API key?
No. The 18+ confirmation happens once per account in Rend chat. After that, "uncensored": true works from keys on that account. Before it, every uncensored request returns 403 adult_confirm.
How much does the Rend API cost per request?
Current per-model prices are on the Rend facts page, and that page is kept up to date. We don't quote numbers in this guide because they change. Plans and credit top-ups are on the pricing page.
Can I use the Rend API with tools other than the OpenAI SDK?
The Rend API follows the OpenAI chat-completions format, so a tool that accepts a custom base URL can connect to it. The tool also has to let you add the uncensored field to the request body. If it can't, your requests run without the flag.
How many images and tools can one Rend API request include?
One request can include up to 10 images and 128 tool definitions. The context window is 1M tokens for input and conversation. Output per response goes up to 131,072 tokens on rend-1 and 128,000 on rend-pro.
Does the Rend API have a rate limit?
There is no per-account rate limit. When the service is busy, a request can return 503, so give the SDK enough retries or add your own wait and retry.
Is the Rend API ready for production use?
The Rend API is in early access. Plan for 503 retries, and email support@rend.ai if something blocks you.