{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/placestack-com/json-schema/placestack-com-collection-request-schema.json",
  "title": "Collection[Request]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/placestack-com-usage-api-openapi.yml#/components/schemas/Collection_Request_",
  "properties": {
    "object": {
      "type": "string",
      "const": "list",
      "title": "Object",
      "description": "The object's type. Always `list`.",
      "default": "list"
    },
    "data": {
      "items": {
        "$ref": "#/$defs/Request"
      },
      "type": "array",
      "title": "Data",
      "description": "The results on this page."
    },
    "has_more": {
      "type": "boolean",
      "title": "Has More",
      "description": "Whether there are more results after this page."
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor",
      "description": "The cursor for the next page. Send it as `cursor`. Null on the last page."
    },
    "suppressed": {
      "type": "integer",
      "title": "Suppressed",
      "description": "The number of matching results withheld because the plan does not include them.",
      "default": 0
    },
    "total": {
      "anyOf": [
        {
          "$ref": "#/$defs/Total"
        },
        {
          "type": "null"
        }
      ],
      "description": "The number of matching results. Only on the first page, when `total=true` is sent. Null otherwise."
    }
  },
  "type": "object",
  "required": [
    "object",
    "data",
    "has_more",
    "next_cursor",
    "suppressed",
    "total"
  ],
  "$defs": {
    "Request": {
      "properties": {
        "object": {
          "type": "string",
          "const": "request",
          "title": "Object",
          "description": "The object's type. Always `request`.",
          "default": "request"
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Request Id",
          "description": "The request's id, also sent as the `request-id` response header. Include it when contacting support about a request."
        },
        "occurred_at": {
          "type": "string",
          "format": "date-time",
          "title": "Occurred At",
          "description": "Time at which the request was received."
        },
        "method": {
          "type": "string",
          "title": "Method",
          "description": "The HTTP method, such as `GET`."
        },
        "route": {
          "type": "string",
          "title": "Route",
          "description": "The endpoint, as its path template, such as `/v1/parcel/{parcel_id}`. Path values and query strings are not stored."
        },
        "status": {
          "type": "integer",
          "title": "Status",
          "description": "The response's HTTP status."
        },
        "credits": {
          "type": "integer",
          "title": "Credits",
          "description": "Credits charged."
        },
        "free_reason": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "cached",
                "not_found",
                "not_covered",
                "empty",
                "error",
                "included",
                "seat"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Free Reason",
          "description": "Why no credits were charged. One of `cached` (a repeat within a day), `not_found`, `not_covered`, `empty`, `error`, `included` (a read that is never charged) or `seat` (a read in Explorer). Null when credits were charged."
        },
        "duration_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Ms",
          "description": "Time to respond, in milliseconds. Null when not recorded."
        },
        "actor": {
          "$ref": "#/$defs/RequestActor",
          "description": "The credential that made the request."
        }
      },
      "type": "object",
      "required": [
        "object",
        "request_id",
        "occurred_at",
        "method",
        "route",
        "status",
        "credits",
        "free_reason",
        "duration_ms",
        "actor"
      ],
      "title": "Request",
      "description": "One request to a `/v1` endpoint."
    },
    "RequestActor": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "user",
            "machine"
          ],
          "title": "Kind",
          "description": "Whether a person or a machine credential made the request. One of `user` or `machine`."
        },
        "method": {
          "type": "string",
          "enum": [
            "session",
            "api_key",
            "oauth",
            "mcp"
          ],
          "title": "Method",
          "description": "How the request was authenticated. One of `session`, `api_key`, `oauth` or `mcp`."
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "The API key's name, the user's email address or the OAuth client's name, for display. Null when there is none."
        },
        "key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Key",
          "description": "The API key's id. Null when no API key was used."
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "User",
          "description": "The user's id. Null for a machine credential."
        },
        "client": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Client",
          "description": "The OAuth client's id. Null when no OAuth client was used."
        }
      },
      "type": "object",
      "required": [
        "kind",
        "method",
        "name",
        "key",
        "user",
        "client"
      ],
      "title": "RequestActor",
      "description": "The credential that made a request."
    },
    "Total": {
      "properties": {
        "value": {
          "type": "integer",
          "title": "Value",
          "description": "The number of matching results."
        },
        "relation": {
          "type": "string",
          "enum": [
            "eq",
            "gte"
          ],
          "title": "Relation",
          "description": "One of `eq` (exact) or `gte` (at least `value`). Counts above 10,000 are `gte`."
        }
      },
      "type": "object",
      "required": [
        "value",
        "relation"
      ],
      "title": "Total",
      "description": "The number of matching results."
    }
  }
}