pub struct Client { /* private fields */ }Expand description
OpenRouter API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder<()>
pub fn builder() -> ClientBuilder<()>
Create a new client builder.
Sourcepub async fn create_chat_completion(
&self,
request: CreateChatCompletionRequest,
) -> Result<CreateChatCompletionResponse>
pub async fn create_chat_completion( &self, request: CreateChatCompletionRequest, ) -> Result<CreateChatCompletionResponse>
Create a chat completion.
Sourcepub async fn list_models(&self) -> Result<ModelList>
pub async fn list_models(&self) -> Result<ModelList>
List available models.
Sourcepub async fn get_generation(
&self,
generation_id: &str,
) -> Result<GenerationStats>
pub async fn get_generation( &self, generation_id: &str, ) -> Result<GenerationStats>
Get generation statistics by ID.
Sourcepub async fn get_credits(&self) -> Result<CreditsResponse>
pub async fn get_credits(&self) -> Result<CreditsResponse>
Get account credits/balance.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more