Skip to main content

GET /credits/history

This endpoint returns a list of the authenticated user’s credit transactions, including purchases, usage, and refunds.

Response

history
array
An array of transaction objects.
id
string
The unique identifier for the transaction.
type
string
The type of transaction (e.g., “purchase”, “usage”, “refund”).
amount
number
The number of credits involved in the transaction.
description
string
A description of the transaction.
createdAt
string
The timestamp for when the transaction occurred.
curl -X GET https://api.llmgenerator.com/api/v1/credits/history \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "history": [
    {
      "id": "txn_xxxxxxxx",
      "type": "purchase",
      "amount": 500,
      "description": "Purchased Pro Pack",
      "createdAt": "2023-10-01T10:00:00Z"
    },
    {
      "id": "txn_yyyyyyyy",
      "type": "usage",
      "amount": -50,
      "description": "llms.txt generation for example.com",
      "createdAt": "2023-10-27T10:01:00Z"
    }
  ]
}