gemini-radar
Gemini API infrastructure FinOps SDK — part of the Hyperscaler Radar suite.
Scan a Gemini Developer API key's project for its model catalog, tuned models, cached content, uploaded files, File Search Stores, and batch jobs. Detect external service relationships from cached-content system instructions (the closest thing this API has to an OpenAI assistant's stored instructions), flag cost/hygiene anomalies via a findings engine, and export inventory to CSV or a draw.io architecture diagram.
Install
pip install gemini-radar
Requires Python 3.10+. CSV and draw.io export ship in the base install.
A different shape than openai-radar / anthropic-radar — on purpose
The Gemini Developer API (generativelanguage.googleapis.com) has no org-wide
usage/cost report and no API-key-listing endpoint — a single key just scopes calls to
whichever Google Cloud project issued it in AI Studio. So gemini-radar doesn't do
token/dollar findings the way its siblings do; instead it watches the resources that
carry their own standing cost regardless of billing visibility:
- cachedContents — billed hourly for storage until they expire, whether or not they're being hit
- fileSearchStores — persistent RAG storage
- batches — async job failures that silently waste quota
- files — 48h auto-delete TTL, useful for pipeline hygiene
For actual token spend and Cloud Billing data on the backing project, pair this with
gcp-radar rather than duplicating that surface here.
from gemini_radar import RadarClient, Runner
# Reads GEMINI_API_KEY (or GOOGLE_API_KEY) from environment
client = RadarClient()
result = Runner.run_sync(client)
print(result.summary())
result.export_csv("./out/")
result.export_drawio("./out/gemini_arch.drawio")
CLI
# Full scan — findings table to stdout
gemini-radar run
# CSVs + draw.io diagram
gemini-radar run --csv-dir ./out --drawio-file arch.drawio
# JSON instead of a table
gemini-radar run --output json --out-file scan.json
# Skip batch jobs or File Search Stores
gemini-radar run --no-batches --no-file-search
# Findings only
gemini-radar findings
# Print the version
gemini-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.
Findings engine
| Rule ID | Severity | Condition |
|---|---|---|
| CACHE_001 | HIGH | Cached content expiring within 24h while still holding tokens |
| CACHE_002 | MEDIUM | Cached content is idle (zero tokens) but still billed hourly |
| TUNED_001 | MEDIUM | Tuned model stuck in FAILED state |
| BATCH_001 | HIGH | Batch job failure rate > 10% across recent jobs |
| FSS_001 | MEDIUM | File Search Store larger than 5 GB (storage cost driver) |
| FILE_001 | LOW | Uploaded file expiring within 6h (auto-deleted at the 48h TTL) |
Service relationship detection
cachedContents is the one Gemini resource that stores a real systemInstruction, so
detect_relationships() mines that text (plus tuned-model and file-search-store display
names) for the same external-service signal set as the rest of the Radar suite, and
emits ServiceRelationship edges (dashed lines in the draw.io diagram):
| Kind | Signals |
|---|---|
| AWS | aws, s3, ec2, lambda, dynamodb, sqs |
| GCP | gcp, bigquery, gcs, google cloud, cloud storage |
| AZURE | azure, blob.core.windows, cosmosdb |
| DATABASE | postgres, mysql, mongo, redis, neon, supabase |
| SLACK | slack |
sendgrid, mailgun, smtp |
|
| WEBHOOK | webhook, http:// |
SDK structure
src/gemini_radar/
├── client.py # RadarClient (single-key auth)
├── runner.py # Runner, RunConfig, RunResult
├── findings.py # FindingEngine, Finding, Severity
├── relationships.py # systemInstruction-based service relationship detection
├── models/base.py # Pydantic v2 models for all resource types
├── scanners/ # models.py, cached_contents.py, files.py, batches.py
├── exporters/ # csv_exporter.py, drawio_exporter.py
└── cli.py # gemini-radar CLI
Part of the Hyperscaler Radar suite
aws-radar · gcp-radar · azure-radar · oci-radar · openai-radar · anthropic-radar · gemini-radar · datadog-radar · coreweave-radar
License
MIT
Metadata
Release files for gemini-radar 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gemini_radar-0.1.0.tar.gz | 11.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gemini_radar-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.8 kB
Release files / gemini_radar-0.1.0.tar.gz
| Download URL | gemini_radar-0.1.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
958a83e51df5990e9870384ccbb4be1e3312d2d857036a684ef3b513608cf93c
|
|
BLAKE2b-256 checksum How to use checksums |
18dd8344b7a1b4dd1c5c4e4f50a67fe8801d19347321b4b2c2123a82027773f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / gemini_radar-0.1.0-py3-none-any.whl
| Download URL | gemini_radar-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b41cf3f91de671b00220019e44216a6a4716ae905e940acc54274c43f518347
|
|
BLAKE2b-256 checksum How to use checksums |
3166851b7e0e30033c1e8de256f1e2c69aaf5ad2b97c52dff66c22c09321e0b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|