{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/strix-ai/json-schema/strix-ai-llm-request-entry-schema.json",
  "title": "LlmRequestEntry",
  "description": "One LLM provider attempt that the engine made. Holds provider metadata only.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/strix-ai-openapi.json#/components/schemas/LlmRequestEntry",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "run_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "scan",
        "pr_review",
        "chat",
        "auth_check",
        "asset_discovery",
        "app",
        "connection_test",
        null
      ]
    },
    "run_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "run_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The engine run name, which also names the run log."
    },
    "run_href": {
      "type": [
        "string",
        "null"
      ],
      "description": "Dashboard path of the run, when the run has a page."
    },
    "call_id": {
      "type": "string",
      "description": "The engine call ID, unique per attempt."
    },
    "route": {
      "type": "string",
      "enum": [
        "litellm",
        "openai"
      ]
    },
    "provider": {
      "type": [
        "string",
        "null"
      ],
      "description": "For example `anthropic`."
    },
    "model": {
      "type": "string"
    },
    "api_host": {
      "type": [
        "string",
        "null"
      ],
      "description": "Host of the provider endpoint."
    },
    "streaming": {
      "type": "boolean"
    },
    "outcome": {
      "type": "string",
      "enum": [
        "success",
        "error"
      ]
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "HTTP status from the provider."
    },
    "provider_request_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The request ID that the provider assigned. Quote this ID to the provider support team."
    },
    "response_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The response ID from the provider body."
    },
    "error_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "Exception class of a failed attempt."
    },
    "error_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "Error text of a failed attempt. The engine redacts secrets before it records the text."
    },
    "started_at": {
      "type": "string",
      "format": "date-time"
    },
    "finished_at": {
      "type": "string",
      "format": "date-time"
    },
    "duration_ms": {
      "type": "integer"
    },
    "input_tokens": {
      "type": [
        "integer",
        "null"
      ]
    },
    "output_tokens": {
      "type": [
        "integer",
        "null"
      ]
    },
    "cached_input_tokens": {
      "type": [
        "integer",
        "null"
      ]
    },
    "total_tokens": {
      "type": [
        "integer",
        "null"
      ]
    },
    "cost_usd": {
      "type": [
        "number",
        "null"
      ]
    },
    "agent_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "agent_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "retry_attempt": {
      "type": "integer",
      "description": "0 for the first attempt of a turn, then 1, 2 and so on for each retry."
    },
    "request_bytes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Size in bytes of the JSON request body that the SDK sent. Not the compressed size on the wire."
    },
    "response_bytes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Size in bytes of the JSON response body, or of the error body of a failed attempt."
    },
    "time_to_first_token_ms": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Streaming attempts only. Time from the start of the request to the first stream event."
    },
    "finish_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "The stop reason from the provider, for example `stop`, `tool_calls`, `max_tokens` or `incomplete:max_output_tokens`."
    },
    "response_headers": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Response headers from the provider, by lower-case header name. Headers whose name looks like a credential (authorization, cookie, api-key, secret, signature, session) are removed. Values are redacted and cut at 512 characters. At most 64 headers are kept."
    },
    "details": {
      "type": [
        "object",
        "null"
      ],
      "description": "Free-form provider and SDK metadata beyond the typed fields, for example the raw usage object, the stop sequence, the service tier or the system fingerprint. Content-shaped and secret-shaped keys are removed before storage. Limited to 16 KiB."
    }
  },
  "required": [
    "id",
    "call_id",
    "route",
    "model",
    "streaming",
    "outcome",
    "started_at",
    "finished_at",
    "duration_ms",
    "retry_attempt"
  ]
}