Commit 207a493f authored by ckken's avatar ckken
Browse files

fix(ccswitch): parse remaining quota from /v1/usage response

parent 963b3b76
......@@ -1638,10 +1638,12 @@ const executeCcsImport = (row: ApiKey, clientType: 'claude' | 'gemini') => {
headers: { "Authorization": "Bearer {{apiKey}}" }
},
extractor: function(response) {
const remaining = response?.remaining ?? response?.quota?.remaining ?? response?.balance;
const unit = response?.unit ?? response?.quota?.unit ?? "USD";
return {
isValid: response.is_active || true,
remaining: response.balance,
unit: "USD"
isValid: response?.is_active ?? response?.isValid ?? true,
remaining,
unit
};
}
})`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment