{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usestring-ai/json-schema/usestring-ai-browser-session-replay-schema.json",
  "title": "BrowserSessionReplay",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usestring-ai-sessions-api-openapi.yml#/components/schemas/BrowserSessionReplay",
  "type": "object",
  "required": [
    "id",
    "status",
    "frameCount",
    "format",
    "chunks",
    "expiresAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "frameCount": {
      "type": "integer"
    },
    "format": {
      "const": "ndjson",
      "description": "Each chunk is newline-delimited JSON, one frame per line: `{t, target, data, width, height}`, where `t` is epoch ms, `target` names the tab, and `data` is a base64 JPEG."
    },
    "chunks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "tabId",
          "index",
          "url"
        ],
        "properties": {
          "tabId": {
            "type": "string",
            "description": "The recorded tab; each tab has its own chunks."
          },
          "index": {
            "type": "integer",
            "description": "Chunk k covers 10 s from the session's first recorded frame plus k·10 s."
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the chunk URLs stop working."
    }
  }
}