ReferenceMarkdown
Balance
GET /v1/balance returns what your API balance can spend now. Free, read only, any key.
curl -s https://vidlab.ai/v1/balance \
-H "Authorization: Bearer $VIDLAB_API_KEY"import os, requests
r = requests.get(
"https://vidlab.ai/v1/balance",
headers={"Authorization": f"Bearer {os.environ['VIDLAB_API_KEY']}"},
)
print(r.json()["data"]["available_usd"])const res = await fetch("https://vidlab.ai/v1/balance", {
headers: { Authorization: `Bearer ${process.env.VIDLAB_API_KEY}` },
});
console.log((await res.json()).data.available_usd);{
"data": {
"object": "balance",
"available_cents": 2500,
"available_usd": 25,
"balance_cents": 3000,
"monthly_credit_remaining_cents": 0,
"held_cents": 500,
"resets_at": null
}
}| Field | Type | What it is |
|---|---|---|
available_cents, available_usd | number | What you can spend now: balance plus monthly credit left, minus what running generations have reserved. |
balance_cents | integer | The credit you added. It does not expire. |
monthly_credit_remaining_cents | integer | Included monthly credit left, spent first. It resets on resets_at. |
held_cents | integer | Reserved by generations that are still running. |
resets_at | string or null | When the included monthly credit resets (UTC). |
100 credits are $1: available_cents of 2500 is $25.00, or 2,500 credits.