Skip to main content

key_probe

Function key_probe 

Source
async fn key_probe(
    client: &Client,
    base_url: &str,
    bearer: &str,
) -> Result<(KeyResponse, Option<f64>), OauthUsageError>
Expand description

One probe for a pay-per-token account: the per-key spend from {base}/v1/key, plus the account’s credit pool from {base}/v1/credits. Shares OauthUsageError with the window probes so the loader and poller classify a 401 / 429 / network failure the same way regardless of billing kind. The key fetch is load-bearing and its error propagates; the credits fetch is auxiliary and its failure only makes the balance absent.