> ## 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 team usage insights

> Compare sessions, turns, tokens, Tembo pull requests, and model cost by current active team membership. Team totals can overlap.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public get /v1/insights/teams
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/insights/teams:
    get:
      tags:
        - Insights
      summary: List team usage insights
      description: >-
        Compare sessions, turns, tokens, Tembo pull requests, and model cost by
        current active team membership. Team totals can overlap.
      operationId: listInsightTeams
      parameters:
        - in: query
          name: range
          schema:
            default: 1y
            type: string
            enum:
              - 1d
              - 7d
              - 30d
              - 1y
          description: >-
            Time range to aggregate: last day, 7 days, 30 days, or year.
            Defaults to 1y.
        - in: query
          name: teamId
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: Filter activity to current active team members.
        - in: query
          name: cursor
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          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:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
          description: >-
            Maximum number of items to return in one page. Use nextCursor from
            the response to fetch more items.
      responses:
        '200':
          description: List team usage insights
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                        name:
                          type: string
                        members:
                          type: number
                        activeMembers:
                          type: number
                        turnsByPeriod:
                          type: array
                          items:
                            type: number
                        turns:
                          type: number
                          description: Messages the user sent to agents.
                        sessions:
                          type: number
                          description: Sessions the user started.
                        totalTokens:
                          type: number
                        prsCreated:
                          type: number
                          description: Pull requests Tembo opened from the user's sessions.
                        prsMerged:
                          type: number
                          description: >-
                            Pull requests from the user's sessions that were
                            merged.
                        modelCostUsd:
                          type:
                            - number
                            - 'null'
                      required:
                        - id
                        - name
                        - members
                        - activeMembers
                        - turnsByPeriod
                        - turns
                        - sessions
                        - totalTokens
                        - prsCreated
                        - prsMerged
                        - modelCostUsd
                      additionalProperties: false
                  nextCursor:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      - type: 'null'
                required:
                  - items
                  - nextCursor
                additionalProperties: false
        '400':
          description: >-
            Invalid request or missing required organization or user
            information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Insight operation conflicts with its current state
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Insight operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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