List, download and pay your workspace's invoices. Amounts on an invoice (total_amount, amount_paid, amount_due) are in cents, tax included.
Reads need billing:read and the view_billing capability (workspace admins and owners). Paying needs billing:write and manage_billing. When an organization pays for its workspaces, invoices belong to the organization workspace.
→ Billing API · Subscription API
Invoice object
| Field | Type | Description |
|---|---|---|
id | string | Invoice ID |
type | string | invoice or credit_note. A credit note cancels the invoice in original_invoice_id |
invoice_number | string | Number printed on the invoice |
status | string | draft, finalized, corrected (replaced by a credit note) or voided |
kind | string | receipt, statement or prepaid (see below) |
payment_status | string | Empty for a receipt; otherwise open, paid or void |
issue_date, due_date | string | Issue date, and due date for an invoice that asks for payment |
total_amount | int64 | Total in cents |
amount_paid | int64 | Cents received so far |
amount_due | int64 | What is left to pay while open; 0 otherwise |
overdue | boolean | true when open and past due_date |
currency | string | Currency code |
kind | Meaning |
|---|---|
receipt | Records a payment you already made (a top-up, a subscription charge). Nothing is owed |
statement | Postpaid statement for what the workspace owes beyond its open invoices. Paid after it is issued |
prepaid | Credit purchase of an amount set by inference.sh. Paid after it is issued |
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /invoices | List invoices (cursor pagination) |
GET | /invoices/{id} | Get one invoice |
GET | /invoices/{id}/pdf | Returns { "url": "..." }, a short-lived link to the PDF |
POST | /invoices/{id}/send-email | Email the invoice |
GET | /invoices/details-complete | Whether the workspace has the billing details an invoice needs |
GET | /invoices/payments-without-invoice | Completed payments that have no invoice yet |
POST | /invoices/from-payment/{paymentRecordId} | Issue a receipt invoice for a completed payment |
POST | /invoices/{id}/pay | Open a card checkout for an open invoice |
Pay an invoice
POST /invoices/{id}/pay
Opens a Stripe Checkout session for what is left on an open statement or prepaid invoice and returns its URL. The checkout charges the invoice's own credit and tax, with no service fee. When the payment completes, the invoice becomes paid and the credit lands on the workspace balance.
1curl -X POST https://api.inference.sh/invoices/inv_abc123/pay \2 -H "Authorization: Bearer inf_your_key"1{ "data": { "url": "https://checkout.stripe.com/..." } }If a checkout for the same amount is already open, you get that one's URL back.
| HTTP | Code | When |
|---|---|---|
| 400 | validation_error | The amount left to pay is below the card minimum (see Minimum amounts) |
| 409 | conflict | The invoice is not open, or another payment for it is still going through |
| 503 | not_configured | Payments are not available on this server |
Emailed invoices link to the pay page in the web app: https://app.inference.sh/settings/billing/invoices/{invoice_id}/pay.
Minimum amounts
Invoice amounts use the same floors as balance top-ups and card payments.
| Rule | Minimum | When |
|---|---|---|
| Issue a statement or prepaid invoice | The top-up minimum (500 cents / $5 by default; billing.min_deposit_cents) | A statement whose amount due is below this is not issued; the amount carries forward to the next monthly statement. Prepaid invoices below the minimum are refused the same way. |
Pay by card (POST /invoices/{id}/pay or a saved-card charge toward an invoice) | 100 cents ($1) | Amounts from $1 through $4.99 can still be paid by card when the invoice itself was issued at or above the issue minimum. Below $1, the API returns 400 validation_error and asks you to pay by bank transfer or have staff mark the invoice paid. |
Balance top-ups (POST /billing/checkout, POST /billing/charge) still require at least 500 cents regardless of invoice rules.