Official Python SDK for the BenchGecko API. Compare AI models, benchmarks, and pricing.
Project description
BenchGecko Python SDK
Official Python client for the BenchGecko API. Query AI model data, benchmark scores, and run side-by-side comparisons programmatically.
BenchGecko tracks every major AI model, benchmark, and provider. This SDK wraps the public REST API so you can integrate AI model intelligence into your own tools, dashboards, and research workflows.
Installation
pip install benchgecko
Requires Python 3.8 or later.
Quick Start
from benchgecko import BenchGecko
client = BenchGecko()
# List all tracked AI models
models = client.models()
print(f"Tracking {len(models)} models")
# List all benchmarks
benchmarks = client.benchmarks()
for b in benchmarks[:5]:
print(b["name"])
# Compare two models head-to-head
comparison = client.compare(["gpt-4o", "claude-opus-4"])
for model_data in comparison["models"]:
print(model_data["name"], model_data.get("scores", {}))
API Reference
BenchGecko(base_url=None, timeout=30)
Create a client instance. The default base URL points to the production BenchGecko API.
Parameters:
base_url(str, optional): Override the API base URL. Useful for testing.timeout(int): Request timeout in seconds. Defaults to 30.
client.models() -> list
Fetch all AI models tracked by BenchGecko. Returns a list of dictionaries, each containing model metadata such as name, provider, parameter count, pricing tiers, and benchmark scores.
client.benchmarks() -> list
Fetch all benchmarks tracked by BenchGecko. Returns a list of dictionaries with benchmark name, category, description, and the number of models scored on each benchmark.
client.compare(models: list) -> dict
Compare two or more models side by side. Pass a list of model slugs (e.g., ["gpt-4o", "claude-opus-4"]). Returns a structured comparison with per-model scores, pricing, speed metrics, and capability breakdowns.
Parameters:
models(list of str): At least 2 model slugs to compare.
Raises:
ValueErrorif fewer than 2 models are provided.BenchGeckoErroron API errors.
Error Handling
All API errors raise BenchGeckoError with a human-readable message and optional HTTP status code:
from benchgecko import BenchGecko
from benchgecko.client import BenchGeckoError
client = BenchGecko()
try:
models = client.models()
except BenchGeckoError as e:
print(f"API error: {e} (status: {e.status_code})")
Configuration
You can point the client to a different API server for local development or testing:
client = BenchGecko(base_url="http://localhost:3000", timeout=10)
Data Attribution
Data provided by BenchGecko. Model benchmark scores are sourced from official evaluation suites and validated against published results. Pricing data is updated daily from provider APIs.
Links
- BenchGecko - AI model benchmarks, pricing, and rankings
- API Documentation
- GitHub Repository
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 benchgecko-0.1.0.tar.gz.
File metadata
- Download URL: benchgecko-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0b65729965a958fbc22b75087cacf99543c97f4cc4491ce46c455f0e697916e
|
|
| MD5 |
53a071c05bf41ff0686d3d22f009fc28
|
|
| BLAKE2b-256 |
fdadd8eedcf94d6e9057b75282cf26a67802e065ac6273a75f36a7875dddb6f8
|
File details
Details for the file benchgecko-0.1.0-py3-none-any.whl.
File metadata
- Download URL: benchgecko-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4afdea56a7cca7ef139fe7b7fbf6d211e22d11406c5c5764f2fa9ea8efe8540
|
|
| MD5 |
416bd300b190ce649677ba07a9da33de
|
|
| BLAKE2b-256 |
eb07086c1510ca39957ce7bf91802a9eaea501e7aba42cd75e42d56f04f3b689
|