benchgecko 0.1.2

Rust SDK for BenchGecko -- compare LLM benchmarks, estimate inference costs, and explore AI model performance data across hundreds of providers.
Documentation
//! # BenchGecko
//!
//! Rust SDK for exploring AI model benchmarks, comparing performance,
//! and estimating inference costs. Built on data from [BenchGecko](https://benchgecko.ai).
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! let models = benchgecko::models().await;
//! let comparison = benchgecko::compare(&["gpt-5-chat", "claude-opus-4-6"]).await;
//! ```

pub const BASE_URL: &str = "https://benchgecko.ai/api/v1";
pub const VERSION: &str = "0.1.2";

pub struct Model {
    pub name: String,
    pub slug: String,
    pub provider: String,
    pub input_price: Option<f64>,
    pub output_price: Option<f64>,
    pub context_window: Option<u64>,
    pub average_score: Option<f64>,
}

pub struct Benchmark {
    pub name: String,
    pub slug: String,
    pub category: String,
    pub max_score: u32,
}

pub fn api_url(path: &str) -> String {
    format!("{}{}", BASE_URL, path)
}

pub fn models_url() -> String {
    api_url("/models")
}

pub fn compare_url(slugs: &[&str]) -> String {
    api_url(&format!("/compare?models={}", slugs.join(",")))
}

pub fn pricing_url(slug: &str) -> String {
    api_url(&format!("/pricing/{}", slug))
}

pub fn benchmarks_url() -> String {
    api_url("/benchmarks")
}

pub fn providers_url() -> String {
    api_url("/providers")
}

pub fn agents_url() -> String {
    api_url("/agents")
}

#[cfg(test)]
mod tests {
    use super::*;
    
    #[test]
    fn test_urls() {
        assert_eq!(models_url(), "https://benchgecko.ai/api/v1/models");
        assert_eq!(pricing_url("gpt-5-chat"), "https://benchgecko.ai/api/v1/pricing/gpt-5-chat");
    }
}