use thiserror::Error;
#[derive(Error, Debug)]
pub enum OpenRouterError {
#[error("HTTP request failed: {0}")]
HttpError(#[from] reqwest::Error),
#[error("JSON serialization/deserialization failed: {0}")]
JsonError(#[from] serde_json::Error),
#[error("API error: {code} - {message}")]
ApiError { code: u16, message: String },
#[error("Authentication failed: {0}")]
AuthenticationError(String),
#[error("Rate limit exceeded")]
RateLimitError,
#[error("Invalid request: {0}")]
InvalidRequest(String),
#[error("Stream error: {0}")]
StreamError(String),
#[error("Configuration error: {0}")]
ConfigError(String),
}
pub type Result<T> = std::result::Result<T, OpenRouterError>;