mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 15:30:26 +00:00
feat: add access_until field for subscription api (#295)
* 支持从计费渠道端点返回日期 * fix: fix wrong git base --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ type OpenAISubscriptionResponse struct {
|
||||
SoftLimitUSD float64 `json:"soft_limit_usd"`
|
||||
HardLimitUSD float64 `json:"hard_limit_usd"`
|
||||
SystemHardLimitUSD float64 `json:"system_hard_limit_usd"`
|
||||
AccessUntil int64 `json:"access_until"`
|
||||
}
|
||||
|
||||
type OpenAIUsageDailyCost struct {
|
||||
@@ -96,6 +97,9 @@ func GetResponseBody(method, url string, channel *model.Channel, headers http.He
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("status code: %d", res.StatusCode)
|
||||
}
|
||||
body, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user