Credits and billing
Introduction
Authenticate with Authorization: Bearer <ANYCAP_API_KEY>. The key selects its billing account: an organization key reads the whole organization, a personal key reads the personal account. Results are not limited to calls made by this key. No organization or user ID is needed.
| GET | Description |
|---|---|
/v1/billing/balance | Returns account_id and wallet: available_microcredits, reserved_microcredits, units_per_credit, status, checked_at. |
/v1/billing/summary | Groups settled charges by category and capability; items contain settlement_count and charged_microcredits. |
/v1/billing/consumptions | Pages settled entries: id, reservation_id, created_at, category, capability, charged_microcredits, plus next_cursor. |
Summary and consumptions accept optional from (inclusive) and to (exclusive), in RFC3339, category (such as chat, image, video, audio, social), and capability (catalog key such as image.generate). Consumptions also accepts page_size (default 50, range 1–100) and cursor (the previous next_cursor), ordered by descending ledger ID. Summary is unpaginated; settlement_count counts settlement entries. Holds are excluded and released differences are not charged twice. Amounts are integer microcredit strings; 1000000 microcredits = 1 credit. Empty results have items=[]; the final next_cursor is null.
curl "https://api.anycap.io/v1/billing/balance" \ -H "Authorization: Bearer $ANYCAP_API_KEY"curl "https://api.anycap.io/v1/billing/summary?category=image&from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z" \ -H "Authorization: Bearer $ANYCAP_API_KEY"curl "https://api.anycap.io/v1/billing/consumptions?capability=image.generate&page_size=20" \ -H "Authorization: Bearer $ANYCAP_API_KEY"Example consumption response (32 credits):
{ "account_id": "11111111-1111-4111-8111-111111111111", "items": [ { "id": "120", "reservation_id": "22222222-2222-4222-8222-222222222222", "created_at": "2026-11-12T08:00:00Z", "category": "image", "capability": "image.generate", "charged_microcredits": "32000000" } ], "next_cursor": null, "units_per_credit": "1000000"}Invalid parameters return 400; missing, invalid or revoked keys return 401; insufficient workspace permissions return 403; rate limits return 429.
One credit equals 1,000,000 microcredits. The console displays 1000 credits = $1 (USD = microcredits / 1,000,000,000). Settlement always uses server integer microcredits, never floating-point USD.
- A quote does not reserve credits; submitting an execution holds a reservation.
- A successful task settles by the actual usage; a definite failure releases the reservation.
- New customer totals round up to a whole credit, with a minimum of one credit.
- Missing or contradictory usage keeps the reservation for reconciliation rather than assuming zero cost.
| billing_status | Meaning |
|---|---|
held | Reservation held before settlement. |
pending | Outcome unknown; reservation retained. |
settled | Charge settled by actual usage. |
released | Reservation released without a charge. |