跳转到主要内容
POST
/
api
/
v1
/
GetTeamCreditBalance
获取团队额度余额
curl --request POST \
  --url https://server.codeium.com/api/v1/GetTeamCreditBalance \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_key": "<string>"
}
'
{
  "promptCreditsPerSeat": 123,
  "numSeats": 123,
  "addOnCreditsAvailable": 123,
  "addOnCreditsUsed": 123,
  "billingCycleStart": "<string>",
  "billingCycleEnd": "<string>"
}

概览

获取您团队当前的额度余额信息。其中包括每个席位分配的提示额度、席位数量、附加额度的使用情况,以及账单周期的起止日期。

请求

service_key
string
必填
具有“Billing Read”权限的服务密钥

请求示例

curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here"
}' \
https://server.codeium.com/api/v1/GetTeamCreditBalance

响应

promptCreditsPerSeat
integer
当前账单周期内每个席位分配的提示额度数
numSeats
integer
团队中的席位数量
addOnCreditsAvailable
integer
团队可用的附加额度总数
addOnCreditsUsed
integer
当前账单周期内已使用的附加额度总数
billingCycleStart
string
当前账单周期的开始时间(ISO 8601 时间戳)
billingCycleEnd
string
当前账单周期的结束时间(ISO 8601 时间戳)

响应示例

{
  "promptCreditsPerSeat": 500,
  "numSeats": 50,
  "addOnCreditsAvailable": 10000,
  "addOnCreditsUsed": 3500,
  "billingCycleStart": "2026-01-01T00:00:00Z",
  "billingCycleEnd": "2026-02-01T00:00:00Z"
}

错误响应

常见错误场景:
  • 服务密钥无效或权限不足
  • 您当前套餐不支持该功能(需要 Enterprise 套餐)
  • 超出调用频率限制