openai-radar
OpenAI infrastructure FinOps SDK — part of the Hyperscaler Radar suite.
Scan your OpenAI org for assistants, vector stores, fine-tunes, batch jobs, and token usage.
Detect external service relationships in assistant instructions, flag cost anomalies via a findings engine,
and export inventory to CSV or a draw.io architecture diagram — all through a clean Python SDK
that mirrors the openai-agents Runner API.
Install
pip install openai-radar # SDK + CLI + CSV and draw.io export
pip install openai-radar[agents] # + openai-agents integration
pip install openai-radar[all] # everything
Requires Python 3.10+.
CSV and draw.io export are part of the base install — no extras needed, same as
the rest of the Radar suite. The [csv] and [drawio] extras still resolve (as
no-ops) so older pins keep working.
Quick-start
from openai_radar import RadarClient, Runner
# Reads OPENAI_API_KEY from environment
client = RadarClient()
result = Runner.run_sync(client)
print(result.summary())
result.export_csv("./out/")
result.export_drawio("./out/openai_arch.drawio")
With admin key (org-wide visibility)
client = RadarClient(
api_key="sk-proj-...",
admin_key="sk-admin-...", # unlocks cross-project usage data
)
result = Runner.run_sync(client, config)
Scoped to a project
from openai_radar import RadarClient, Runner, RunConfig
client = RadarClient()
config = RunConfig(project_id="proj_xxx", usage_lookback_days=7)
result = Runner.run_sync(client, config)
CLI
# Full scan — findings table to stdout
openai-radar run
# CSVs + draw.io diagram
openai-radar run --csv-dir ./out --drawio-file arch.drawio
# JSON instead of a table
openai-radar run --output json --out-file scan.json
# Admin key for org-wide usage data
openai-radar run --admin-key sk-admin-... --csv-dir ./out
# Findings only
openai-radar findings
# Scope to a project, 7-day lookback
openai-radar run --project proj_xxx --lookback 7
# Print the version
openai-radar version
Flags follow the Radar suite convention: --output/-o selects table or json,
--out-file writes the JSON payload, --csv-dir writes per-resource CSVs.
openai-agents integration
pip install openai-radar[agents]
from openai_radar.agents import build_radar_agent
from agents import Runner
agent = build_radar_agent()
result = Runner.run_sync(agent, "Scan my org and flag any cost anomalies")
print(result.final_output)
Or compose individual Radar tools into your own agent:
from agents import Agent
from openai_radar.agents.tools import scan_assistants, run_findings, export_drawio
agent = Agent(
name="My FinOps Agent",
instructions="...",
tools=[scan_assistants, run_findings, export_drawio],
)
Findings engine
| Rule ID | Severity | Condition |
|---|---|---|
| ASST_001 | LOW | Assistant has zero tools |
| ASST_002 | INFO | Code Interpreter enabled (file storage costs) |
| VS_001 | MEDIUM | Vector store > 5 GB |
| VS_002 | HIGH | Vector store expires within 7 days |
| FT_001 | MEDIUM | Fine-tune job in failed state |
| BATCH_001 | HIGH | Batch job failure rate > 10% |
| USAGE_001 | MEDIUM | Model consumes > 10M tokens in lookback window |
Service relationship detection
AssistantScanner inspects each assistant's instructions field for external service signals
and emits ServiceRelationship objects (visualized as edges in the draw.io diagram):
| Kind | Signals |
|---|---|
| AWS | aws, s3, ec2, lambda, dynamodb, sqs |
| GCP | gcp, bigquery, gcs, google cloud |
| AZURE | azure, blob.core.windows, cosmosdb |
| DATABASE | postgres, mysql, mongo, redis, neon |
| SLACK | slack |
sendgrid, mailgun, smtp |
|
| WEBHOOK | webhook, http:// |
SDK structure
src/openai_radar/
├── client.py # RadarClient (auth, project vs admin key)
├── runner.py # Runner, RunConfig, RunResult
├── findings.py # FindingEngine, Finding, Severity
├── models/base.py # Pydantic v2 models for all resource types
├── scanners/ # One scanner per resource type
├── exporters/ # CSV + draw.io exporters
├── agents/ # openai-agents tools + build_radar_agent()
└── cli.py # openai-radar CLI
Part of the Hyperscaler Radar suite
aws-radar · gcp-radar · azure-radar · oci-radar · openai-radar · datadog-radar · coreweave-radar
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_radar-2.1.0.tar.gz.
File metadata
- Download URL: openai_radar-2.1.0.tar.gz
- Upload date:
- Size: 22.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf4e7df6f5728ed8598c593c8dd12f9ace8459652738175e8922a615e2f03e2e
|
|
| MD5 |
514ec1a5c494b492f031050ed3a9bf36
|
|
| BLAKE2b-256 |
1cfced9cbae423a30c932e485497d8deef9c3b7ff85dc0c84b3079920d6a37e1
|
File details
Details for the file openai_radar-2.1.0-py3-none-any.whl.
File metadata
- Download URL: openai_radar-2.1.0-py3-none-any.whl
- Upload date:
- Size: 31.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a865b0e9c0862212f229806286fdac4cbf574ce73dc042da0aee7981de2847e
|
|
| MD5 |
c71a1f08eb6183f4febe36892525b717
|
|
| BLAKE2b-256 |
e711f385ad4405790089e4f399a4baab8b891f36ba83a4a79d3f26b506bca54d
|