fix(auth): rotate keys after DeepSeek insufficient balance

This commit is contained in:
sususu
2026-08-10 10:13:29 +08:00
parent ecc9aa72b3
commit 45ffd115fd
3 changed files with 106 additions and 0 deletions

View File

@@ -191,6 +191,12 @@ func TestIsRequestFault(t *testing.T) {
},
{name: "plain not found", status: http.StatusNotFound, err: errors.New("model not found")},
{name: "unauthorized", status: http.StatusUnauthorized, err: errors.New("invalid token")},
{
name: "deepseek insufficient balance is payment failure",
status: http.StatusPaymentRequired,
err: errors.New(`{"error":{"message":"Insufficient Balance","type":"unknown_error","param":null,"code":"invalid_request_error"}}`),
want: false,
},
{name: "quota", status: http.StatusTooManyRequests, err: errors.New("quota")},
{name: "transport", status: http.StatusBadGateway, err: errors.New("unexpected EOF")},
{name: "invalid JSON body", status: http.StatusBadGateway, err: errors.New(`{"error":`)},