{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usestring-ai/json-schema/usestring-ai-browser-session-list-schema.json",
  "title": "BrowserSessionList",
  "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/BrowserSessionList",
  "type": "object",
  "required": [
    "sessions",
    "limit",
    "offset"
  ],
  "properties": {
    "sessions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BrowserSession"
      }
    },
    "limit": {
      "type": "integer"
    },
    "offset": {
      "type": "integer"
    }
  },
  "$defs": {
    "BrowserSession": {
      "type": "object",
      "required": [
        "id",
        "status",
        "contextId",
        "persist",
        "proxy",
        "record",
        "frameCount",
        "attempts",
        "closeCode",
        "closeReason",
        "createdAt",
        "startedAt",
        "endedAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^ses_[0-9a-f]{32}$"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "connecting",
            "running",
            "ended",
            "failed",
            "expired"
          ],
          "description": "`expired` is a created session that was never connected within its ten minutes."
        },
        "connectUrl": {
          "type": "string",
          "description": "Present while `pending`: the `/wss` URL that connects this session, once. Send the API key as the `Authorization` header."
        },
        "connectBy": {
          "type": "string",
          "format": "date-time",
          "description": "Present while `pending`: the session expires unconnected after this."
        },
        "contextId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "persist": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "proxy": {
          "type": "object",
          "required": [
            "tier",
            "countryCode",
            "provider",
            "zone"
          ],
          "properties": {
            "tier": {
              "type": "string",
              "enum": [
                "standard",
                "premium"
              ]
            },
            "countryCode": {
              "type": [
                "string",
                "null"
              ]
            },
            "provider": {
              "type": [
                "string",
                "null"
              ],
              "description": "The exit provider the session was routed through, once it connected."
            },
            "zone": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "record": {
          "type": "boolean",
          "description": "Whether a screencast replay is recorded."
        },
        "frameCount": {
          "type": "integer",
          "description": "Replay frames stored so far."
        },
        "attempts": {
          "type": "integer",
          "description": "Browser launches it took to connect; capacity retries add one each."
        },
        "closeCode": {
          "type": [
            "integer",
            "null"
          ]
        },
        "closeReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "startedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "endedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}