Uncensored Inference Request access

Migrate from the OpenAI API

To switch an existing OpenAI chat completions integration to an uncensored model, change three values: the base URL, the API key and the model id. The rest of your code stays the same.

The three changes

What to change
SettingBeforeAfter
Base URLhttps://api.openai.com/v1https://API_HOST/v1
API keyOpenAI keyUncensored Inference key
ModelAn OpenAI model nameThe id from GET /models

With environment variables only

The official SDKs read these variables, so many applications migrate without a code change:

export OPENAI_BASE_URL="https://API_HOST/v1"
export OPENAI_API_KEY="your-uncensored-inference-key"

In code

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://API_HOST/v1",
    api_key=os.environ["UI_API_KEY"],
)

reply = client.chat.completions.create(
    model="MODEL_ID",  # listed by client.models.list()
    messages=[{"role": "user", "content": "Summarise the scope document below."}],
)
print(reply.choices[0].message.content)

What stays the same

What differs

Frameworks and tools

Any tool with an "OpenAI-compatible" or "custom base URL" setting works the same way: enter the base URL, the key and the model id.

Frequently asked questions

How do I switch from the OpenAI API to an uncensored model?

Change the base URL to the uncensored provider's endpoint, use the key it issued and set the model id it lists. With an OpenAI-compatible API such as Uncensored Inference, the rest of the code is unchanged.

Do OpenAI SDKs work with Uncensored Inference?

Yes. Set OPENAI_BASE_URL and OPENAI_API_KEY, or pass base_url and api_key when creating the client.

Last updated: 2 December 2026