Skip to main content
GET
https://api.keywordsai.co
/
api
/
credit-transactions
/
list
import requests

url = "https://api.keywordsai.co/api/credit-transactions/list/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())
{
  "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": {}
    }
  ]
}
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.
Credits only apply to the Chat Completions endpoint (/api/chat/completions). All other endpoints require customer-provided API credentials.

Query parameters

page
integer
default:1
Page number for pagination.
page_size
integer
default:100
Number of items per page. Maximum is 1000.

Response fields

Transaction object

id
string
Unique transaction identifier (e.g., ct_1a2b3c4d5e6f7g8h)
organization_subscription
integer
Subscription ID for the organization
unique_organization_id
string
Organization’s unique identifier (UUID format)
amount
float
Transaction amount in USD
  • Positive: Adds credits (purchase, grant, bonus)
  • Negative: Removes credits (adjustment, refund)
transaction_type
string
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
created_at
datetime
When transaction was created (ISO 8601 format)
expires_at
datetime
Expiration date for time-limited credits (nullable)
description
string
Human-readable description of the transaction
stripe_payment_intent_id
string
Stripe payment intent ID (for purchases)
metadata
object
Additional JSON metadata

Response

{
  "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": {}
    }
  ]
}
import requests

url = "https://api.keywordsai.co/api/credit-transactions/list/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
print(response.json())