remagicaDocs home
API referenceUsage

List credit history

GET
/credits/history

Needs a key withusage:read

The credit ledger, newest first: grants (with their source), each workflow run (its estimate and what it actually cost, refunds of failed or cancelled results taken off), each generation made outside a run, and credits that expired (expire), were clawed back (reversal) or adjusted by staff (adjustment). Each line says which API key spent it (apiKey, null for the app); apiKeyId shows only one key's.

Requires scope usage:read.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Query Parameters

apiKeyId?string

Only what this API key spent (its id).

Length1 <= length
limit?integer
Range1 <= value <= 100
Default25
offset?integer
Range0 <= value
Default0

Response Body

A page of the history.

application/json
  1. response
entries*array<>
hasMore*boolean
Example Request
curl -X GET 'https://api.remagica.com/api/v1/credits/history'
Example Response
{  "entries": [    {      "amount": 12,      "apiKey": {        "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",        "name": "Autumn campaign"      },      "createdAt": "2026-10-21T12:00:00.000Z",      "estimated": 12,      "expiresAt": "2026-10-21T12:00:00.000Z",      "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",      "kind": "grant",      "model": "google/nano-banana-pro",      "note": "string",      "project": {        "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",        "name": "Autumn campaign"      },      "refunded": 1,      "runStatus": "string",      "source": "starting",      "user": {        "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",        "name": "Autumn campaign"      }    }  ],  "hasMore": true}