mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-03 06:35:00 +08:00
fix(auth): rotate keys after DeepSeek insufficient balance
This commit is contained in:
@@ -80,6 +80,12 @@ func IsRequestFault(status int, err error) bool {
|
||||
status = statusErr.StatusCode()
|
||||
}
|
||||
}
|
||||
// HTTP 402 is a credential payment or balance failure. Some upstreams,
|
||||
// including DeepSeek, label it with the generic invalid_request_error code.
|
||||
// The status is authoritative so the credential can cool down and rotate.
|
||||
if status == http.StatusPaymentRequired {
|
||||
return false
|
||||
}
|
||||
if hasRequestFaultBody(err) {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user