Billing data
Everything the Billing page of the client area shows can be read from a program: how much money is on the account, what has accrued since the last invoice, what is owed and until when, every invoice with its lines and its PDF, top-up receipts, payments and every movement of the balance. A separate call forecasts what each project will have cost by the end of its billing period. Use it to feed your accounting, to alert before a service is suspended, or to bill your own customers.
Nothing in this guide creates, pays or changes an invoice: every call here is a GET.
Getting started covers calls, answers and errors.
1. A key with billing access
Money of the account is read with an account key that has billing access. On the API tokens page, issue an account key and set Billing access to Read billing data. Read only access is enough for everything on this page. The default is no billing access, so an account key you already have does not read money until you issue one with it. Paying through the API is not published yet, so the client area offers no billing access beyond reading.
- A project key never reads account money:
403 account_key_required. - An account key without billing access gets
403 insufficient_scope, and thedetailsays it lacks billing access. - Only the account owner issues account keys, so team members do not read the company's money through the API.
export FBX_BILLING_KEY=fbx_...
2. Balance, debt and the deadline
curl -H "Authorization: Bearer $FBX_BILLING_KEY" https://api.fiberax.com/v1/billing/balance
{ "data": {
"credit": "9007.59", "currency": "EUR",
"accrued": { "total": "116.56334", "by_project": [
{ "project_id": 1313, "product": "vdc", "name": "vdc-main", "status": "active",
"accrued": "111.63996", "period_start": "2026-10-10T09:00:00Z" },
{ "project_id": 1387, "product": "s3", "name": "objectstorage", "status": "active",
"accrued": "4.92338", "period_start": "2026-10-10T07:00:00Z" },
{ "project_id": 1330, "product": "apitokens", "name": "apitokens", "status": "active",
"accrued": "0.00000", "period_start": "2026-06-25T12:04:46Z" } ] },
"unpaid": { "total": "0.00", "count": 0 },
"overdue": { "total": "0.00", "count": 0 },
"debt": { "blocked": false, "amount": "0.00", "threshold": "5.00" },
"suspension_expected_on": null, "termination_expected_on": null,
"estimated": true, "generated_at": "2026-10-31T10:30:00Z" } }
creditis the balance that pays invoices automatically.accruedis what each live service has charged since its last invoice, minus discounts - the same figure as the Billing page. It lists every live service of every product (servers, object storage, AI keys), because the invoice is one for all of them;totalis the sum of the lines. A service whose price lives in its invoices rather than in usage hasaccruednull.unpaidandoverdueare what is still to pay after credit already applied. A balance top-up that was started and never paid is not debt and is not counted.debt.blockedtells whether new paid resources are refused right now (402 client_has_debt). Itsamountis counted differently fromoverdue(lines without tax), so the two numbers can differ.suspension_expected_onis the day services are expected to be suspended for non-payment: the due day of the oldest unpaid invoice plus the suspension period of your account. It is an estimate - pay before it.nullmeans nothing is unpaid.
A simple alert: call this once an hour and raise it when overdue.count is above zero, or
when suspension_expected_on is a few days away.
3. Invoices
curl -H "Authorization: Bearer $FBX_BILLING_KEY" \
"https://api.fiberax.com/v1/billing/invoices?status=unpaid,paid&limit=50"
Newest first, at most limit per call (1 to 500, default 100). To read further back,
repeat the call with before_id set to the id of the oldest invoice you got.
start and end limit the day of issue and go only as a pair - one of them alone is
refused with 422 invalid_request; project_id keeps the invoices that charge one
project; overdue=true keeps those past their due day; status takes any of the states an
invoice shows (unpaid, paid, cancelled, refunded,
collections, chargeback, processing, credited,
credit_note), comma-separated.
numberis the final invoice number, given when the invoice is paid; before that it isnullandproforma_numberis the number printed on the document.totalis the invoice before credit,credit_appliedwhat the balance paid,amount_duewhat is left to pay while the invoice is unpaid, and"0.00"once it is paid or cancelled.kind: "top_up"marks an older balance top-up that was issued as an invoice: it is not debt.
One invoice with its lines:
curl -H "Authorization: Bearer $FBX_BILLING_KEY" https://api.fiberax.com/v1/billing/invoices/1648
Usage lines carry quantity, unit and unit_price as the document
prints them ("209.84 IP-hours at 0.00278"). A line that cannot be read reliably has them
null rather than a guess; its amount is always exact.
The document itself:
curl -H "Authorization: Bearer $FBX_BILLING_KEY" -o invoice.pdf \
https://api.fiberax.com/v1/billing/invoices/1648/pdf
The body is the PDF (application/pdf), not the JSON envelope; a refusal still comes as
JSON. An invoice of another account and an unknown id both answer 404 invoice_not_found.
4. Receipts, payments and the balance
GET /v1/billing/receipts- receipts of balance top-ups. Their PDF (/v1/billing/receipts/{id}/pdf) exists once the receipt is paid; before that it answers409 document_not_final.GET /v1/billing/payments- money that came through a payment provider (card and others) and refunds, with the provider's fee.GET /v1/billing/balance/transactions- every movement of the balance with the balance after it: invoices paid from the balance, top-ups, vouchers, refunds of credit. A manual correction by Fiberax hastype: "adjustment"and no text.
All three are bounded lists like the invoices: newest first, limit,
before_id, and an optional time window (start and end, as a pair).
5. Forecast of the month
curl -H "Authorization: Bearer $FBX_ACCOUNT_KEY" https://api.fiberax.com/v1/account/forecast
For every live project: what it has charged in its current billing period (accrued), what
it charged in its last recorded hour (hourly_rate), the hours left until the period closes,
and forecast = accrued + hourly_rate x remaining_hours. A project key reads its own project
with GET /v1/project/costs/forecast. A forecast is usage, not account money, so it needs no
billing access.
- It is an estimate (
estimated: true), not an invoice: usage changes, discounts are not taken off, and recording runs one to two hours behind. - A project that recorded nothing in the last 6 hours has
hourly_rateandforecastnull- an idle project and a delayed recording look the same, so no rate is promised. The account answer then hascomplete: false: the sum lacks that project.
6. Costs of the account, per project and per customer
curl -H "Authorization: Bearer $FBX_ACCOUNT_KEY" \
"https://api.fiberax.com/v1/account/costs?start=2026-10-01T00:00:00Z&end=2026-11-01T00:00:00Z&group_by=label&label_prefix=cust-"
What every project of the account has run up, in one call. Each project comes with the same buckets and
total that GET /v1/projects/{id}/costs gives for the same window, and total
of the answer is exactly their sum. With start and end projects closed within the window
are there too (deleted: true) - they were charged. Without them every project is read over its own
current billing period. Like the forecast, this is usage and needs no billing access.
- If you resell, label each project with the number of your customer (
labelsofPOST /v1/projectsorPATCH /v1/projects/{id}), then ask withgroup_by=label: one group per label with its projects, items and total, andunlabeledfor the rest. A project with two labels is in both groups andgroups_overlapistrue;label_prefix=cust-takes only your customer labels into groups, so each project counts once.label=cust-42reads one customer. - One call reads at most about 100000 usage records (a project records one per billed resource per hour) and
returns at most 5000 buckets; a wider request is refused with
window_too_largeorgranularity_too_fine- read a month at a time, or one customer at a time. GET /v1/account/costs/csvgives the same rows as a CSV file for a spreadsheet or an accounting import: one row per item, with the project, its labels, the time span, the quantity and the amount.- Per server:
GET /v1/projects/{id}/costs/serverssplits a project by server, and each server'sitemsby kind of resource.granularity=hourlygives the hours of the last 35 days, up to the last recorded hour;/csvat the end of the path gives the same as a file. Each item also carriesquantityandunit- core-hours, GB-hours, address-hours, GPU-hours, the hours a server spent on a plan - recorded together with the charge, so a price change does not move them and you can bill your customers at your own prices. Backups carry none, and neither does time recorded before the platform began to keep them.
7. Price before you create
curl -H "Authorization: Bearer $FBX_PROJECT_KEY" \
"https://api.fiberax.com/v1/server-types/4/quote?cores=4&memory_mb=8192&disk_gb=80&public_ip=true"
What a server would cost, line by line, before you create it: the same fields you would send to
create it, the same refusals creation would give. Prices follow the billing: every line is an hourly rate,
and its monthly price is that rate x 720, rounded to the cent, as in the type's pricing. The monthly total is
the sum of those rounded lines, so it can differ from hourly x 720 by a cent or two. Discounts of
your account are not taken off.
8. What is not here yet
Paying an invoice from the balance, topping up and redeeming vouchers through the API are not published yet: pay in the client area.
Notifications about invoices and a low balance come as webhooks: see Webhooks and budgets.