Usage
Track your spending, check your account balance, and view transaction history.
Authentication required: All usage endpoints require authentication via a Bearer token in the Authorization header.
Get Balance
GET /api/billing/balanceReturns your current account balance. No query parameters required.
Example Request
curl "https://conduit.im/api/billing/balance" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"balanceInCents": 4250,
"balanceInDollars": 42.5
}Response Fields
| Field | Type | Description |
|---|---|---|
| balanceInCents | integer | Current balance in cents |
| balanceInDollars | number | Current balance in dollars |
Transaction History
GET /api/billing/ledgerReturns a paginated list of your transaction history, ordered by most recent first.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of entries to return (1–100) |
| offset | integer | 0 | Number of entries to skip for pagination |
Example Request
curl "https://conduit.im/api/billing/ledger?limit=5&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"entries": [
{
"id": "clx1abc2def3ghi4jkl",
"type": "USAGE_DEBIT",
"amountInCents": -12,
"balanceAfterInCents": 4250,
"metadata": {
"model": "gpt-4",
"tokens": 1523
},
"createdAt": "2026-03-09T14:32:00.000Z"
},
{
"id": "clx1mno5pqr6stu7vwx",
"type": "CREDIT_PURCHASE",
"amountInCents": 2000,
"balanceAfterInCents": 4262,
"metadata": {
"stripePaymentId": "pi_abc123"
},
"createdAt": "2026-03-08T10:15:00.000Z"
}
],
"limit": 5,
"offset": 0,
"count": 2
}Entry Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier for the ledger entry |
| type | string | Transaction type (see below) |
| amountInCents | integer | Transaction amount in cents (negative for debits) |
| balanceAfterInCents | integer | Account balance after this transaction |
| metadata | object | Additional context (model used, payment ID, etc.) |
| createdAt | string | ISO 8601 timestamp of the transaction |
Transaction Types
| Type | Description |
|---|---|
| CREDIT_PURCHASE | Funds added to your account via Stripe payment |
| USAGE_DEBIT | Charges deducted for API usage |
| SUPPORT_CREDIT | Credits added by the support team |
| REFUND_DEBIT | Refund transactions processed on your account |
API Key Spending Limits
Each API key can have individual spending limits configured to help you control costs. These are managed through the API Keys dashboard.
| Field | Description |
|---|---|
| spendingLimit | Maximum amount (in cents) the key can spend per period |
| spendingType | FIXED (one-time limit) or RECURRING (resets each period) |
| spendingPeriod | Reset period for recurring limits: DAILY, WEEKLY, or MONTHLY |
Next Steps
- Manage your API keys and configure spending limits
- Chat Completions API — start making API requests
- Error Handling — understand error responses and codes