Python · OpenAI SDK with Unjailed AI
Create a free account, add wallet credit when ready, then create a key in the API tab. The human should create the account, fund it and enter their own key.
01Install the SDK
Use a virtual environment for your project. Python and pip must be installed.
python -m pip install openai02Set your key locally
Set UNJAILED_API_KEY in your local shell or secret manager. macOS/Linux: export UNJAILED_API_KEY='YOUR_KEY'. PowerShell: $env:UNJAILED_API_KEY='YOUR_KEY'. Never commit the real key.
03Send a Chat Completions request
Save this as example.py and run python example.py. This uses Chat Completions, which our endpoint supports.
import os from openai import OpenAI client = OpenAI( base_url="https://unjailedai.com/v1", api_key=os.environ["UNJAILED_API_KEY"], ) response = client.chat.completions.create( model="deepseek-v4.1-flash", messages=[{"role": "user", "content": "Say hello in one sentence."}], max_tokens=512, ) print(response.choices[0].message.content)
Official reference: Python · OpenAI SDK documentation ↗. Setup checked October 13, 2026.
Use an exact ID from the model directory. Check live status if a model is unavailable. Uncensored models work through compatible API clients and the CLI; web chat uses standard models. Requests spend wallet credit at the published rates.
One key. Your existing workflow.
Create a free account — no emailNo KYC at signup · No card details stored here · Wallet credit never expires · Top-ups don’t renew