Skip to main content
POST
/
api
/
v1
/
UsageConfig
Set Usage Configuration
curl --request POST \
  --url https://server.codeium.com/api/v1/UsageConfig \
  --header 'Content-Type: application/json' \
  --data '{
  "service_key": "<string>",
  "clear_add_on_credit_cap": true,
  "set_add_on_credit_cap": 123,
  "team_level": true,
  "group_id": "<string>",
  "user_email": "<string>"
}'

Overview

Set or clear usage caps on add-on credits for your organization. You can scope these configurations to the team level, specific groups, or individual users.

Request

service_key
string
required
Your service key with appropriate permissions

Credit Cap Configuration (Choose One)

clear_add_on_credit_cap
boolean
Set to true to clear the existing add-on credit cap
set_add_on_credit_cap
integer
Set a new add-on credit cap (integer value)
You must provide either clear_add_on_credit_cap or set_add_on_credit_cap, but not both.

Scope Configuration (Choose One)

team_level
boolean
Set to true to apply the configuration at the team level
group_id
string
Apply the configuration to a specific group by providing the group ID
user_email
string
Apply the configuration to a specific user by providing their email address
You must provide one of team_level, group_id, or user_email to define the scope.

Example Request - Set Credit Cap for Team

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

Example Request - Set Credit Cap for Group

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

Example Request - Set Credit Cap for User

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

Example Request - Clear Credit Cap

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

Response

The response body is empty. A 200 status code indicates the operation was successful.

Error Responses

Common error scenarios:
  • Invalid service key or insufficient permissions
  • Both clear_add_on_credit_cap and set_add_on_credit_cap provided
  • Neither clear_add_on_credit_cap nor set_add_on_credit_cap provided
  • Multiple scope parameters provided
  • No scope parameter provided
  • Invalid group ID or user email
  • Rate limit exceeded
I