跳转到主要内容
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 方案)
  • 已触发速率限制