Returns the prepaid credit balance and every credit transaction. The first time a workspace reads billing, it gets a free trial credit of $10. Any role can call it.
Request#
This endpoint takes no path, query or body parameters.
Example request#
curl https://api.tried.com.au/billing \
-H "Authorization: Bearer $TRIED_API_KEY"const res = await fetch("https://api.tried.com.au/billing", {
headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const billing = await res.json();import os, requests
res = requests.get(
"https://api.tried.com.au/billing",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
billing = res.json()Response#
200 OK
{
"currency": "AUD",
"credit_balance": 41.8725,
"total_credits": 59.995,
"total_usage": 18.1225,
"transactions": [
{
"transaction_id": "ctx_6b8d0f2a4c6e8a0b2d4f6a8c",
"amount": -0.005,
"kind": "usage",
"description": "Contact memory: call_4e6a8c0b2d4f6a8c0e2b4d6f",
"created_timestamp": 1760745600000
},
{
"transaction_id": "ctx_2c4e6a8b0d2f4a6c8e0b2d4f",
"amount": 50,
"kind": "purchase",
"description": "Credit purchase ($50.00)",
"created_timestamp": 1760313600000
},
{
"transaction_id": "ctx_9a1c3e5b7d9f1a3c5e7b9d1f",
"amount": 10,
"kind": "grant",
"description": "Free trial credit",
"created_timestamp": 1758240000000
}
]
}| Field | Type | Description |
|---|---|---|
currency |
string | Always AUD. |
credit_balance |
number | total_credits minus total_usage, rounded to 4 decimals. |
total_credits |
number | Sum of all credit transactions. Platform usage (contact memory, AI QA, Conductor) is recorded as negative transactions, so it lowers this total. |
total_usage |
number | Sum of combined_cost over every call in the workspace. |
transactions |
object[] | All credit transactions, newest first: transaction_id (prefix ctx_), amount (AUD, negative for charges), kind (grant, purchase, usage or concurrency), description, created_timestamp. |
When credit_balance is 0 or less, call and chat creation return 402 with error_code: "credit_exhausted". See Get account status.
Errors#
| Status | When |
|---|---|
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the admin scope. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.