Skip to main content
POST
/
api
/
v1
/
GetUsageConfig
Get Usage Configuration
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>"
}
'
import requests

url = "https://server.codeium.com/api/v1/GetUsageConfig"

payload = {
"service_key": "<string>",
"team_level": True,
"group_id": "<string>",
"user_email": "<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>',
team_level: true,
group_id: '<string>',
user_email: '<string>'
})
};

fetch('https://server.codeium.com/api/v1/GetUsageConfig', 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/GetUsageConfig",
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>',
'team_level' => true,
'group_id' => '<string>',
'user_email' => '<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/GetUsageConfig"

payload := strings.NewReader("{\n \"service_key\": \"<string>\",\n \"team_level\": true,\n \"group_id\": \"<string>\",\n \"user_email\": \"<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/GetUsageConfig")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service_key\": \"<string>\",\n \"team_level\": true,\n \"group_id\": \"<string>\",\n \"user_email\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://server.codeium.com/api/v1/GetUsageConfig")

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 \"team_level\": true,\n \"group_id\": \"<string>\",\n \"user_email\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "addOnCreditCap": 123
}

Overview

Retrieve the current per-user add-on credit cap configuration for your organization. Caps are always per-user. When you query by team or group scope, the response returns the per-user cap that has been applied to users within that team or group.

Request

service_key
string
required
Your service key with “Billing Read” permissions

Scope Configuration (Choose One)

team_level
boolean
Set to true to retrieve the per-user cap applied to all users on the team
group_id
string
Retrieve the per-user cap applied to all users in a specific group by providing the group ID
user_email
string
Retrieve the configuration for 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 - Get Per-User Cap for All Users on Team

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

Example Request - Get Per-User Cap for All Users in a Group

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

Example Request - Get User Configuration

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

Response

addOnCreditCap
integer
The configured add-on credit cap value. If this field is not present in the response, there is no cap configured at the requested scope level.

Example Response - With Cap Configured

{
  "addOnCreditCap": 10000
}

Example Response - No Cap Configured

{}

Error Responses

Common error scenarios:
  • Invalid service key or insufficient permissions
  • Multiple scope parameters provided
  • No scope parameter provided
  • Invalid group ID or user email
  • Rate limit exceeded