mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 00:35:32 +08:00
feat: add official balance query for DeepSeek, StepFun, SiliconFlow, OpenRouter, Novita AI
Add a new "Official" (官方) template type in the usage query panel that queries account balance via each provider's native API endpoint. Follows the same zero-script pattern as Token Plan — Rust handles the HTTP call, frontend auto-detects the provider from base URL. Supported providers and endpoints: - DeepSeek: GET /user/balance - StepFun: GET /v1/accounts - SiliconFlow: GET /v1/user/info (cn + com) - OpenRouter: GET /api/v1/credits - Novita AI: GET /v3/user/balance
This commit is contained in:
@@ -9,4 +9,9 @@ export const subscriptionApi = {
|
||||
apiKey: string,
|
||||
): Promise<SubscriptionQuota> =>
|
||||
invoke("get_coding_plan_quota", { baseUrl, apiKey }),
|
||||
getBalance: (
|
||||
baseUrl: string,
|
||||
apiKey: string,
|
||||
): Promise<import("@/types").UsageResult> =>
|
||||
invoke("get_balance", { baseUrl, apiKey }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user