Function set_api_key

Source
pub async fn set_api_key(api_key: &str) -> Result<(), OpenRouterError>
Expand description

Sets the API key for the OpenRouter client.

§Arguments

  • api_key - The API key to set.

§Returns

  • Result<(), OpenRouterError> - An empty result indicating success or an error.

§Example

set_api_key("your_api_key").await?;