{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/riskmodels-app/json-schema/riskmodels-app-agent-meta-schema.json",
  "title": "AgentMeta",
  "description": "Per-request billing and telemetry metadata appended to metered responses.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/riskmodels-app-plaid-integration-api-openapi.yml#/components/schemas/AgentMeta",
  "type": "object",
  "properties": {
    "cost_usd": {
      "type": "number",
      "format": "float",
      "description": "Cost deducted from prepaid balance for this request. 0 if served from cache."
    },
    "latency_ms": {
      "type": "integer",
      "description": "Server processing time in milliseconds."
    },
    "request_id": {
      "type": "string",
      "description": "Unique request identifier for support lookups."
    },
    "confidence": {
      "type": "object",
      "properties": {
        "overall": {
          "type": "number",
          "format": "float",
          "minimum": 0,
          "maximum": 1
        },
        "factors": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          }
        }
      }
    },
    "data_freshness": {
      "type": "string",
      "format": "date-time",
      "description": "ISO timestamp of the data's as-of datetime."
    },
    "billing_code": {
      "type": "string",
      "description": "Internal billing classification for this request type."
    },
    "cache_status": {
      "type": "string",
      "enum": [
        "HIT",
        "MISS",
        "BYPASS"
      ],
      "description": "Whether this response was served from cache."
    },
    "llm_cost_usd": {
      "type": "number",
      "format": "float",
      "description": "POST /chat only: portion of cost from LLM token billing (estimated preflight charge).\n"
    },
    "tool_cost_usd": {
      "type": "number",
      "format": "float",
      "description": "POST /chat only; sum of internal data tool charges for this turn."
    },
    "tool_calls": {
      "type": "integer",
      "description": "POST /chat only; number of tool invocations in this request."
    }
  }
}