diff --git a/src/auth.rs b/src/auth.rs index 1cbea27a..04e45900 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -88,13 +88,15 @@ impl AuthContext { .get(token) .ok_or_else(|| anyhow::anyhow!("API key not found"))?; - match api_key.query_status { - QueryStatus::Active => (), - QueryStatus::ServiceShutoff => { - bail!("payment required for subsequent requests for this API key"); - } - QueryStatus::MonthlyCapReached => { - bail!("spend limit exceeded for this API key"); + if self.payment_required { + match api_key.query_status { + QueryStatus::Active => (), + QueryStatus::ServiceShutoff => { + bail!("payment required for subsequent requests for this API key"); + } + QueryStatus::MonthlyCapReached => { + bail!("spend limit exceeded for this API key"); + } } }