Skip to main content
POST
https://server.codeium.com
/
api
/
v1
/
GetUsageConfig
利用上限設定の取得
curl --request POST \
  --url https://server.codeium.com/api/v1/GetUsageConfig \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_key": "<string>",
  "team_level": true,
  "group_id": "<string>",
  "user_email": "<string>"
}
'
{
  "add_on_credit_cap": 123
}

概要

組織の現在のアドオン用クレジット上限設定を取得します。チーム単位、特定のグループ単位、または個々のユーザー単位で設定を照会できます。

リクエスト

service_key
string
required
「請求 Read」権限を持つサービスキー

スコープ設定(いずれか1つを選択)

team_level
boolean
チームレベルの設定を取得するには、true を設定します
group_id
string
グループ ID を指定して、特定のグループの設定を取得します
user_email
string
メールアドレスを指定して、特定のユーザーの設定を取得します
スコープを定義するには、team_levelgroup_iduser_email のいずれか1つを指定する必要があります。

リクエスト例 - チームレベルの設定を取得

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": "[email protected]"
}' \
https://server.codeium.com/api/v1/GetUsageConfig

レスポンス

add_on_credit_cap
integer
設定されているアドオンのクレジット上限値。このフィールドがレスポンスに含まれていない場合、リクエストされたスコープレベルでは上限は設定されていません。

レスポンス例 - 上限を設定した場合

{
  "add_on_credit_cap": 10000
}

レスポンス例 - 上限未設定時

{}

エラーレスポンス

一般的なエラーシナリオ:
  • 無効なサービスキーまたは権限不足
  • 複数の scope パラメーターが指定されている
  • scope パラメーターが指定されていない
  • 無効なグループ ID またはユーザーのメールアドレス
  • レート制限を超過した