API reference
Early access. The VeraGen API is not open yet: this reference shows what it will do, and keys cannot be created until it opens. Request early access.
API reference
Usage
What the account has been billed, by day and by feature, and its balance.
Get usage
GET
/v1/usageusage:readWhat the account was billed between two dates (UTC, both included), in total, per day and per feature, and its balance now. The default is this month so far. Amounts are what the account is charged, in micros (1,000,000 = US$1); the _usd strings are the same amounts rounded to the cent. Only days with usage are listed. At most 366 days per request.
Parameters
| Name | Type | Description |
|---|---|---|
fromquery | string (date) | First day, YYYY-MM-DD (UTC). Default: the first of this month. |
toquery | string (date) | Last day, YYYY-MM-DD (UTC), included. Default: today. |
Response 200
| Field | Type | Description |
|---|---|---|
from | string (date) | |
to | string (date) | |
currency | string | |
total_micros | integer | Billed in the window, in micros. |
total_usd | string | The same, in US dollars, rounded to the cent. |
balance_micros | integer | The account's prepaid balance now, in micros. |
balance_usd | string | |
by_day | array of object | |
by_day[].day | string (date) | |
by_day[].micros | integer | |
by_feature | array of object | Largest first. feature is the name Observability shows each line under. |
by_feature[].feature | string | |
by_feature[].micros | integer |
Errors
- 400 The request is not valid.
- 401 No valid API key.
- 403 The key may not do this.
- 404 No endpoint at that path.
- 429 Too many requests.
- 500 Something went wrong on our side.
The codes are listed under Errors.
cURL
curl "https://api.veragen.ai/v1/usage" \
-H "Authorization: Bearer $VERAGEN_API_KEY"JavaScript
const res = await fetch("https://api.veragen.ai/v1/usage", {
headers: { Authorization: `Bearer ${process.env.VERAGEN_API_KEY}` },
});
const data = await res.json();Python
import os, requests
res = requests.get(
"https://api.veragen.ai/v1/usage",
headers={"Authorization": f"Bearer {os.environ['VERAGEN_API_KEY']}"},
)
data = res.json()Response 200
{
"from": "2026-10-01",
"to": "2026-10-03",
"currency": "usd",
"total_micros": 2731500,
"total_usd": "2.73",
"balance_micros": 47268500,
"balance_usd": "47.27",
"by_day": [
{
"day": "2026-10-01",
"micros": 912000
},
{
"day": "2026-10-02",
"micros": 1384250
},
{
"day": "2026-10-03",
"micros": 435250
}
],
"by_feature": [
{
"feature": "workflow",
"micros": 1953000
},
{
"feature": "studio_chat",
"micros": 640500
},
{
"feature": "compute",
"micros": 138000
}
]
}