pub struct ModelsClient<'a> { /* private fields */ }Expand description
Domain client for model/discovery/embedding endpoints.
Implementations§
Source§impl<'a> ModelsClient<'a>
impl<'a> ModelsClient<'a>
Sourcepub async fn list_filtered(
&self,
params: Option<&ListModelsParams>,
) -> Result<Vec<Model>, OpenRouterError>
pub async fn list_filtered( &self, params: Option<&ListModelsParams>, ) -> Result<Vec<Model>, OpenRouterError>
List models with the extended filter surface (GET /models?...).
Sourcepub async fn list_by_category(
&self,
category: ModelCategory,
) -> Result<Vec<Model>, OpenRouterError>
pub async fn list_by_category( &self, category: ModelCategory, ) -> Result<Vec<Model>, OpenRouterError>
List models by category (GET /models?category=...).
Sourcepub async fn list_by_parameters(
&self,
supported_parameters: SupportedParameters,
) -> Result<Vec<Model>, OpenRouterError>
pub async fn list_by_parameters( &self, supported_parameters: SupportedParameters, ) -> Result<Vec<Model>, OpenRouterError>
List models by supported parameter (GET /models?supported_parameters=...).
Sourcepub async fn list_endpoints(
&self,
author: &str,
slug: &str,
) -> Result<EndpointData, OpenRouterError>
pub async fn list_endpoints( &self, author: &str, slug: &str, ) -> Result<EndpointData, OpenRouterError>
List model endpoints (GET /models/{author}/{slug}/endpoints).
Sourcepub async fn get(
&self,
author: &str,
slug: &str,
) -> Result<Model, OpenRouterError>
pub async fn get( &self, author: &str, slug: &str, ) -> Result<Model, OpenRouterError>
Get metadata about one model (GET /model/{author}/{slug}).
Sourcepub async fn list_providers(&self) -> Result<Vec<Provider>, OpenRouterError>
pub async fn list_providers(&self) -> Result<Vec<Provider>, OpenRouterError>
List providers (GET /providers).
Sourcepub async fn list_user_models(&self) -> Result<Vec<UserModel>, OpenRouterError>
pub async fn list_user_models(&self) -> Result<Vec<UserModel>, OpenRouterError>
List user-filtered models (GET /models/user).
Sourcepub async fn get_model_count(&self) -> Result<ModelsCountData, OpenRouterError>
pub async fn get_model_count(&self) -> Result<ModelsCountData, OpenRouterError>
Get available model count (GET /models/count).
Sourcepub async fn get_rankings_daily(
&self,
start_date: Option<&str>,
end_date: Option<&str>,
) -> Result<RankingsDailyResponse, OpenRouterError>
pub async fn get_rankings_daily( &self, start_date: Option<&str>, end_date: Option<&str>, ) -> Result<RankingsDailyResponse, OpenRouterError>
Return daily token totals for top public models (GET /datasets/rankings-daily).
Sourcepub async fn get_app_rankings(
&self,
params: Option<&AppRankingsParams>,
) -> Result<AppRankingsResponse, OpenRouterError>
pub async fn get_app_rankings( &self, params: Option<&AppRankingsParams>, ) -> Result<AppRankingsResponse, OpenRouterError>
Return ranked applications (GET /datasets/app-rankings).
Sourcepub async fn get_task_classifications(
&self,
window: Option<&str>,
) -> Result<TaskClassificationsResponse, OpenRouterError>
pub async fn get_task_classifications( &self, window: Option<&str>, ) -> Result<TaskClassificationsResponse, OpenRouterError>
Return task classification market-share data (GET /classifications/task).
Sourcepub async fn get_benchmarks(
&self,
params: &UnifiedBenchmarksParams,
) -> Result<UnifiedBenchmarksResponse, OpenRouterError>
pub async fn get_benchmarks( &self, params: &UnifiedBenchmarksParams, ) -> Result<UnifiedBenchmarksResponse, OpenRouterError>
Return benchmark rows from a selected source (GET /benchmarks).
Sourcepub async fn get_benchmarks_artificial_analysis(
&self,
max_results: Option<u32>,
) -> Result<BenchmarksAAResponse, OpenRouterError>
👎Deprecated: use get_benchmarks with source artificial-analysis
pub async fn get_benchmarks_artificial_analysis( &self, max_results: Option<u32>, ) -> Result<BenchmarksAAResponse, OpenRouterError>
use get_benchmarks with source artificial-analysis
Return Artificial Analysis benchmark rows.
Sourcepub async fn get_benchmarks_design_arena(
&self,
arena: Option<&str>,
category: Option<&str>,
max_results: Option<u32>,
) -> Result<BenchmarksDAResponse, OpenRouterError>
👎Deprecated: use get_benchmarks with source design-arena
pub async fn get_benchmarks_design_arena( &self, arena: Option<&str>, category: Option<&str>, max_results: Option<u32>, ) -> Result<BenchmarksDAResponse, OpenRouterError>
use get_benchmarks with source design-arena
Return Design Arena benchmark rows.
Sourcepub async fn list_zdr_endpoints(
&self,
) -> Result<Vec<PublicEndpoint>, OpenRouterError>
pub async fn list_zdr_endpoints( &self, ) -> Result<Vec<PublicEndpoint>, OpenRouterError>
List ZDR-compatible endpoints (GET /endpoints/zdr).
Sourcepub async fn create_embedding(
&self,
request: &EmbeddingRequest,
) -> Result<EmbeddingResponse, OpenRouterError>
pub async fn create_embedding( &self, request: &EmbeddingRequest, ) -> Result<EmbeddingResponse, OpenRouterError>
Create an embedding (POST /embeddings).
Sourcepub async fn list_embedding_models(&self) -> Result<Vec<Model>, OpenRouterError>
pub async fn list_embedding_models(&self) -> Result<Vec<Model>, OpenRouterError>
List embedding models (GET /embeddings/models).
Trait Implementations§
Source§impl<'a> Clone for ModelsClient<'a>
impl<'a> Clone for ModelsClient<'a>
Source§fn clone(&self) -> ModelsClient<'a>
fn clone(&self) -> ModelsClient<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more