BenchGecko Rust SDK
Official Rust client for the BenchGecko API. Query AI model data, benchmark scores, and run side-by-side comparisons from Rust applications.
BenchGecko tracks every major AI model, benchmark, and provider. This crate wraps the public REST API with strongly typed Rust structs, proper error handling, and both blocking and async-ready patterns.
Installation
Add to your Cargo.toml:
[]
= "0.1"
Quick Start
use BenchGecko;
API Reference
BenchGecko::new()
Create a client with the default base URL (https://benchgecko.ai).
BenchGecko::with_base_url(url)
Create a client with a custom API base URL for testing or self-hosted instances.
client.models() -> Result<Vec<Model>, Error>
Fetch all AI models. Each Model struct contains optional fields for name, provider, slug, and a HashMap for additional metadata like pricing and scores.
client.benchmarks() -> Result<Vec<Benchmark>, Error>
Fetch all benchmarks. Each Benchmark struct contains name, slug, category, and extra metadata.
client.compare(models) -> Result<ComparisonResult, Error>
Compare two or more models. Pass a slice of model slug strings. Returns a ComparisonResult with per-model data.
Error Handling
The Error enum covers HTTP failures, API errors (with status code), and invalid input:
use ;
let client = new;
match client.models
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