Skip to main content

OpenAI Python SDK

Radium exposes an OpenAI-compatible Chat Completions API. If your application already uses the OpenAI Python SDK, you only need to change the API key, base URL, and model name.

Before you start

You need Python 3.10 or newer, a Radium API key, and a terminal or PowerShell window.

1. Create a project and install the SDK

2. Set your Radium credentials

Keep the key on the server. Do not paste it into main.py, commit it, or expose it in browser code.

3. Create main.py

The base URL must include /v1. Do not append /chat/completions; the SDK adds that path.

4. Run it

Expected output:

Choose a model

Set RADIUM_MODEL to any validated model before running the program:

Migrate an existing OpenAI client

Keep your existing messages and response parsing. Replace the old model ID with hal-1.0, clarke-1.0, or tycho-1.0.

Troubleshooting

Validation

These instructions were verified with Python 3.12.7 and openai==2.54.0 on August 20, 2026. You do not need that exact package version.
Text generation and a complete function-calling loop passed with hal-1.0, clarke-1.0, and tycho-1.0.

Next steps

API quickstart

Call Radium directly

Tool calling

The tool_use and tool_result contract