Skip to content

用量查询Bug:{{apiKey}}留空时不会自动使用供应商配置中的key #1658

@zhang-stephen

Description

@zhang-stephen

供应商:deepseek
用量查询配置如图,当API Key留空时,查询失败:

Image

API key填写后,则可以正常查询,如图:

Image

其中提取器代码如下:

({
  request: {
    url: "{{baseUrl}}/user/balance",
    method: "GET",
    headers: {
      Accept: "application/json",
      Authorization: "Bearer {{apiKey}}",
      "User-Agent": "cc-switch/1.0",
    },
  },
  extractor: function (response) {
    return {
      isValid: response.is_available,
      remaining: parseFloat(response.balance_infos[0].total_balance),
      unit: response.balance_infos[0].currency,
    };
  },
});

用量查询功能似乎不会自动使用供应商的API Key填充{{apiKey}},与API key字段中的说明文本行为不一致,请考虑修复。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions