跳转到主要内容
POST
/
api
/
v1
/
GetUsageConfig
获取用量配置
curl --request POST \
  --url https://server.codeium.com/api/v1/GetUsageConfig \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_key": "<string>",
  "team_level": true,
  "group_id": "<string>",
  "user_email": "<string>"
}
'
{
  "addOnCreditCap": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt

Use this file to discover all available pages before exploring further.

概述

获取你的组织当前的按用户计费的附加额度上限配置。上限始终按用户设置。当你按团队或组作用域查询时,响应将返回已应用于该团队或组内用户的每用户上限。

请求

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

作用域配置 (任选一项)

team_level
boolean
设为 true 以获取适用于团队内所有用户的每用户上限
group_id
string
提供组 ID,以获取适用于特定组内所有用户的每用户上限
user_email
string
提供电子邮件地址,以获取特定用户的配置
你必须提供 team_levelgroup_iduser_email 其中之一来定义作用域。

示例请求 - 获取团队中所有用户的每用户上限

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

示例请求 - 获取组内所有用户的每位用户上限

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

示例请求 - 获取用户配置

curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "user_email": "user@example.com"
}' \
https://server.codeium.com/api/v1/GetUsageConfig

响应

addOnCreditCap
integer
已配置的附加额度上限值。如果响应中未返回此字段,则表示在所请求的作用域级别未配置上限。

示例响应 - 已设置上限

{
  "addOnCreditCap": 10000
}

响应示例 - 未设置上限

{}

错误响应

常见错误场景:
  • 服务密钥无效或权限不足
  • 提供了多个作用域参数
  • 未提供作用域参数
  • 组 ID 或用户邮箱无效
  • 超出速率限制