Skip to content
TriedDocs
Account

Check billing

Run the auto-recharge and monthly budget checks now.

POSThttps://api.tried.com.au/billing/check

Runs the auto-recharge and budget checks immediately. A scheduler runs the same checks in the background, so you only need this to act on a change right away. With auto-recharge on and the balance below the threshold, it buys auto_recharge_amount of credit (through Stripe when STRIPE_SECRET_KEY is set, the mock provider otherwise).

Request#

This endpoint takes no path, query or body parameters.

Example request#

curl -X POST https://api.tried.com.au/billing/check \
  -H "Authorization: Bearer $TRIED_API_KEY"
const res = await fetch("https://api.tried.com.au/billing/check", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const check = await res.json();
import os, requests

res = requests.post(
    "https://api.tried.com.au/billing/check",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
check = res.json()

Response#

200 OK

{
  "actions": [
    "auto_recharge",
    "budget_alert"
  ],
  "settings": {
    "provider": "mock",
    "auto_recharge_enabled": true,
    "auto_recharge_below": 10,
    "auto_recharge_amount": 50,
    "monthly_budget": 500,
    "month": "2026-10",
    "month_usage": 182.4375,
    "budget_percent": 36.5,
    "budget_reached": false,
    "payment_method": {
      "brand": "visa",
      "last4": "4242",
      "exp": "12/30"
    }
  },
  "summary": {
    "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
actions string[] What happened: auto_recharge, auto_recharge_failed:<error>, budget_alert (80% of budget crossed) or budget_reached (100% crossed). Empty when nothing was due.
settings object Billing settings, as in Get billing settings.
summary object Billing summary, as in Get billing.

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. A dashboard user with the member role gets The member role is read-only.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.