SDK Installation
Install the RadMah AI SDK for your language, authenticate with your API key, and verify the connection in under five minutes.
Requirements
| Language | Minimum Version | Package Manager |
|---|---|---|
| Python | 3.10+ | pip |
| REST API | Any | cURL / any HTTP client |
You also need a RadMah AI API key (prefixed sl_live_). Create one from Settings → API Keys in the dashboard.
Install the SDK
pip install radmah-sdk✦Python extras
For Jupyter notebook workflows, install with the optional pandas dependency: pip install radmah-sdk pandas. The SDK works without pandas, but to_dataframe() requires it and raises a clear error if missing.
Configure Environment Variables
The Python SDK reads these environment variables automatically. Set them in your shell profile, CI secrets, or container environment.
| Variable | Required | Description |
|---|---|---|
| RADMAH_API_KEY | Yes | Your API key. Prefixed sl_live_. The rady CLI reads it; in Python, pass it as api_key= (the SDK does not read it on its own). |
| RADMAH_API_URL | No | The API endpoint, when base_url= is not passed. Defaults to https://api.radmah.ai |
| RADMAH_ALLOW_PRIVATE_BASE_URL | No | 1 lets an endpoint on your private network or this machine receive the key, when allow_private_base_url= is not passed. See On-Prem & Custom CA. |
| RADMAH_CA_BUNDLE | No | PEM file of the CA that signed your deployment's certificate, when ca_bundle_path= is not passed. |
| RADMAH_UPLOAD_TIMEOUT | No | Seconds a dataset upload waits for the server's answer, when upload_dataset(timeout=) is not passed. Defaults to 3600 |
export RADMAH_API_KEY="sl_live_your_key_here"
# Optional overrides
export RADMAH_API_URL="https://api.radmah.ai"
export RADMAH_UPLOAD_TIMEOUT="3600"⚠Never hardcode API keys
Do not commit API keys to source control. Use environment variables, a secrets manager, or your CI/CD platform's secret storage, and read the key from there in your code: api_key=os.environ["RADMAH_API_KEY"]. The rady CLI reads RADMAH_API_KEY on its own.
Initialize the Client
Create a client with your API key. The endpoint is base_url=, else RADMAH_API_URL, else the hosted API. You can also pass configuration explicitly.
import os
from radmah_sdk import RadMahClient
# The key from the environment; the endpoint from RADMAH_API_URL, else the hosted API
client = RadMahClient(api_key=os.environ["RADMAH_API_KEY"])
# Or pass configuration explicitly
client = RadMahClient(
api_key="sl_live_your_key_here",
base_url="https://api.radmah.ai",
timeout=120,
)✦Enterprise deployments
For on-premise or VPC deployments, set RADMAH_API_URL to your private API endpoint. The Python SDK reads this automatically. An endpoint on your private network (an RFC 1918 address or a name under .internal) also needs RADMAH_ALLOW_PRIVATE_BASE_URL=1; give it an https:// URL. Plain http:// to any host but this machine is refused, because the key would cross your network unencrypted, unless you opt in by name with RADMAH_ALLOW_INSECURE_HTTP=1 (the SDK then still warns) — see On-Prem & Custom CA. For REST API usage, replace the base URL in your requests.
Verify Connection
Run this quick verification to confirm your SDK is installed, your API key is valid, and the client can reach the RadMah AI API.
import os
from radmah_sdk import RadMahClient
client = RadMahClient(api_key=os.environ["RADMAH_API_KEY"])
# An authenticated call: a wrong key raises radmah_sdk.AuthError
health = client.health()
print(f"Account status: {health.status}") # "active" for a usable account
print(f"Tenant: {health.tenant_slug}")If the connection succeeds, you will see your account status (active) and tenant printed to the console. If the key is wrong, the SDK raises radmah_sdk.AuthError with a descriptive message.
Configuration Reference
The arguments of the RadMahClient and AsyncRadMah constructors. Three have an environment variable (shown under the argument) that the SDK reads when the argument is not passed; an argument you pass always wins.
| Argument | Default | Description |
|---|---|---|
api_key | — | Your API key (sl_live_…). Required; the SDK does not read it from the environment. |
base_urlRADMAH_API_URL | https://api.radmah.ai | API base URL: your deployment's API URL for on-prem. |
allow_private_base_urlRADMAH_ALLOW_PRIVATE_BASE_URL | off | Opt in to a base URL on your private network or this machine. False refuses whatever the environment says. Cloud metadata endpoints are always refused. See On-Prem & Custom CA. |
allow_insecure_httpRADMAH_ALLOW_INSECURE_HTTP | off | Opt in to sending the key over plain http:// to a host that is not this machine. Without it such a URL is refused (BaseURLError, reason cleartext); with it the SDK still issues InsecureBaseURLWarning. Prefer https:// with ca_bundle_path. False refuses whatever the environment says. |
ca_bundle_pathRADMAH_CA_BUNDLE | system trust store | PEM file of your private CA. Certificate verification cannot be turned off. |
timeout | 60 | Request timeout in seconds. |
max_retries | 3 | Retry attempts for transient failures. A 429 or 503 that says when to come back (Retry-After) is waited out as asked instead, without spending these (at most 60 waits, 15 minutes in all, per call; past that the error is raised). |
refresh_token | — | Session refresh token: on a 401 the SDK refreshes the access token once. |
on_wait | — | Called as on_wait(seconds, error) before each wait the server asked for (a key's per-minute limit, a busy service); the call then goes on by itself. |
SDK Resource Namespaces
The Python SDK client exposes resource namespaces for each area of the platform. The same resources are available via REST endpoints.
| Namespace | Description |
|---|---|
| client.account | Account info, usage, and plan details |
| client.jobs | Create, list, get, cancel, and rerun generation jobs |
| client.datasets | Upload, list, get, and delete datasets |
| client.artifacts | List, download, and verify job artifacts and evidence bundles |
| client.seals | List, get, and download provenance seals |
| client.connectors | CRUD, test, import from, and deliver to external sources |
| client.agent | Agentic Data Scientist project lifecycle |
Next Steps
- Authentication — API key management, JWT sessions, and security best practices
- Running Jobs — Job creation, monitoring, and lifecycle
- Evidence Bundles — Download and verify provenance evidence
- REST API Reference — Full endpoint documentation