> ## Documentation Index
> Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Returns a merged, date-descending list of credit purchases and metered usage invoices for the account. Queried from Stripe in real time.

# List credit transactions



## OpenAPI

````yaml openapi/ai-gateway.yaml GET /credits/transactions
openapi: 3.0.3
info:
  title: AI Gateway APIs
  version: 0.1.0
  description: |
    Control-plane HTTP APIs served by the ai-gateway-control service.
servers:
  - url: https://api.ngrok.ai
security:
  - bearerAuth: []
tags:
  - name: AI Gateway Access Key Configurations
    description: Manage reusable access key configurations (scope and routing rules).
  - name: AI Gateway Access Keys
    description: Manage ngrok-managed access keys associated with AI Gateway endpoints.
  - name: AI Gateway Configuration
    description: >-
      Manage per-account AI Gateway configuration (timeouts, token caps,
      metadata).
  - name: AI Gateway API Keys
    description: Manage customer-facing AI Gateway API Keys.
  - name: AI Gateway Credits
    description: Purchase AI Gateway credits via Stripe Checkout.
  - name: AI Gateway Providers
    description: Manage AI Gateway providers and the models they expose.
  - name: AI Gateway Custom Providers
    description: Manage custom AI Gateway providers and the models they expose.
  - name: AI Gateway Provider Keys
    description: Manage provider keys attached to AI Gateway managed access keys.
  - name: AI Gateway Usage
    description: >-
      Read-only AI Gateway usage events and aggregated usage overview for the
      authenticated account.
paths:
  /credits/transactions:
    get:
      tags:
        - AI Gateway Credits
      summary: List credit transactions
      description: >-
        Returns a merged, date-descending list of credit purchases and metered
        usage invoices for the account. Queried from Stripe in real time.
      operationId: GetCreditTransactions
      responses:
        '200':
          description: The credit transaction history.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditTransactionList'
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    CreditTransactionList:
      type: object
      additionalProperties: false
      required:
        - items
      properties:
        items:
          type: array
          description: Credit transactions, ordered newest first.
          items:
            $ref: '#/components/schemas/CreditTransactionItem'
    CreditTransactionItem:
      oneOf:
        - $ref: '#/components/schemas/CreditTransactionCredits'
        - $ref: '#/components/schemas/CreditTransactionUsageInvoice'
        - $ref: '#/components/schemas/CreditTransactionUsageInvoicePreview'
      discriminator:
        propertyName: type
        mapping:
          credits:
            $ref: '#/components/schemas/CreditTransactionCredits'
          usageInvoice:
            $ref: '#/components/schemas/CreditTransactionUsageInvoice'
          usageInvoicePreview:
            $ref: '#/components/schemas/CreditTransactionUsageInvoicePreview'
    Error:
      type: object
      additionalProperties: false
      required:
        - statusCode
        - msg
        - details
      properties:
        errorCode:
          type: string
          description: Stable ngrok error code when available.
        statusCode:
          type: integer
          format: int32
          description: HTTP status code for this error.
        msg:
          type: string
          description: Human-readable error message.
        details:
          type: object
          description: Structured error details.
          additionalProperties:
            type: string
    CreditTransactionCredits:
      type: object
      additionalProperties: false
      required:
        - type
        - createdAt
        - category
        - amountCents
      properties:
        type:
          type: string
          enum:
            - credits
          description: The type of transaction.
        amountCents:
          type: integer
          format: int64
          minimum: 0
          description: Amount of credits granted in cents.
        category:
          type: string
          enum:
            - purchase
            - promotional
          description: Credit grant category.
        expiresAt:
          type: string
          format: date-time
          nullable: true
          description: When the credit grant expires. Null if the grant does not expire.
        createdAt:
          type: string
          format: date-time
          description: When this transaction occurred.
    CreditTransactionUsageInvoice:
      type: object
      additionalProperties: false
      required:
        - type
        - createdAt
        - periodStart
        - periodEnd
        - invoiceUrl
        - totalCents
        - appliedCreditsCents
        - amountDueCents
        - amountPaidCents
        - amountRemainingCents
      properties:
        type:
          type: string
          enum:
            - usageInvoice
          description: The type of transaction.
        createdAt:
          type: string
          format: date-time
          description: When this transaction occurred.
        periodStart:
          type: string
          format: date-time
          description: Start of the billing period.
        periodEnd:
          type: string
          format: date-time
          description: End of the billing period.
        invoiceUrl:
          type: string
          format: uri
          nullable: true
          description: Stripe-hosted invoice URL.
        totalCents:
          type: integer
          format: int64
          description: Invoice total before customer balance is applied.
        appliedCreditsCents:
          type: integer
          format: int64
          description: Amount of credits applied to this invoice (total minus amount_due).
        amountDueCents:
          type: integer
          format: int64
          description: Final amount due after credits are applied.
        amountPaidCents:
          type: integer
          format: int64
          description: Amount already paid.
        amountRemainingCents:
          type: integer
          format: int64
          description: Amount still owed.
    CreditTransactionUsageInvoicePreview:
      type: object
      additionalProperties: false
      required:
        - type
        - createdAt
        - periodStart
        - periodEnd
        - totalCents
        - appliedCreditsCents
        - amountDueCents
        - amountPaidCents
        - amountRemainingCents
      properties:
        type:
          type: string
          enum:
            - usageInvoicePreview
          description: The type of transaction.
        createdAt:
          type: string
          format: date-time
          description: When this transaction occurred.
        periodStart:
          type: string
          format: date-time
          description: Start of the billing period.
        periodEnd:
          type: string
          format: date-time
          description: End of the billing period.
        totalCents:
          type: integer
          format: int64
          description: Invoice total before customer balance is applied.
        appliedCreditsCents:
          type: integer
          format: int64
          description: Amount of credits applied to this invoice (total minus amount_due).
        amountDueCents:
          type: integer
          format: int64
          description: Final amount due after credits are applied.
        amountPaidCents:
          type: integer
          format: int64
          description: Amount already paid.
        amountRemainingCents:
          type: integer
          format: int64
          description: Amount still owed.
  responses:
    Error:
      description: API error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````