githubEdit

get__credits_transactions

GET /credits/transactions

Get Credit Transaction History

Returns a paginated list of credit transactions for the authenticated user's organization. Each transaction is either a credit in (purchase, grant) or a credit out (consumption). Optional filters include direction, date range, and repository.

TypeScript Client Library

public getCreditsTransactions = async (query: GetCreditsTransactionsRequest): Promise<GetCreditsTransactionsResponse> => {
  return this.makeRequest<GetCreditsTransactionsResponse>('credits/transactions', 'GET', query);
};

Code Samples

# All params optional
curl -X GET 'https://backend.flashback.tech/credits/transactions?page=1&limit=20&direction=out' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Example responses

200 Response

{
  "success": true,
  "data": [
    {
      "id": "tx-uuid-1",
      "creditAmount": -12.5,
      "createdAt": "2026-01-30T10:00:00.000Z",
      "description": "Storage egress: 1.25 GB on public node",
      "type": "consumption",
      "rateType": "Public Node",
      "rateConcept": "Per GB Egress",
      "rateUsed": 10,
      "repoId": "repo-uuid",
      "unitId": "unit-uuid",
      "host": "us-east-1-gcp.flashback.tech"
    },
    {
      "id": "tx-uuid-2",
      "creditAmount": 1100,
      "createdAt": "2026-01-15T00:00:00.000Z",
      "description": "Credit pack purchase: Pack 1 (1100 credits)",
      "type": "purchase",
      "packName": "Pack 3"
    }
  ],
  "pagination": {
    "total": 42,
    "page": 1,
    "limit": 20
  }
}

400 Response

500 Response

Query Parameters

Name
Type
Required
Description

» page

integer

false

Page number (default: 1)

» limit

integer

false

Items per page (default: 50)

» direction

string

false

in, out, or all (default: all)

» startDate

string (date-time)

false

Filter transactions from this date

» endDate

string (date-time)

false

Filter transactions until this date

» repoId

string

false

Filter by repository ID

Responses

Status
Meaning
Description
Schema

200

OK

Paginated transaction list

Inline

400

Bad Request

Credits not enabled or no organization

Inline

404

Not Found

User not found

Inline

500

Internal Server Error

Server error

Inline

Response Schema (200)

Name
Type
Required
Description

» success

boolean

false

Whether the request succeeded

» data

array

false

List of transactions

»» id

string

false

Transaction ID

»» creditAmount

number

false

Amount (negative = consumption, positive = in)

»» createdAt

string (date-time)

false

When the transaction was created

»» description

string | null

false

Human-readable description

»» type

string

false

consumption, purchase, or grant

»» rateType

string

false

For consumption: rate type name

»» rateConcept

string

false

For consumption: rate concept name

»» rateUsed

number

false

For consumption: rate applied

»» repoId

string

false

For consumption: repository ID

»» unitId

string

false

For consumption: unit or AI LLM ID

»» host

string

false

For consumption: host

»» llmType

string

false

For AI consumption

»» llmModel

string

false

For AI consumption

»» subscriptionName

string

false

For grants: subscription name

»» packName

string

false

For purchases: pack name

» pagination

object

false

Pagination info

»» total

integer

false

Total number of transactions

»» page

integer

false

Current page

»» limit

integer

false

Page size

» error_code

string

false

Set on error

» message

string

false

Error or status message

Security

  • BearerAuth: Bearer token required.

  • Organization: Results are scoped to the user's organization.

Notes

  • Use direction=out to get only consumption (e.g. for consumption breakdown). The client method getCreditsConsumption(query) calls this endpoint with direction: 'out'.

  • Consumption items include rate and repo/unit/host (and llmType/llmModel for AI). Purchase/grant items include subscription or pack name.

Last updated

Was this helpful?