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

# Get one chat's netted credit usage broken down by run

> One row per (tool, run) within the chat — backs the 'VyomFlow' aggregate row's Details drill-down, since that row nets a whole chat's spend across every tool/run with no single runId to key the run-scoped step breakdown off of. Caller-scoped: a chatId belonging to another user returns an empty `items`/`null` chatTitle, never a 404/403 leak.



## OpenAPI

````yaml /openapi.json get /api/v1/me/credits/ledger/chat/{chatId}
openapi: 3.1.0
info:
  title: VyomFlow API
  version: 1.0.0
  description: >-
    The versioned public REST surface (`/api/public/v1/*`, bearer API-key auth)
    plus the app's own internal `/api/v1/*` surface (Clerk session-token auth),
    generated directly from the same Zod contracts the Route Handlers validate
    against — never a hand-maintained duplicate. The MCP endpoint (`/api/mcp`)
    is a separate streamable-HTTP JSON-RPC transport, not expressible here — see
    the MCP guide.
servers:
  - url: https://api.vyomflow.co.in
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/me/credits/ledger/chat/{chatId}:
    get:
      tags:
        - Credits
      summary: Get one chat's netted credit usage broken down by run
      description: >-
        One row per (tool, run) within the chat — backs the 'VyomFlow' aggregate
        row's Details drill-down, since that row nets a whole chat's spend
        across every tool/run with no single runId to key the run-scoped step
        breakdown off of. Caller-scoped: a chatId belonging to another user
        returns an empty `items`/`null` chatTitle, never a 404/403 leak.
      parameters:
        - schema:
            type: string
          required: true
          name: chatId
          in: path
      responses:
        '200':
          description: That chat's netted usage, one row per run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditChatRuns'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - ClerkBearer: []
components:
  schemas:
    CreditChatRuns:
      type: object
      properties:
        chatTitle:
          type:
            - string
            - 'null'
        items:
          type: array
          items:
            type: object
            properties:
              runId:
                type: string
              toolName:
                type:
                  - string
                  - 'null'
              amount:
                type: string
              timestamp:
                type: string
            required:
              - runId
              - toolName
              - amount
              - timestamp
      required:
        - chatTitle
        - items
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    ClerkBearer:
      type: http
      scheme: bearer
      description: >-
        Clerk session token, `Authorization: Bearer <token>` — the first-party
        browser app's own auth. Used only by this internal `/api/v1/*` surface,
        never by `/api/public/v1/*`.

````