List credit transactions

Returns all credit transactions for your organization with complete audit trail history. Transactions are append-only and immutable, providing a permanent record of all credit changes. <Note> Credits only apply to the Chat Completions endpoint (`/api/chat/completions`). All other endpoints require customer-provided API credentials. </Note> ## Query parameters - `page` *integer*: Page number for pagination. - `page_size` *integer*: Number of items per page. Maximum is 1000. ## Response fields ### Transaction object Unique transaction identifier (e.g., `ct_1a2b3c4d5e6f7g8h`) Subscription ID for the organization Organization's unique identifier (UUID format) Transaction amount in USD - Positive: Adds credits (purchase, grant, bonus) - Negative: Removes credits (adjustment, refund) Type of transaction: - `purchase` - Customer purchased credits - `grant` - Admin granted free credits - `adjustment` - Admin adjustment (positive or negative) - `refund` - Refund issued - `bonus` - Promotional or bonus credits When transaction was created (ISO 8601 format) Expiration date for time-limited credits (nullable) Human-readable description of the transaction Stripe payment intent ID (for purchases) Additional JSON metadata ## Response ```json 200 OK { "count": 3, "next": null, "previous": null, "results": [ { "id": "ct_3c4d5e6f", "organization_subscription": 42, "unique_organization_id": "8264a3f4-40c7-476a-97d1-96908127ea21", "amount": -50.0, "transaction_type": "adjustment", "created_at": "2025-12-27T11:00:00.000Z", "expires_at": null, "description": "Correcting previous grant error", "stripe_payment_intent_id": "", "metadata": {} }, { "id": "ct_2b3c4d5e", "organization_subscription": 42, "unique_organization_id": "8264a3f4-40c7-476a-97d1-96908127ea21", "amount": 100.0, "transaction_type": "grant", "created_at": "2025-12-27T10:30:00.000Z", "expires_at": null, "description": "Welcome bonus", "stripe_payment_intent_id": "", "metadata": {} }, { "id": "ct_1a2b3c4d", "organization_subscription": 42, "unique_organization_id": "8264a3f4-40c7-476a-97d1-96908127ea21", "amount": 500.0, "transaction_type": "purchase", "created_at": "2025-12-27T09:00:00.000Z", "expires_at": null, "description": "Credit purchase", "stripe_payment_intent_id": "pi_1234567890abcdef", "metadata": {} } ] } ``` ```json 401 Unauthorized { "detail": "Your API key is invalid or expired" } ``` ```python Python url = "https://api.respan.ai/api/credit-transactions/list/" headers = { "Authorization": "Bearer YOUR_API_KEY" } response = requests.get(url, headers=headers) print(response.json()) ``` ```typescript TypeScript const url = 'https://api.respan.ai/api/credit-transactions/list/'; const headers = { 'Authorization': 'Bearer YOUR_API_KEY' }; const response = await fetch(url, { method: 'GET', headers: headers }); const data = await response.json(); console.log(data); ``` ```bash cURL curl -X GET "https://api.respan.ai/api/credit-transactions/list/" \ -H "Authorization: Bearer YOUR_API_KEY" ```

Authentication

AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys

Query parameters

pageintegerOptionalDefaults to 1
Page number for pagination.
page_sizeintegerOptionalDefaults to 100
Number of items per page. Maximum is 1000.

Response

Successful response for List credit transactions
countinteger
Total number of results
resultslist of objects
Array of results for the current page
nextstring or null
URL for the next page of results
previousstring or null
URL for the previous page of results

Errors

401
Unauthorized Error