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

# Get credits spent on a record

> Owner or admin only. Returns the net credits charged to one record (charges minus refunds), as on the credits badge in the record panel. It matches the usage log filtered by `record_id`. A record never charged returns 0.




## OpenAPI

````yaml /openapi/billing.yaml get /workspaces/{workspaceId}/billing/records/{recordId}/credits
openapi: 3.1.0
info:
  title: Connie Billing API
  version: 1.0.0
  description: >
    Endpoints the Connie web app uses for billing. They authenticate with your
    signed-in browser session — see
    https://docs.connie.ai/api-reference/authentication. These are the app's own
    endpoints and can change when the app changes.
servers:
  - url: https://connie.ai/api
security:
  - sessionCookie: []
tags:
  - name: Credits
    description: >
      The workspace's credit balance. Any member can read the balance and plan
      prices; plan details and everything else in Billing are for workspace
      owners and admins only.
  - name: Plan
    description: The workspace's plan and subscription. Owners and admins only.
  - name: Usage log
    description: >-
      Every credit used or added, as shown in Settings > Logs. Owners and admins
      only.
paths:
  /workspaces/{workspaceId}/billing/records/{recordId}/credits:
    get:
      tags:
        - Usage log
      summary: Get credits spent on a record
      description: >
        Owner or admin only. Returns the net credits charged to one record
        (charges minus refunds), as on the credits badge in the record panel. It
        matches the usage log filtered by `record_id`. A record never charged
        returns 0.
      operationId: getRecordCredits
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - name: recordId
          in: path
          required: true
          description: The record id.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Credits for the record.
          content:
            application/json:
              schema:
                type: object
                properties:
                  record_id:
                    type: string
                    format: uuid
                  net_credits:
                    type: number
                    description: Credits spent on this record, after refunds.
                  event_count:
                    type: integer
                    description: Charges and refunds on this record.
                  shared_count:
                    type: integer
                    description: Lookups this record reused that another record paid for.
                  shared:
                    type: array
                    description: The newest 20 of those shared lookups.
                    items:
                      type: object
                      properties:
                        event_id:
                          type: string
                        occurred_at:
                          type: string
                          format: date-time
                        action_key:
                          type: string
                        action_label:
                          type: string
                        credits:
                          type: number
                        charged_record_id:
                          type:
                            - string
                            - 'null'
        '400':
          $ref: '#/components/responses/BadQuery'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AdminOnly'
        '404':
          description: The record isn't in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    workspaceId:
      name: workspaceId
      in: path
      required: true
      description: The workspace id, as in the app URL `connie.ai/<workspaceId>/...`.
      schema:
        type: string
        format: uuid
  responses:
    BadQuery:
      description: >-
        A query parameter is invalid (`VALIDATION_ERROR`); the message says
        which.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: No valid session, or the session has expired (`SESSION_EXPIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AdminOnly:
      description: >-
        You are not a member of this workspace, or you are not an owner or
        admin.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Too many requests (`RATE_LIMIT_EXCEEDED`). Wait for the `Retry-After`
        seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: A readable message.
        code:
          type: string
          description: A machine-readable code, when the route sets one.
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: header
      name: Cookie
      description: >-
        The full Cookie header copied from a signed-in connie.ai browser
        request. See the Authentication page.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.