Function create_api_key

Source
pub async fn create_api_key(
    name: &str,
    limit: Option<f64>,
) -> Result<ApiKey, OpenRouterError>
Expand description

Creates a new API key. Requires a Provisioning API key.

§Arguments

  • name - The display name for the new API key.
  • limit - Optional credit limit for the new API key.

§Returns

  • Result<api_keys::ApiKey, OpenRouterError> - The created API key.

§Example

let api_key = create_api_key("New API Key", Some(100.0)).await?;
println!("{:?}", api_key);