Kong · Schema

LLMQuery

A query targeting the LLM usage analytics datasource.

API GatewayAI GatewayAI ConnectivityAgent GatewayEvent GatewayMCP RegistryService MeshLLMKafkaKonnectOpen-Source

Properties

Name Type Description
datasource string
metrics object
dimensions array List of attributes or entity types to group by.
filters object
granularity object
time_range object
View JSON Schema on GitHub

JSON Schema

kong-llmquery-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/LLMQuery",
  "title": "LLMQuery",
  "description": "A query targeting the LLM usage analytics datasource.",
  "type": "object",
  "properties": {
    "datasource": {
      "type": "string",
      "enum": [
        "llm_usage"
      ]
    },
    "metrics": {
      "$ref": "#/components/schemas/LLMMetrics"
    },
    "dimensions": {
      "description": "List of attributes or entity types to group by.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "control_plane",
          "control_plane_group",
          "gateway_service",
          "consumer",
          "application",
          "route",
          "ai_provider",
          "ai_response_model",
          "ai_request_model",
          "llm_cache_status",
          "llm_embeddings_provider",
          "llm_embeddings_model",
          "time",
          "realm",
          "status_code",
          "status_code_grouped",
          "ai_plugin"
        ],
        "x-speakeasy-unknown-values": "allow"
      },
      "maxItems": 2
    },
    "filters": {
      "$ref": "#/components/schemas/LLMFilters"
    },
    "granularity": {
      "$ref": "#/components/schemas/Granularity"
    },
    "time_range": {
      "$ref": "#/components/schemas/TimeRange"
    }
  },
  "example": {
    "datasource": "llm_usage",
    "time_range": {
      "type": "relative",
      "time_range": "24h",
      "tz": "EST"
    },
    "dimensions": [
      "time",
      "ai_plugin"
    ],
    "filters": [
      {
        "operator": "in",
        "field": "control_plane",
        "value": [
          "d5ac5d88-efed-4e10-9dfe-0b0a6646c219"
        ]
      }
    ],
    "granularity": "hourly",
    "metrics": [
      "total_tokens"
    ]
  },
  "additionalProperties": false,
  "required": [
    "datasource"
  ]
}