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

# Query project analytics

> Runs one catalog aggregate over stored analytics for a project. Cost figures are Lemma estimates from observed token counts and public LiteLLM list prices — not invoice amounts. Backfilled rows carry the price as of the backfill run, not the price as of the call. Per-model attribution covers unwritten rows only.



## OpenAPI

````yaml https://api.uselemma.ai/openapi.json post /projects/{project_id}/analytics/query
openapi: 3.1.0
info:
  title: Lemma Platform API
  description: Lemma Platform HTTP API for AI observability and workspace operations.
  version: 0.1.0
servers:
  - url: https://api.uselemma.ai
    description: Lemma production API
security:
  - bearerAuth: []
paths:
  /projects/{project_id}/analytics/query:
    post:
      tags:
        - Projects
      summary: Query project analytics
      description: >-
        Runs one catalog aggregate over stored analytics for a project. Cost
        figures are Lemma estimates from observed token counts and public
        LiteLLM list prices — not invoice amounts. Backfilled rows carry the
        price as of the backfill run, not the price as of the call. Per-model
        attribution covers unwritten rows only.
      operationId: query_project_analytics
      parameters:
        - name: project_id
          in: path
          required: true
          description: Project ID.
          schema:
            type: string
      responses:
        '200':
          description: Analytics query rows
          content:
            application/json:
              schema:
                type: object
                properties:
                  rows:
                    type: array
                    items:
                      type: object
                      additionalProperties: {}
                  truncated:
                    type: boolean
                  window:
                    type: object
                    properties:
                      start:
                        type: string
                      end_exclusive:
                        type: string
                    required:
                      - start
                      - end_exclusive
                    additionalProperties: false
                required:
                  - rows
                  - truncated
                  - window
                additionalProperties: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````