"backend/internal/vscode:/vscode.git/clone" did not exist on "df1ef3deb63af2946bf56750a2c7f4ded362150e"
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') => { ...@@ -1638,10 +1638,12 @@ const executeCcsImport = (row: ApiKey, clientType: 'claude' | 'gemini') => {
headers: { "Authorization": "Bearer {{apiKey}}" } headers: { "Authorization": "Bearer {{apiKey}}" }
}, },
extractor: function(response) { extractor: function(response) {
const remaining = response?.remaining ?? response?.quota?.remaining ?? response?.balance;
const unit = response?.unit ?? response?.quota?.unit ?? "USD";
return { return {
isValid: response.is_active || true, isValid: response?.is_active ?? response?.isValid ?? true,
remaining: response.balance, remaining,
unit: "USD" 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