pub async fn exchange_code_for_token(
code: &str,
challenge: &PkceChallenge,
) -> Result<String>Expand description
Exchange an authorization code for an API key.
This makes a POST request to OpenRouter’s token endpoint with the authorization code and PKCE verifier.
§Arguments
code- The authorization code from the callback URLchallenge- The PKCE challenge used during authorization
§Returns
The obtained API key on success.