Back to guides

Your first API response.

From your key to a reply in the terminal. Follow four steps, with every command ready to copy.

1

Create your API key

Open your account, create a key and copy it. You will use it in the next step.

Open API keys

Use an Uncensured AI key. An OpenAI key will not work here.

2

Prepare Python

Open a terminal in a folder for this example. Choose your operating system and run these commands.

Terminal
python3 -m venv .venv
.venv/bin/python -m pip install openai
export UNCENSURED_API_KEY="YOUR_UNCENSURED_API_KEY"

Replace YOUR_UNCENSURED_API_KEY with your key, keeping the quotes. Leave this terminal open: the variable lasts for this session.

3

Create the request file

In the same folder, create a file named prima_richiesta.py and paste this code.

prima_richiesta.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://uncensuredai.com/v1",
    api_key=os.environ["UNCENSURED_API_KEY"],
)

response = client.chat.completions.create(
    model="glm-5.3-flash-abliterated",
    messages=[{"role": "user", "content": "Scrivi un breve saluto in italiano."}],
    reasoning_effort="low",
    max_tokens=4096,
)

print(response.choices[0].message.content)

The openai package is the client library. The base URL sends your request to Uncensured AI and uses your Uncensured AI credit.

4

Run it and read the response

In the same terminal, run the file:

Terminal
.venv/bin/python prima_richiesta.py
Example response · the wording may vary

Ciao! Come posso aiutarti oggi?

If you see generated text, your first API call is complete.

What does max_tokens mean?

It caps the output budget, which can include reasoning. The example uses 4096; you are charged for actual usage, not automatically for the full budget.

Ready for the next step?Explore streaming, models and request parameters

Uncensured AI

Loading...