Latitude · Schema

AnalyticsQuery

CompanyArtificial IntelligenceObservabilityMonitoringPlatformAgents
View JSON Schema on GitHub

JSON Schema

latitude-so-analytics-query-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/latitude-so/main/json-schema/latitude-so-analytics-query-schema.json",
  "title": "AnalyticsQuery",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/latitude-so-openapi.json#/components/schemas/AnalyticsQuery",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "stream": {
          "type": "string",
          "enum": [
            "traces"
          ]
        },
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500,
          "description": "Semantic search query, combined with `filters` via AND. Ranks/filters by relevance."
        },
        "breakdown": {
          "type": "string",
          "enum": [
            "model",
            "provider",
            "service",
            "tool",
            "tag",
            "name",
            "userId",
            "status"
          ],
          "description": "Dimension to group by, one row per value."
        },
        "metric": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "count"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "errorRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "cacheHitRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "sum"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "min"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "max"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "avg"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "median"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "percentile"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                },
                "p": {
                  "type": "number",
                  "minimum": 1,
                  "maximum": 99
                }
              },
              "required": [
                "kind",
                "field",
                "p"
              ]
            }
          ],
          "description": "The metric: `count`, `errorRate`, `cacheHitRate`, `{sum|min|max|avg|median}` over `duration`/`cost`/`tokens`, or `{kind:'percentile',field,p}` for an arbitrary percentile (`p` in [1,99]; e.g. `p:95`)."
        },
        "timeBucket": {
          "type": "object",
          "properties": {
            "unit": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week"
              ],
              "description": "Bucket granularity."
            },
            "size": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true,
              "maximum": 365,
              "default": 1,
              "description": "Number of units per bucket (e.g. `2` weeks)."
            }
          },
          "required": [
            "unit"
          ],
          "description": "Bucket the metric over time. Omit for a single aggregate."
        },
        "range": {
          "type": "object",
          "properties": {
            "fromIso": {
              "type": "string",
              "format": "date-time",
              "description": "Inclusive lower bound (ISO-8601)."
            },
            "toIso": {
              "type": "string",
              "format": "date-time",
              "description": "Exclusive upper bound (ISO-8601). Must be after `fromIso`."
            }
          },
          "required": [
            "fromIso",
            "toIso"
          ],
          "description": "The time window."
        },
        "orderBy": {
          "type": "object",
          "properties": {
            "by": {
              "type": "string",
              "enum": [
                "value",
                "key"
              ],
              "default": "value"
            },
            "direction": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          "default": {
            "by": "value",
            "direction": "desc"
          },
          "description": "Sort for breakdown results. Defaults to value-desc."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": true,
          "maximum": 500,
          "default": 50,
          "description": "Maximum rows returned. Defaults to 50; max 500."
        },
        "filters": {
          "allOf": [
            {
              "$ref": "#/$defs/FilterSet"
            },
            {
              "description": "Structured filter set applied to the stream (same DSL as `listTraces`)."
            }
          ]
        }
      },
      "required": [
        "stream",
        "metric",
        "range"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "stream": {
          "type": "string",
          "enum": [
            "sessions"
          ]
        },
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500,
          "description": "Semantic search query, combined with `filters` via AND. Ranks/filters by relevance."
        },
        "breakdown": {
          "type": "string",
          "enum": [
            "model",
            "provider",
            "service",
            "tool",
            "tag",
            "userId",
            "status"
          ],
          "description": "Dimension to group by, one row per value."
        },
        "metric": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "count"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "errorRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "cacheHitRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "sum"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "min"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "max"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "avg"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "median"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "percentile"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                },
                "p": {
                  "type": "number",
                  "minimum": 1,
                  "maximum": 99
                }
              },
              "required": [
                "kind",
                "field",
                "p"
              ]
            }
          ],
          "description": "The metric: `count`, `errorRate`, `cacheHitRate`, `{sum|min|max|avg|median}` over `duration`/`cost`/`tokens`, or `{kind:'percentile',field,p}` for an arbitrary percentile (`p` in [1,99]; e.g. `p:95`)."
        },
        "timeBucket": {
          "type": "object",
          "properties": {
            "unit": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week"
              ],
              "description": "Bucket granularity."
            },
            "size": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true,
              "maximum": 365,
              "default": 1,
              "description": "Number of units per bucket (e.g. `2` weeks)."
            }
          },
          "required": [
            "unit"
          ],
          "description": "Bucket the metric over time. Omit for a single aggregate."
        },
        "range": {
          "type": "object",
          "properties": {
            "fromIso": {
              "type": "string",
              "format": "date-time",
              "description": "Inclusive lower bound (ISO-8601)."
            },
            "toIso": {
              "type": "string",
              "format": "date-time",
              "description": "Exclusive upper bound (ISO-8601). Must be after `fromIso`."
            }
          },
          "required": [
            "fromIso",
            "toIso"
          ],
          "description": "The time window."
        },
        "orderBy": {
          "type": "object",
          "properties": {
            "by": {
              "type": "string",
              "enum": [
                "value",
                "key"
              ],
              "default": "value"
            },
            "direction": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          "default": {
            "by": "value",
            "direction": "desc"
          },
          "description": "Sort for breakdown results. Defaults to value-desc."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": true,
          "maximum": 500,
          "default": 50,
          "description": "Maximum rows returned. Defaults to 50; max 500."
        },
        "filters": {
          "allOf": [
            {
              "$ref": "#/$defs/FilterSet"
            },
            {
              "description": "Structured filter set applied to the stream (same DSL as `listTraces`)."
            }
          ]
        }
      },
      "required": [
        "stream",
        "metric",
        "range"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "stream": {
          "type": "string",
          "enum": [
            "spans"
          ]
        },
        "breakdown": {
          "type": "string",
          "enum": [
            "model",
            "provider",
            "service",
            "tool",
            "tag",
            "operation",
            "status"
          ],
          "description": "Dimension to group by, one row per value."
        },
        "metric": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "count"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "errorRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "cacheHitRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "sum"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "min"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "max"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "avg"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "median"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "percentile"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "duration",
                    "cost",
                    "tokens"
                  ]
                },
                "p": {
                  "type": "number",
                  "minimum": 1,
                  "maximum": 99
                }
              },
              "required": [
                "kind",
                "field",
                "p"
              ]
            }
          ],
          "description": "The metric: `count`, `errorRate`, `cacheHitRate`, `{sum|min|max|avg|median}` over `duration`/`cost`/`tokens`, or `{kind:'percentile',field,p}` for an arbitrary percentile (`p` in [1,99]; e.g. `p:95`)."
        },
        "timeBucket": {
          "type": "object",
          "properties": {
            "unit": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week"
              ],
              "description": "Bucket granularity."
            },
            "size": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true,
              "maximum": 365,
              "default": 1,
              "description": "Number of units per bucket (e.g. `2` weeks)."
            }
          },
          "required": [
            "unit"
          ],
          "description": "Bucket the metric over time. Omit for a single aggregate."
        },
        "range": {
          "type": "object",
          "properties": {
            "fromIso": {
              "type": "string",
              "format": "date-time",
              "description": "Inclusive lower bound (ISO-8601)."
            },
            "toIso": {
              "type": "string",
              "format": "date-time",
              "description": "Exclusive upper bound (ISO-8601). Must be after `fromIso`."
            }
          },
          "required": [
            "fromIso",
            "toIso"
          ],
          "description": "The time window."
        },
        "orderBy": {
          "type": "object",
          "properties": {
            "by": {
              "type": "string",
              "enum": [
                "value",
                "key"
              ],
              "default": "value"
            },
            "direction": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          "default": {
            "by": "value",
            "direction": "desc"
          },
          "description": "Sort for breakdown results. Defaults to value-desc."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": true,
          "maximum": 500,
          "default": 50,
          "description": "Maximum rows returned. Defaults to 50; max 500."
        },
        "filters": {
          "$ref": "#/$defs/SpanRowFilterSet"
        }
      },
      "required": [
        "stream",
        "metric",
        "range"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "stream": {
          "type": "string",
          "enum": [
            "scores"
          ],
          "description": "Scored occurrences. A signal is scores carrying a `signalId` — analyze one signal via `stream: \"scores\"` filtered by `score.signalId` (or broken down by `signalId`)."
        },
        "breakdown": {
          "type": "string",
          "enum": [
            "signalId",
            "source",
            "model",
            "provider",
            "service",
            "tool",
            "tag"
          ],
          "description": "Dimension to group by: `signalId`/`source` (direct) or a trace dim (`model`…`tag`)."
        },
        "metric": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "count"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "passRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "errorRate"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "avg"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "value"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "min"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "value"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "max"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "value"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "median"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "value"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            }
          ],
          "description": "The metric: `count`, `passRate`, `errorRate`, or `{avg|min|max|median}` of the 0–1 score `value`."
        },
        "timeBucket": {
          "type": "object",
          "properties": {
            "unit": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week"
              ],
              "description": "Bucket granularity."
            },
            "size": {
              "type": "integer",
              "minimum": 0,
              "exclusiveMinimum": true,
              "maximum": 365,
              "default": 1,
              "description": "Number of units per bucket (e.g. `2` weeks)."
            }
          },
          "required": [
            "unit"
          ],
          "description": "Bucket the metric over time. Omit for a single aggregate."
        },
        "range": {
          "type": "object",
          "properties": {
            "fromIso": {
              "type": "string",
              "format": "date-time",
              "description": "Inclusive lower bound (ISO-8601)."
            },
            "toIso": {
              "type": "string",
              "format": "date-time",
              "description": "Exclusive upper bound (ISO-8601). Must be after `fromIso`."
            }
          },
          "required": [
            "fromIso",
            "toIso"
          ],
          "description": "The time window."
        },
        "orderBy": {
          "type": "object",
          "properties": {
            "by": {
              "type": "string",
              "enum": [
                "value",
                "key"
              ],
              "default": "value"
            },
            "direction": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          "default": {
            "by": "value",
            "direction": "desc"
          },
          "description": "Sort for breakdown results. Defaults to value-desc."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": true,
          "maximum": 500,
          "default": 50,
          "description": "Maximum rows returned. Defaults to 50; max 500."
        },
        "filters": {
          "allOf": [
            {
              "$ref": "#/$defs/FilterSet"
            },
            {
              "description": "Structured filter set applied to the stream (same DSL as `listTraces`)."
            }
          ]
        }
      },
      "required": [
        "stream",
        "metric",
        "range"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "stream": {
          "type": "string",
          "enum": [
            "behaviors"
          ],
          "description": "Taxonomy observations — behavior instances clustered from session moments."
        },
        "breakdown": {
          "type": "string",
          "enum": [
            "cluster",
            "session",
            "method"
          ],
          "description": "Dimension to group by: `cluster`, `session`, or `method`."
        },
        "metric": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "count"
                  ]
                }
              },
              "required": [
                "kind"
              ]
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "avg"
                  ]
                },
                "field": {
                  "type": "string",
                  "enum": [
                    "confidence"
                  ]
                }
              },
              "required": [
                "kind",
                "field"
              ]
            },
           

# --- truncated at 32 KB (43 KB total) ---
# Full source: https://artifacts.apis.io/latitude-so/json-schema/latitude-so-analytics-query-schema.json

Work with this as data

Every JSON Schema 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 schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • 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 JSON Schema
curl "https://apis.io/api/v1/json-schemas/latitude-so-analytics-query"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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.