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

# List billing history

> One page of your organization's billing history, newest first.

Every purchase and every call that cost something, as one list. A call's line carries
the room and **one entry per participant connection** — how long each was connected,
how many minutes each was billed, and what each cost — so a spend line can be expanded
in place without a request per line.

Switch on `kind`: `room_usage` lines carry `room`, credit lines carry
`provider_reference`. `delta_cents` is signed the same way for both, so a page sums
without special-casing.

Use `expand` to control how much of each call is loaded — drop to `room` or `none` when
you are not drawing the breakdown, since each level costs a join the one below does not.

**Each connection is billed by the started minute and counted separately — the
translator included — so a short conversation between several people can bill more
minutes than it lasted.** `room.total_charged_cents` is the sum of the breakdown, and a
live room shows only the connections that have already ended.

Use `limit` and `offset` to page through it. A room's breakdown is never split across
pages.

**A call is one line here, not one per participant**, even though the ledger underneath
records a charge per connection. That is the point of this endpoint: the amounts you see
sum to the balance exactly once.



## OpenAPI

````yaml https://api.staging.glot.com/openapi.json get /v1/billing/history
openapi: 3.1.0
info:
  title: glot-api
  version: 0.1.0
servers:
  - url: https://api.staging.glot.com
security: []
tags:
  - name: rooms
    description: Create translation rooms and let participants join them.
  - name: invites
    description: Invite links that let a guest join a room without an account.
  - name: usage
    description: Minutes and charges over time, for reporting and charts.
  - name: billing
    description: Buy prepaid credit and review the balance behind it.
  - name: api-keys
    description: Create and revoke keys used to authenticate requests.
  - name: supported-languages
    description: Languages available for translation.
  - name: users
    description: The authenticated user's own profile.
paths:
  /v1/billing/history:
    get:
      tags:
        - billing
      summary: List billing history
      description: >-
        One page of your organization's billing history, newest first.


        Every purchase and every call that cost something, as one list. A call's
        line carries

        the room and **one entry per participant connection** — how long each
        was connected,

        how many minutes each was billed, and what each cost — so a spend line
        can be expanded

        in place without a request per line.


        Switch on `kind`: `room_usage` lines carry `room`, credit lines carry

        `provider_reference`. `delta_cents` is signed the same way for both, so
        a page sums

        without special-casing.


        Use `expand` to control how much of each call is loaded — drop to `room`
        or `none` when

        you are not drawing the breakdown, since each level costs a join the one
        below does not.


        **Each connection is billed by the started minute and counted separately
        — the

        translator included — so a short conversation between several people can
        bill more

        minutes than it lasted.** `room.total_charged_cents` is the sum of the
        breakdown, and a

        live room shows only the connections that have already ended.


        Use `limit` and `offset` to page through it. A room's breakdown is never
        split across

        pages.


        **A call is one line here, not one per participant**, even though the
        ledger underneath

        records a charge per connection. That is the point of this endpoint: the
        amounts you see

        sum to the balance exactly once.
      operationId: list_billing_history_v1_billing_history_get
      parameters:
        - name: expand
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/HistoryExpansion'
            description: >-
              How much of each call to include. `participants` returns the room
              and one entry per connection; `room` returns the room without the
              breakdown, for a list that expands lazily via `GET
              /v1/rooms/{room_id}`; `none` returns the amounts alone, for a
              total or a chart. Each level costs a join the level below does
              not.
            default: participants
          description: >-
            How much of each call to include. `participants` returns the room
            and one entry per connection; `room` returns the room without the
            breakdown, for a list that expands lazily via `GET
            /v1/rooms/{room_id}`; `none` returns the amounts alone, for a total
            or a chart. Each level costs a join the level below does not.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageResponse_HistoryLineResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HistoryExpansion:
      type: string
      enum:
        - none
        - room
        - participants
      title: HistoryExpansion
      description: >-
        How much of a spend line to load.


        A flag rather than two endpoints, because the levels differ only in how
        much of the

        *same* line is fetched — the list, its rooms, its breakdowns — not in
        what a line is.

        Each level includes the one before it: a breakdown with no room to hang
        it on is not a

        shape any caller wants.


        It is not cosmetic. ``NONE`` performs no joins at all, because a line
        carries its own

        ``kind``/``occurred_at``/``delta_cents``/``currency``; ``ROOM`` adds one
        join;

        ``PARTICIPANTS`` adds a second and multiplies the rows by the people on
        each call. A

        caller drawing a total or a sparkline should not pay for breakdowns it
        will not render.
    PageResponse_HistoryLineResponse_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/HistoryLineResponse'
          type: array
          title: Items
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
        next_offset:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Offset
      type: object
      required:
        - items
        - limit
        - offset
        - next_offset
      title: PageResponse[HistoryLineResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HistoryLineResponse:
      properties:
        kind:
          type: string
          title: Kind
        occurred_at:
          type: string
          format: date-time
          title: Occurred At
        delta_cents:
          type: integer
          title: Delta Cents
        currency:
          type: string
          title: Currency
        room:
          anyOf:
            - $ref: '#/components/schemas/RoomUsageResponse'
            - type: 'null'
        provider_reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Reference
      type: object
      required:
        - kind
        - occurred_at
        - delta_cents
        - currency
      title: HistoryLineResponse
      description: >-
        One line of the balance history as a person reads it.


        Not one `CreditMovement`. A room's cost is a debit per participant
        *connection*, so

        what a reader recognises as "that call cost me 14c" is a group of ledger
        rows, while

        "I topped up" is a single one. This is the union of the two, so a client
        renders one

        list and expands a spend line in place.


        **`kind` is the discriminator, and the two payloads are mutually
        exclusive.** A

        `room_usage` line carries `room` and no `provider_reference`; every
        other kind carries

        `provider_reference` and no `room`. Switch on `kind` rather than testing
        which field is

        null — new kinds may be added, `room` is also absent when `expand` did
        not ask for it,

        and a missing `room` is therefore not by itself evidence of a purchase.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    RoomUsageResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        streaming_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Streaming Mode
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        total_connection_minutes:
          type: integer
          title: Total Connection Minutes
        total_charged_cents:
          type: integer
          title: Total Charged Cents
        participants:
          items:
            $ref: '#/components/schemas/ParticipantUsageResponse'
          type: array
          title: Participants
      type: object
      required:
        - id
        - name
        - streaming_mode
        - started_at
        - ended_at
        - total_connection_minutes
        - total_charged_cents
        - participants
      title: RoomUsageResponse
      description: >-
        A room and what it cost, with its per-participant breakdown.


        The room as a *billing* line rather than as a resource: what appears
        under one spend

        row of `GET /v1/billing/history`.


        Deliberately not `RoomDetailResponse`, which this would otherwise
        duplicate. That

        schema carries `created_by`, and resolving it costs a query against
        `users` per page —

        worth it on a room endpoint, pure overhead on a history page where the
        reader already

        knows it is their own organization's spend. `sid` and `status` are
        dropped for the same

        reason: they say how the room was provisioned, not what it cost.
    ParticipantUsageResponse:
      properties:
        id:
          type: integer
          title: Id
        participant_identity:
          type: string
          title: Participant Identity
        participant_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Participant Kind
        languages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Languages
        joined_at:
          type: string
          format: date-time
          title: Joined At
        left_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Left At
        connection_minutes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Connection Minutes
        charged_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Charged Cents
      type: object
      required:
        - id
        - participant_identity
        - participant_kind
        - languages
        - joined_at
        - left_at
        - connection_minutes
        - charged_cents
      title: ParticipantUsageResponse
      description: >-
        One participant's connection to a room, and what it cost.


        A participant who drops and rejoins appears once per connection.

        `connection_minutes` and `charged_cents` are `null` while the
        participant is still

        connected.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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