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

# Get Logstream Insights Token Usages



## OpenAPI

````yaml https://api.galileo.ai/public/v2/openapi.json post /v2/projects/{project_id}/log_streams/{log_stream_id}/logstream_insights/token_usage
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.galileo.ai
    description: Galileo Public APIs - galileo-v2
security: []
paths:
  /v2/projects/{project_id}/log_streams/{log_stream_id}/logstream_insights/token_usage:
    post:
      tags:
        - logstream-insights
      summary: Get Logstream Insights Token Usages
      operationId: >-
        get_logstream_insights_token_usages_v2_projects__project_id__log_streams__log_stream_id__logstream_insights_token_usage_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Project Id
        - name: log_stream_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Log Stream Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogstreamInsightTokenUsageRequest'
              default:
                starting_token: 0
                limit: 100
                filters: []
                sort:
                  name: created_at
                  ascending: false
                  sort_type: column
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogstreamInsightTokenUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - OAuth2PasswordBearer: []
        - HTTPBasic: []
components:
  schemas:
    LogstreamInsightTokenUsageRequest:
      properties:
        starting_token:
          type: integer
          title: Starting Token
          default: 0
        limit:
          type: integer
          title: Limit
          default: 100
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/LogstreamInsightTokenUsageCreatedAtFilter'
              - $ref: '#/components/schemas/LogstreamInsightTokenUsageUpdatedAtFilter'
            discriminator:
              propertyName: name
              mapping:
                created_at:
                  $ref: >-
                    #/components/schemas/LogstreamInsightTokenUsageCreatedAtFilter
                updated_at:
                  $ref: >-
                    #/components/schemas/LogstreamInsightTokenUsageUpdatedAtFilter
          type: array
          title: Filters
        sort:
          anyOf:
            - $ref: '#/components/schemas/LogstreamInsightTokenUsageCreatedAtSort'
            - type: 'null'
          default:
            name: created_at
            ascending: false
            sort_type: column
      type: object
      title: LogstreamInsightTokenUsageRequest
    LogstreamInsightTokenUsageResponse:
      properties:
        starting_token:
          type: integer
          title: Starting Token
          default: 0
        limit:
          type: integer
          title: Limit
          default: 100
        paginated:
          type: boolean
          title: Paginated
          default: false
        next_starting_token:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Starting Token
        token_usages:
          items:
            $ref: '#/components/schemas/LogStreamInsightTokenUsageDB'
          type: array
          title: Token Usages
      type: object
      title: LogstreamInsightTokenUsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LogstreamInsightTokenUsageCreatedAtFilter:
      properties:
        name:
          type: string
          const: created_at
          title: Name
          default: created_at
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
          title: Operator
        value:
          type: string
          format: date-time
          title: Value
      type: object
      required:
        - operator
        - value
      title: LogstreamInsightTokenUsageCreatedAtFilter
    LogstreamInsightTokenUsageUpdatedAtFilter:
      properties:
        name:
          type: string
          const: updated_at
          title: Name
          default: updated_at
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
          title: Operator
        value:
          type: string
          format: date-time
          title: Value
      type: object
      required:
        - operator
        - value
      title: LogstreamInsightTokenUsageUpdatedAtFilter
    LogstreamInsightTokenUsageCreatedAtSort:
      properties:
        name:
          type: string
          const: created_at
          title: Name
          default: created_at
        ascending:
          type: boolean
          title: Ascending
          default: true
        sort_type:
          type: string
          const: column
          title: Sort Type
          default: column
      type: object
      title: LogstreamInsightTokenUsageCreatedAtSort
    LogStreamInsightTokenUsageDB:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        project_id:
          type: string
          format: uuid4
          title: Project Id
        log_stream_id:
          type: string
          format: uuid4
          title: Log Stream Id
        token_usage:
          $ref: '#/components/schemas/TokenUsage'
      type: object
      required:
        - id
        - created_at
        - updated_at
        - project_id
        - log_stream_id
      title: LogStreamInsightTokenUsageDB
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TokenUsage:
      properties:
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
        cache_read_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Read Input Tokens
        cache_creation_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Creation Input Tokens
      type: object
      title: TokenUsage
      description: Token usage information for insights generation.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Galileo-API-Key
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: https://api.galileo.ai/login
    HTTPBasic:
      type: http
      scheme: basic

````