获取团队积分余额
curl --request POST \
--url https://server.codeium.com/api/v1/GetTeamCreditBalance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"service_key": "<string>"
}
'import requests
url = "https://server.codeium.com/api/v1/GetTeamCreditBalance"
payload = { "service_key": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({service_key: '<string>'})
};
fetch('https://server.codeium.com/api/v1/GetTeamCreditBalance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v1/GetTeamCreditBalance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v1/GetTeamCreditBalance"
payload := strings.NewReader("{\n \"service_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://server.codeium.com/api/v1/GetTeamCreditBalance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v1/GetTeamCreditBalance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"promptCreditsPerSeat": 123,
"numSeats": 123,
"addOnCreditsAvailable": 123,
"addOnCreditsUsed": 123,
"billingCycleStart": "<string>",
"billingCycleEnd": "<string>"
}用量 API
获取团队积分余额
查询你团队当前的积分余额,包括每个席位的提示积分、附加积分以及计费周期信息。
POST
/
api
/
v1
/
GetTeamCreditBalance
获取团队积分余额
curl --request POST \
--url https://server.codeium.com/api/v1/GetTeamCreditBalance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"service_key": "<string>"
}
'import requests
url = "https://server.codeium.com/api/v1/GetTeamCreditBalance"
payload = { "service_key": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({service_key: '<string>'})
};
fetch('https://server.codeium.com/api/v1/GetTeamCreditBalance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v1/GetTeamCreditBalance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v1/GetTeamCreditBalance"
payload := strings.NewReader("{\n \"service_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://server.codeium.com/api/v1/GetTeamCreditBalance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v1/GetTeamCreditBalance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"promptCreditsPerSeat": 123,
"numSeats": 123,
"addOnCreditsAvailable": 123,
"addOnCreditsUsed": 123,
"billingCycleStart": "<string>",
"billingCycleEnd": "<string>"
}概述
此端点仅反映当前计费周期。 它不会返回之前周期的历史用量。特别是,
addOnCreditsAvailable 不是累计总量——它会在每个计费周期开始时,根据上一周期的消耗情况重新计算,因此你看到的值会每月变化。如果你的团队在上一个周期使用了附加积分,那么在本周期开始时,addOnCreditsAvailable 将低于你最初购买的数量。请求
你的拥有“Billing Read”权限的服务密钥
请求示例
curl -X POST --header "Content-Type: application/json" \
--data '{
"service_key": "your_service_key_here"
}' \
https://server.codeium.com/api/v1/GetTeamCreditBalance
响应
当前计费周期内每个席位分配的提示积分数
团队中的席位数
团队在当前计费周期内可用的附加积分。该值会在每个计费周期开始时,根据上一周期的用量重新计算,因此会逐月变化,并非已购买附加积分的累计总数。
团队在当前计费周期内截至目前已消耗的附加积分。该计数器会在每个新周期开始时重置,且不包含之前周期的用量。
当前计费周期开始时间 (ISO 8601 时间戳)
当前计费周期结束时间 (ISO 8601 时间戳)
响应示例
{
"promptCreditsPerSeat": 500,
"numSeats": 50,
"addOnCreditsAvailable": 10000,
"addOnCreditsUsed": 3500,
"billingCycleStart": "2026-01-01T00:00:00Z",
"billingCycleEnd": "2026-02-01T00:00:00Z"
}
错误响应
- 服务密钥无效或权限不足
- 你的套餐不支持此功能 (需要企业版套餐)
- 超出速率限制
⌘I

