API Reference
Auto-generated
Usage
API reference for usage endpoints.
Auto-generated
This page was generated from the OpenAPI spec. Run
make generate-docs to refresh after spec changes.GET /api/v1/usage/limits
GET
/api/v1/usage/limitsGet Usage Limits
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/usage/limits \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"account_tier": "example",
"tier_name": "example",
"entitlement_source": "example",
"rpm_write": 0,
"rpm_write_method": 0,
"rpm_read": 0
}GET /api/v1/usage/products
GET
/api/v1/usage/productsGet Product Usage
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| days | integer | Optional | Period in daysDefault: 30 |
| hours | integer | Optional | Period in hours; overrides days |
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/usage/products \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"products": [],
"period_start": "example",
"period_end": "example"
}GET /api/v1/usage/tags
GET
/api/v1/usage/tagsList Usage Tags
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| since | string | Optional | Only rows at or after this time |
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/usage/tags \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"tags": [],
"since": "example"
}PUT /api/v1/usage/tags/{tag}
PUT
/api/v1/usage/tags/{tag}Put Usage Tag Budget
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| tag | string | Required | tag |
| X-Organization-Id | string | Optional | X-Organization-Id |
| max_spend_usd | number | Required | Spend cap in USD |
| expires_at | string | Optional | expires_at |
Request Example
Bash
curl -X PUT https://api.alterlab.io/api/v1/usage/tags/<tag> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"max_spend_usd": 0
}'Response Example
JSON
{
"tag": "example",
"max_spend_microcents": 0,
"max_spend_usd": 0,
"expires_at": "example"
}