Grt1228 / chatgpt-java

ChatGPT Java SDK支持流式输出、Gpt插件、联网。支持OpenAI官方所有接口。ChatGPT的Java客户端。OpenAI GPT-3.5-Turb GPT-4 Api Client for Java
https://chatgpt-java.unfbx.com
Apache License 2.0
3.3k stars 810 forks source link

余额查询的接口不能用了吗? #230

Closed zhutx closed 9 months ago

zhutx commented 9 months ago

OpenAiClientTest.java:

@Test
public void subscription() {
    Subscription subscription = v2.subscription();
    log.info("用户名:{}", subscription.getAccountName());
    log.info("用户总余额(美元):{}", subscription.getHardLimitUsd());
    log.info("更多信息看Subscription类");
}

@Test
public void billingUsage() {
    LocalDate start = LocalDate.of(2023, 10, 7);
    BillingUsage billingUsage = v2.billingUsage(start, LocalDate.now());
    log.info("总使用金额(美分):{}", billingUsage.getTotalUsage());
    log.info("更多信息看BillingUsage类");
}

返回都是类似: GET /v1/dashboard/billing/usage must be made with a session key (that is, it can only be made from the browser). You made it with the following

Grt1228 commented 9 months ago

这些接口官方很早就禁用了