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

# List ledger entries

> Newest-first paginated view of every credit movement (full audit trail).



## OpenAPI

````yaml https://roughy-api-staging.fly.dev/v1/openapi.json get /v1/credits/history
openapi: 3.1.0
info:
  title: Roughy Public API
  version: 0.0.0
servers:
  - url: https://roughy-api-staging.fly.dev
    description: Staging
security: []
tags:
  - name: Projects
    description: >-
      Workflow containers. Every asset lives inside a project; a project groups
      everything for one piece of work (an episode, an interview, a talk).
  - name: Assets
    description: >-
      The unit of media. `POST /assets` creates one and opens its upload in a
      single call: the response body is the asset (its `upload_url` carries the
      transfer URL while `pending_upload`), and the TUS transfer URL also comes
      back in the `Location` header. List, detail (with signed download URL),
      and delete round it out. Each asset belongs to exactly one project;
      `language` is set at create and immutable.
  - name: Uploads
    description: >-
      Drive the TUS-resumable transfer that streams an asset's bytes. `POST
      /assets` opens the upload; `PATCH`/`HEAD` move and resume the bytes,
      `DELETE` cancels (removing the asset). Lost the transfer URL? Re-`GET` the
      asset — while it's `pending_upload`, `upload_url` carries it.
  - name: Cuts
    description: >-
      A kept-segment plan for an asset, computed automatically by Roughy. Create
      one with `POST /cuts {asset_id, script?}`, list with `GET /cuts`, read a
      cut, export it to NLE formats, and export its generated subtitle (SRT /
      VTT).
  - name: Renders
    description: >-
      Renders an asset to a video (`mp4`/`mov`) or audio (`m4a`/`mp3`) output,
      optionally applying a `cut_id`. `POST /renders {asset_id, cut_id?,
      output}` creates one; list, read (with a signed download URL), and cancel
      as a top-level `/renders` resource.
  - name: Webhooks
    description: >-
      Register endpoints to receive signed terminal-state events (cut / render /
      asset) instead of polling.
  - name: Credits
    description: Credit balance and usage history.
  - name: Users
    description: Your account and profile.
  - name: OAuth
    description: >-
      Device authorization grant (RFC 8628), served at app.roughy.ai/oauth/* for
      the editor plugin. Internal surface — not part of the public /v1 SDK.
  - name: billing
    description: Stripe customer portal, invoices, subscriptions.
  - name: api-keys
    description: Mint and revoke API keys.
  - name: auth
    description: Sign up, log in, log out, and OAuth flows for the dashboard.
  - name: webhooks
    description: Inbound provider webhooks (Stripe, Resend, ElevenLabs).
  - name: email-preferences
    description: Per-category transactional-email opt-out preferences.
  - name: sse
    description: Server-sent live updates per asset.
  - name: health
    description: Liveness and readiness probes.
paths:
  /v1/credits/history:
    get:
      tags:
        - Credits
      summary: List ledger entries
      description: Newest-first paginated view of every credit movement (full audit trail).
      operationId: get_history_v1_credits_history_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: >-
              Maximum number of ledger entries to return (1-200). Defaults to
              50.
            default: 50
            title: Limit
          description: Maximum number of ledger entries to return (1-200). Defaults to 50.
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: >-
              Number of entries to skip from the start of the listing. Defaults
              to 0.
            default: 0
            title: Offset
          description: >-
            Number of entries to skip from the start of the listing. Defaults to
            0.
      responses:
        '200':
          description: One page of ledger entries, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerHistoryResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    LedgerHistoryResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/LedgerEntryResponse'
          type: array
          title: Items
          description: Page of ledger entries.
        total:
          type: integer
          title: Total
          description: Total ledger entries across all pages — not the size of `items`.
        limit:
          type: integer
          title: Limit
          description: The `limit` echoed back from the request.
        offset:
          type: integer
          title: Offset
          description: The `offset` echoed back from the request.
      type: object
      required:
        - items
        - total
        - limit
        - offset
      title: LedgerHistoryResponse
      description: Paginated ledger, newest first.
      example:
        items:
          - created_at: '2026-05-02T08:54:52.423000Z'
            delta: 5000
            id: 019de7e5-d517-7461-93d3-2d7d66f52f30
            stripe_invoice_id: in_1NjK4lLkdIwHu7ix3sR8AbCd
            type: topup
          - asset_id: 019de810-1a87-72cc-b8bf-f9132aa07e91
            created_at: '2026-05-02T08:54:55.020000Z'
            delta: -1800
            id: 019de810-1a87-72cc-b8bf-f9132aa07e91
            type: consume_asset
        total: 2
        limit: 50
        offset: 0
    LedgerEntryResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Stable unique identifier for the ledger entry.
        type:
          $ref: '#/components/schemas/CreditLedgerEntryType'
          description: >-
            Movement type: `topup`, `refund`, `adjustment`, `expiry`, or
            `consume_asset`.
        delta:
          type: integer
          title: Delta
          description: >-
            Signed credit change. Positive when credits are added (`topup`,
            `refund`), negative when spent (`consume_asset`, `expiry`). An
            `adjustment` may be either sign.
        asset_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Asset Id
          description: >-
            Asset associated with the movement. Set on `consume_asset` (the
            per-asset charge, settled once the asset finishes processing);
            `null` otherwise.
        stripe_invoice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Stripe Invoice Id
          description: Linked Stripe invoice. Set on `topup` rows from billing webhooks.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the entry was recorded.
      type: object
      required:
        - id
        - type
        - delta
        - asset_id
        - stripe_invoice_id
        - created_at
      title: LedgerEntryResponse
      description: A credit-ledger entry.
      example:
        id: 019de7e5-d517-7461-93d3-2d7d66f52f30
        type: topup
        delta: 5000
        asset_id: null
        stripe_invoice_id: in_1NjK4lLkdIwHu7ix3sR8AbCd
        created_at: '2026-05-02T08:54:52.423000Z'
    CreditLedgerEntryType:
      type: string
      enum:
        - topup
        - refund
        - adjustment
        - expiry
        - consume_asset
      title: CreditLedgerEntryType
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        Pass your API key as `Authorization: Bearer sk_…`. Mint a key from your
        dashboard's API-keys page.
      scheme: bearer
      bearerFormat: sk_…

````