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

# List billing usage

> List session usage by default, or include warm pool compute with the type filter. Uses cursor pagination.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public get /v1/billing/usage
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/billing/usage:
    get:
      tags:
        - Billing
      summary: List billing usage
      description: >-
        List session usage by default, or include warm pool compute with the
        type filter. Uses cursor pagination.
      operationId: listBillingUsage
      parameters:
        - in: query
          name: cursor
          schema:
            type: string
            minLength: 1
            maxLength: 2048
          description: >-
            Continuation cursor from the previous response nextCursor. Omit for
            the first page; null nextCursor means there are no more pages.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
          description: >-
            Maximum number of items to return in one page. Use nextCursor from
            the response to fetch more items.
        - in: query
          name: type
          schema:
            type: string
            enum:
              - all
              - sessions
              - warm-pool
          description: >-
            Usage types to include. Defaults to sessions for backwards
            compatibility.
        - in: query
          name: sessionId
          schema:
            type: string
            minLength: 1
            maxLength: 255
          description: Filter billing usage to this session.
        - in: query
          name: createdAfter
          schema:
            type: string
            format: date-time
          description: >-
            Include sessions created or warm pool runtime at or after this ISO
            8601 timestamp.
        - in: query
          name: createdBefore
          schema:
            type: string
            format: date-time
          description: >-
            Include sessions created or warm pool runtime before this ISO 8601
            timestamp.
        - in: query
          name: createdBy
          schema:
            type: array
            items:
              type: string
              minLength: 1
          description: Filter by creator IDs, supplied as a comma-separated list.
        - in: query
          name: models
          schema:
            type: array
            items:
              type: string
              minLength: 1
              maxLength: 200
          description: Filter by model names, supplied as a comma-separated list.
        - in: query
          name: agentIds
          schema:
            type: array
            items:
              type: string
              format: uuid
          description: >-
            Filter by the agents that created sessions, supplied as a
            comma-separated list of agent IDs.
      responses:
        '200':
          description: List billing usage
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            agent:
                              type:
                                - string
                                - 'null'
                            id:
                              type: string
                              minLength: 1
                              maxLength: 255
                            title:
                              type: string
                            kind:
                              type: string
                            createdAt:
                              type: string
                              format: date-time
                            managedInferenceCredits:
                              type: number
                              minimum: 0
                            computeCredits:
                              type: number
                              minimum: 0
                            totalCredits:
                              type: number
                              minimum: 0
                            type:
                              type: string
                              const: session
                          required:
                            - agent
                            - id
                            - title
                            - kind
                            - createdAt
                            - managedInferenceCredits
                            - computeCredits
                            - totalCredits
                            - type
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              minLength: 1
                              maxLength: 255
                            virtualMachineId:
                              type: string
                              minLength: 1
                              maxLength: 255
                            startedAt:
                              type: string
                              format: date-time
                            endedAt:
                              type:
                                - string
                                - 'null'
                              format: date-time
                            runtimeMs:
                              type: number
                              minimum: 0
                            cpu:
                              type: number
                            memoryMb:
                              type: number
                            computeCredits:
                              type: number
                              minimum: 0
                            type:
                              type: string
                              const: warm-pool
                          required:
                            - id
                            - virtualMachineId
                            - startedAt
                            - endedAt
                            - runtimeMs
                            - cpu
                            - memoryMb
                            - computeCredits
                            - type
                          additionalProperties: false
                    maxItems: 100
                  nextCursor:
                    type:
                      - string
                      - 'null'
                    maxLength: 2048
                  asOf:
                    type: string
                    format: date-time
                required:
                  - items
                  - nextCursor
                  - asOf
                additionalProperties: false
        '400':
          description: Invalid request or missing organization billing information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Billing resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Billing operation conflicts with its current state
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '502':
          description: Billing provider operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |
            import Tembo from '@tembo-io/sdk';

            const client = new Tembo();

            const billing = await client.billing.listUsage({
              limit: 50,
            });
        - lang: rust
          label: Rust SDK
          source: |
            use tembo_rs::*;

            let client = Tembo::from_env()?;

            let response = client.billing().list_usage().send().await?;
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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