pub struct OpenRouterClient { /* private fields */ }Implementations§
Source§impl OpenRouterClient
impl OpenRouterClient
pub fn builder() -> OpenRouterClientBuilder
Sourcepub fn set_api_key(&mut self, api_key: impl Into<String>)
pub fn set_api_key(&mut self, api_key: impl Into<String>)
Sourcepub fn clear_api_key(&mut self)
pub fn clear_api_key(&mut self)
Clears the currently set API key.
§Example
let mut client = OpenRouterClient::builder().api_key("your_api_key").build()?;
client.clear_api_key();Sourcepub fn set_management_key(&mut self, management_key: impl Into<String>)
pub fn set_management_key(&mut self, management_key: impl Into<String>)
Sourcepub fn clear_management_key(&mut self)
pub fn clear_management_key(&mut self)
Clears the currently set management key.
§Example
let mut client = OpenRouterClient::builder().build()?;
client.set_management_key("your_management_key");
client.clear_management_key();Sourcepub fn chat(&self) -> ChatClient<'_>
pub fn chat(&self) -> ChatClient<'_>
Domain client for chat completions and chat streaming.
Sourcepub fn responses(&self) -> ResponsesClient<'_>
pub fn responses(&self) -> ResponsesClient<'_>
Domain client for Responses API operations.
Sourcepub fn messages(&self) -> MessagesClient<'_>
pub fn messages(&self) -> MessagesClient<'_>
Domain client for Anthropic-compatible /messages operations.
Sourcepub fn rerank(&self) -> RerankClient<'_>
pub fn rerank(&self) -> RerankClient<'_>
Domain client for rerank operations.
Sourcepub fn audio(&self) -> AudioClient<'_>
pub fn audio(&self) -> AudioClient<'_>
Domain client for audio operations.
Sourcepub fn images(&self) -> ImagesClient<'_>
pub fn images(&self) -> ImagesClient<'_>
Domain client for image generation operations.
Sourcepub fn tts(&self) -> SpeechClient<'_>
👎Deprecated: use client.audio().speech()
pub fn tts(&self) -> SpeechClient<'_>
use client.audio().speech()
Domain client for text-to-speech operations.
Sourcepub fn videos(&self) -> VideosClient<'_>
pub fn videos(&self) -> VideosClient<'_>
Domain client for video generation operations.
Sourcepub fn files(&self) -> FilesClient<'_>
pub fn files(&self) -> FilesClient<'_>
Domain client for file upload, metadata, content, and deletion operations.
Sourcepub fn models(&self) -> ModelsClient<'_>
pub fn models(&self) -> ModelsClient<'_>
Domain client for model/discovery/embedding operations.
Sourcepub fn management(&self) -> ManagementClient<'_>
pub fn management(&self) -> ManagementClient<'_>
Domain client for management-governed endpoints.
Trait Implementations§
Source§impl Clone for OpenRouterClient
impl Clone for OpenRouterClient
Source§fn clone(&self) -> OpenRouterClient
fn clone(&self) -> OpenRouterClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OpenRouterClient
impl !UnwindSafe for OpenRouterClient
impl Freeze for OpenRouterClient
impl Send for OpenRouterClient
impl Sync for OpenRouterClient
impl Unpin for OpenRouterClient
impl UnsafeUnpin for OpenRouterClient
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