Overview
PUT
/usage/usage-counters/{scope}/{principalId}/{periodStart}usageUpdate usage_counters
Replace a record in usage-counters by scope, principalId, periodStart.
Auth: bearerAuth — calls run as the authenticated user.
Parameters
- scopepathstring
- principalIdpathstring
- periodStartpathstring
Request body
application/json · optional
- scopeoptionalstring
- principalIdoptionalstring
- periodStartoptionalstring
- requestsoptionalinteger
- bytesoptionalinteger
Example
{
"scope": "string",
"principalId": "string",
"periodStart": "string",
"requests": 0,
"bytes": 0
}Responses
200
usage_counters
- scopestring
- principalIdstring
- periodStartstring
- requestsinteger
- bytesinteger
- updatedAtstring
Example
{
"scope": "string",
"principalId": "string",
"periodStart": "string",
"requests": 0,
"bytes": 0,
"updatedAt": "string"
}400
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}401
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}404
Error
- erroroptionalobject
Example
{
"error": {
"message": "string",
"code": "string"
}
}Code examples
cURL
curl -X PUT "https://api.agenticdeveloperhub.com/usage/usage-counters/{scope}/{principalId}/{periodStart}" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"scope": "string",
"principalId": "string",
"periodStart": "string",
"requests": 0,
"bytes": 0
}'JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/usage/usage-counters/{scope}/{principalId}/{periodStart}", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: "{\n \"scope\": \"string\",\n \"principalId\": \"string\",\n \"periodStart\": \"string\",\n \"requests\": 0,\n \"bytes\": 0\n}",
});
const data = await res.json();