LangWatch Analytics API

The Analytics API from LangWatch — 1 operation(s) for analytics.

Operations 1

POST /api/analytics/timeseries #

Documentation

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/langwatch-analytics-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

langwatch-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LangWatch Agents Analytics API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
- url: https://app.langwatch.ai
security:
- project_api_key: []
tags:
- name: Analytics
paths:
  /api/analytics/timeseries:
    post:
      responses:
        '200':
          description: Timeseries analytics data with current and previous periods
          content:
            application/json:
              schema:
                type: object
                properties:
                  currentPeriod:
                    type: array
                    items:
                      type: object
                      additionalProperties: {}
                  previousPeriod:
                    type: array
                    items:
                      type: object
                      additionalProperties: {}
                required:
                - currentPeriod
                - previousPeriod
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
      operationId: postApiAnalyticsTimeseries
      parameters: []
      description: Query analytics timeseries data with metrics, aggregations, and filters
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                startDate:
                  anyOf:
                  - type: number
                  - type: string
                endDate:
                  anyOf:
                  - type: number
                  - type: string
                query:
                  type: string
                filters:
                  type: object
                  properties:
                    topics.topics:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    topics.subtopics:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.user_id:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.thread_id:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.customer_id:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.labels:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.key:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.value:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    metadata.prompt_ids:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    traces.origin:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    traces.error:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    traces.name:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    spans.type:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    spans.model:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.evaluator_id:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.evaluator_id.guardrails_only:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.evaluator_id.has_passed:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.evaluator_id.has_score:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.evaluator_id.has_label:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.passed:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.score:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.state:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    evaluations.label:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    events.event_type:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    events.metrics.key:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    events.metrics.value:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    events.event_details.key:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                    annotations.hasAnnotation:
                      anyOf:
                      - type: array
                        items:
                          type: string
                      - type: object
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: object
                        additionalProperties:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                  additionalProperties: false
                  default: {}
                traceIds:
                  type: array
                  items:
                    type: string
                negateFilters:
                  type: boolean
                series:
                  type: array
                  items:
                    type: object
                    properties:
                      metric:
                        type: string
                        enum:
                        - metadata.trace_id
                        - metadata.user_id
                        - metadata.thread_id
                        - metadata.span_type
                        - sentiment.thumbs_up_down
                        - performance.completion_time
                        - performance.first_token
                        - performance.total_cost
                        - performance.prompt_tokens
                        - performance.completion_tokens
                        - performance.total_tokens
                        - performance.tokens_per_second
                        - events.event_type
                        - events.event_score
                        - events.event_details
                        - evaluations.evaluation_score
                        - evaluations.evaluation_pass_rate
                        - evaluations.evaluation_runs
                        - threads.average_duration_per_thread
                      key:
                        type: string
                      subkey:
                        type: string
                      aggregation:
                        type: string
                        enum:
                        - terms
                        - cardinality
                        - avg
                        - sum
                        - min
                        - max
                        - median
                        - p99
                        - p95
                        - p90
                      pipeline:
                        type: object
                        properties:
                          field:
                            type: string
                            enum:
                            - trace_id
                            - user_id
                            - thread_id
                            - customer_id
                          aggregation:
                            type: string
                            enum:
                            - sum
                            - avg
                            - min
                            - max
                        required:
                        - field
                        - aggregation
                      filters:
                        type: object
                        properties:
                          topics.topics:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          topics.subtopics:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.user_id:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.thread_id:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.customer_id:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.labels:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.key:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.value:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          metadata.prompt_ids:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          traces.origin:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          traces.error:
                            anyOf:
                            - type: array
                              items:
                                type: string
                            - type: object
                              additionalProperties:
                                type: array
                                items:
                                  type: string
                            - type: object
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: string
                          traces.name:
                            anyOf:
                            - type: array
               

# --- truncated at 32 KB (46 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/langwatch/refs/heads/main/openapi/langwatch-analytics-api-openapi.yml