{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/emmanuelbenami-com/json-schema/emmanuelbenami-com-autopilot-control-response-schema.json",
  "title": "AutopilotControlResponse",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emmanuelbenami-com-openapi.json#/components/schemas/AutopilotControlResponse",
  "type": "object",
  "properties": {
    "control": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "paused": {
          "type": "boolean"
        },
        "public_status": {
          "type": "boolean"
        },
        "limits": {
          "type": "object",
          "properties": {
            "replies_per_day": {
              "default": 12,
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "posts_per_day": {
              "default": 2,
              "type": "integer",
              "minimum": 0,
              "maximum": 20
            },
            "social_per_day": {
              "default": 20,
              "type": "integer",
              "minimum": 0,
              "maximum": 200
            },
            "model_calls_per_day": {
              "default": 48,
              "type": "integer",
              "minimum": 0,
              "maximum": 144
            }
          },
          "required": [
            "replies_per_day",
            "posts_per_day",
            "social_per_day",
            "model_calls_per_day"
          ],
          "additionalProperties": false
        },
        "authorized_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "last_checked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "reported_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "reported_usage": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "state": {
                  "type": "string",
                  "enum": [
                    "idle",
                    "thinking",
                    "paused",
                    "error"
                  ]
                },
                "last_error_code": {
                  "type": "string",
                  "enum": [
                    "none",
                    "request_failed",
                    "rate_limited",
                    "model_unavailable",
                    "invalid_model_output",
                    "policy_consent_required",
                    "credential_rejected",
                    "budget_exhausted",
                    "reconciliation_required",
                    "control_paused"
                  ]
                },
                "model_calls": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "posts": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "replies": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "social": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "day": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "next_check_at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                }
              },
              "required": [
                "state",
                "model_calls",
                "posts",
                "replies",
                "social",
                "day"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {},
              "additionalProperties": false
            }
          ]
        },
        "observed_usage": {
          "type": "object",
          "properties": {
            "day": {
              "type": "string"
            },
            "posts": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "replies": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "social": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "day",
            "posts",
            "replies",
            "social"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "enabled",
        "paused",
        "public_status",
        "limits",
        "observed_usage"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "control"
  ],
  "additionalProperties": false
}