{
  "openapi": "3.1.0",
  "info": {
    "title": "Aetherion Cyber Systems Sovereign API",
    "version": "1.0.0",
    "description": "Machine-readable OpenAPI 3.1.0 specification for Aetherion Cyber Systems sovereign edge endpoints: Talent Forge Socratic AI (/v1/api/talent/chat), Sovereign Assessment Lead Ingestion (/v1/api/leads), NLWeb Grounded Synthesis (/v1/ask), and Instant Self-Serve Sandbox Token Generation (/v1/auth/token). All endpoints support URL-path versioning (/v1/*), header-based versioning (X-API-Version: v1), sliding-window rate limiting (20 req/min per IP), and RFC 8594 Sunset/Deprecation lifecycle metadata.",
    "contact": {
      "name": "Aetherion Product Security Incident Response Team (PSIRT)",
      "email": "security@aetherioncyber.com",
      "url": "https://aetherioncyber.com/security"
    },
    "license": {
      "name": "Proprietary / Sovereign Enclave License",
      "url": "https://aetherioncyber.com/security"
    },
    "x-api-versioning": {
      "strategy": "url-path",
      "current_version": "v1",
      "supported_versions": ["v1"],
      "header_name": "X-API-Version",
      "deprecation_policy": "Minimum 6 months advance notice before sunset. Signaled via RFC 8594 Sunset and Deprecation headers.",
      "sunset_date": "2027-12-31T23:59:59Z",
      "documentation": "https://aetherioncyber.com/developers"
    }
  },
  "servers": [
    {
      "url": "https://aetherioncyber.com/v1",
      "description": "Versioned Sovereign Edge Production Enclave (v1)"
    },
    {
      "url": "https://aetherioncyber.com",
      "description": "Canonical Sovereign Edge Production Enclave"
    }
  ],
  "externalDocs": {
    "description": "RFC 9116 Sovereign Vulnerability Disclosure Policy & Manifest",
    "url": "https://aetherioncyber.com/.well-known/security.txt"
  },
  "paths": {
    "/v1/auth/token": {
      "post": {
        "summary": "Generate Instant Self-Serve Sandbox Credentials",
        "description": "Issues zero-friction, instant sandbox API bearer tokens for autonomous AI agents, security researchers, and automated CI/CD evaluators without human intervention.",
        "operationId": "generateSandboxTokenV1",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Optional client identifier and grant type specification.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Instant sandbox API credentials issued successfully.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Sliding rate limit ceiling per minute.",
                "schema": { "type": "integer", "example": 20 }
              },
              "RateLimit-Remaining": {
                "description": "Remaining allowable requests.",
                "schema": { "type": "integer", "example": 19 }
              },
              "RateLimit-Reset": {
                "description": "Seconds until window reset.",
                "schema": { "type": "integer", "example": 60 }
              },
              "RateLimit-Policy": {
                "description": "IETF quota policy.",
                "schema": { "type": "string", "example": "20;w=60" }
              },
              "Sunset": {
                "description": "RFC 8594 Sunset date for version deprecation.",
                "schema": { "type": "string", "example": "Fri, 31 Dec 2027 23:59:59 GMT" }
              },
              "Deprecation": {
                "description": "RFC 8594 Deprecation indicator.",
                "schema": { "type": "string", "example": "@1830297600" }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Retrieve Instant Self-Serve Sandbox Credentials",
        "description": "GET endpoint providing zero-friction instant sandbox API tokens for autonomous agents.",
        "operationId": "getSandboxTokenV1",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instant sandbox credentials issued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/token": {
      "post": {
        "summary": "Generate Instant Self-Serve Sandbox Credentials (Canonical)",
        "description": "Canonical endpoint issuing zero-friction sandbox API credentials for autonomous AI agents.",
        "operationId": "generateSandboxToken",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Instant sandbox credentials issued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Retrieve Instant Self-Serve Sandbox Credentials (Canonical)",
        "description": "GET canonical endpoint providing zero-friction instant sandbox API tokens.",
        "operationId": "getSandboxToken",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instant sandbox credentials issued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/talent/chat": {
      "post": {
        "summary": "Talent Forge Socratic Mentor & Career Co-Pilot Chat (v1)",
        "description": "Interviews engineering candidates, extracts authentic CAR accomplishments, and performs ATS resume tailoring. Powered by Cloudflare Workers AI with Google Gemini extended recon bridge. Enforces a 20 req/min sliding rate limit and 32KB payload ceiling.",
        "operationId": "talentForgeChatV1",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Cryptographic idempotency key to safely retry requests without duplicated inferences.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Chat payload containing conversation history and configuration parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TalentForgeChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful conversational inference response from Sovereign Native or Extended intelligence tier.",
            "headers": {
              "RateLimit-Limit": { "schema": { "type": "integer", "example": 20 } },
              "RateLimit-Remaining": { "schema": { "type": "integer", "example": 19 } },
              "RateLimit-Reset": { "schema": { "type": "integer", "example": 60 } },
              "RateLimit-Policy": { "schema": { "type": "string", "example": "20;w=60" } },
              "Sunset": { "schema": { "type": "string", "example": "Fri, 31 Dec 2027 23:59:59 GMT" } },
              "Deprecation": { "schema": { "type": "string", "example": "@1830297600" } }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TalentForgeChatResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON syntax, empty messages array, or invalid conversation mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed. Only HTTP POST is permitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large. Request body exceeds the 32KB (32,768 bytes) ceiling.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Sliding rate limit of 20 requests per minute exceeded.",
            "headers": {
              "Retry-After": {
                "schema": { "type": "string", "example": "60" },
                "description": "Number of seconds until rate limit quota resets."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server execution failure or upstream AI provider outage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/talent/chat": {
      "post": {
        "summary": "Talent Forge Socratic Mentor & Career Co-Pilot Chat",
        "description": "Interviews engineering candidates, extracts authentic CAR accomplishments, and performs ATS resume tailoring. Powered by Cloudflare Workers AI with Google Gemini extended recon bridge. Enforces a 20 req/min sliding rate limit and 32KB payload ceiling.",
        "operationId": "talentForgeChat",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Cryptographic idempotency key to safely retry requests without duplicated inferences.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Chat payload containing conversation history and configuration parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TalentForgeChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful conversational inference response from Sovereign Native or Extended intelligence tier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TalentForgeChatResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON syntax, empty messages array, or invalid conversation mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed. Only HTTP POST is permitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large. Request body exceeds the 32KB (32,768 bytes) ceiling.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Sliding rate limit of 20 requests per minute exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "example": "60"
                },
                "description": "Number of seconds until rate limit quota resets."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server execution failure or upstream AI provider outage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/leads": {
      "post": {
        "summary": "Ingest Sovereign Assessment SOW Lead (v1)",
        "description": "Captures enterprise and government agency leads for the $15,000 fixed-fee Sovereign Assessment SOW engagement. Enforces a 20 req/min sliding rate limit and 8KB payload ceiling.",
        "operationId": "captureLeadV1",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Cryptographic idempotency key to safely retry lead submissions without duplicate records.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Lead contact details and architectural scope requirements.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadCaptureRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lead captured successfully with generated unique tracking UUID.",
            "headers": {
              "RateLimit-Limit": { "schema": { "type": "integer", "example": 20 } },
              "RateLimit-Remaining": { "schema": { "type": "integer", "example": 19 } },
              "RateLimit-Reset": { "schema": { "type": "integer", "example": 60 } },
              "RateLimit-Policy": { "schema": { "type": "string", "example": "20;w=60" } },
              "Sunset": { "schema": { "type": "string", "example": "Fri, 31 Dec 2027 23:59:59 GMT" } },
              "Deprecation": { "schema": { "type": "string", "example": "@1830297600" } }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCaptureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields, invalid email format, or field length exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed. Only HTTP POST is permitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large. Request body exceeds the 8KB ceiling.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Sliding rate limit of 20 requests per minute exceeded.",
            "headers": {
              "Retry-After": {
                "schema": { "type": "string", "example": "60" },
                "description": "Seconds until rate limit quota resets."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/leads": {
      "post": {
        "summary": "Ingest Sovereign Assessment SOW Lead",
        "description": "Captures enterprise and government agency leads for the $15,000 fixed-fee Sovereign Assessment SOW engagement. Enforces a 20 req/min sliding rate limit and 8KB payload ceiling.",
        "operationId": "captureLead",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": ["v1"]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Cryptographic idempotency key to safely retry lead submissions without duplicate records.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Lead contact details and architectural scope requirements.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadCaptureRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lead captured successfully with generated unique tracking UUID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCaptureResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields (name, email, company), invalid email format, field length exceeded, or invalid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed. Only HTTP POST is permitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large. Request body exceeds the 8KB (8,192 bytes) ceiling.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Sliding rate limit of 20 requests per minute exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "example": "60"
                },
                "description": "Number of seconds until rate limit quota resets."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ask": {
      "get": {
        "summary": "NLWeb Grounded Synthesis Query (v1)",
        "description": "Queries the grounded Aetherion cyber knowledge base using natural language questions.",
        "operationId": "askQuestionV1",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Natural language query string.",
            "schema": { "type": "string" }
          },
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "schema": { "type": "string", "default": "v1", "enum": ["v1"] }
          }
        ],
        "responses": {
          "200": {
            "description": "Grounded answer synthesized from verified knowledge corpus.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              }
            }
          }
        }
      }
    },
    "/ask": {
      "get": {
        "summary": "NLWeb Grounded Synthesis Query",
        "description": "Canonical natural language query endpoint over Aetherion verified knowledge corpus.",
        "operationId": "askQuestion",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Natural language query string.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Grounded answer synthesized from verified knowledge corpus.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/leads/batch": {
      "post": {
        "summary": "Batch Ingest Leads",
        "description": "Batch ingestion endpoint for enterprise and sovereign assessment leads. Processes an array of lead capture objects in an atomic batch operation.",
        "operationId": "batchIngestLeads",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": [
                "v1"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Cryptographic idempotency key to safely retry batch submissions without duplicate records.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Array of lead objects for batch ingestion.",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "Array of lead objects.",
                "items": {
                  "$ref": "#/components/schemas/LeadCaptureRequest"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch lead ingestion status summary.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Batch status summary schema.",
                  "required": [
                    "status",
                    "total",
                    "processed"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique batch tracking identifier."
                    },
                    "batch_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique cryptographic tracking identifier for the batch."
                    },
                    "status": {
                      "type": "string",
                      "description": "Overall batch processing status.",
                      "enum": [
                        "completed",
                        "partial",
                        "processing",
                        "failed"
                      ]
                    },
                    "total": {
                      "type": "integer",
                      "description": "Total number of leads submitted in the batch."
                    },
                    "processed": {
                      "type": "integer",
                      "description": "Number of leads successfully processed."
                    },
                    "failed": {
                      "type": "integer",
                      "description": "Number of leads that failed validation or processing."
                    },
                    "lead_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Array of generated lead tracking identifiers."
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LeadCaptureResponse"
                      },
                      "description": "Detailed execution results per lead."
                    },
                    "job_id": {
                      "type": "string",
                      "description": "Associated asynchronous job ID if processed asynchronously."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid batch payload or malformed lead objects.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed. Only HTTP POST is permitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Sliding rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{job_id}": {
      "get": {
        "summary": "Get Async Job Status",
        "description": "Retrieves the status, progress, and result or message for an asynchronous background job.",
        "operationId": "getJobStatus",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Unique identifier of the asynchronous job.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "API version selector (defaults to v1).",
            "schema": {
              "type": "string",
              "default": "v1",
              "enum": [
                "v1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asynchronous job completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "progress",
                    "result"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the asynchronous job."
                    },
                    "status": {
                      "type": "string",
                      "description": "Current status of the asynchronous job."
                    },
                    "progress": {
                      "type": "number",
                      "description": "Job completion progress percentage (0-100)."
                    },
                    "result": {
                      "type": "object",
                      "description": "Job execution result data.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Asynchronous job accepted and currently processing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "progress",
                    "message"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the asynchronous job."
                    },
                    "status": {
                      "type": "string",
                      "description": "Current status of the asynchronous job."
                    },
                    "progress": {
                      "type": "number",
                      "description": "Job completion progress percentage (0-100)."
                    },
                    "message": {
                      "type": "string",
                      "description": "Informational status message."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Job not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests. Sliding rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TokenRequest": {
        "type": "object",
        "properties": {
          "grant_type": {
            "type": "string",
            "default": "client_credentials",
            "example": "client_credentials"
          },
          "client_id": {
            "type": "string",
            "default": "sandbox_agent",
            "example": "sandbox_agent"
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "tier"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "example": "aeth_live_sandbox_dev_key_sec_01",
            "description": "Instant sandbox bearer API key."
          },
          "token_type": {
            "type": "string",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "example": 86400
          },
          "scope": {
            "type": "string",
            "example": "leads:write talent:chat telemetry:read alerts:stream"
          },
          "tier": {
            "type": "string",
            "example": "sandbox-free"
          },
          "quota": {
            "type": "object",
            "properties": {
              "limit": { "type": "integer", "example": 20 },
              "window": { "type": "string", "example": "60s" }
            }
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "sandbox_environment": {
            "type": "string",
            "example": "https://aetherioncyber.com/sandbox/"
          },
          "message": {
            "type": "string",
            "example": "Self-serve sandbox API credentials issued successfully."
          }
        }
      },
      "AskResponse": {
        "type": "object",
        "required": [
          "answer",
          "source",
          "query"
        ],
        "properties": {
          "answer": {
            "type": "string",
            "description": "Synthesized grounded answer."
          },
          "source": {
            "type": "string",
            "example": "corpus-rag"
          },
          "query": {
            "type": "string"
          },
          "latency_ms": {
            "type": "integer",
            "example": 24
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "system"
            ],
            "description": "Role of the conversation participant."
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "description": "Text content of the message."
          }
        }
      },
      "TalentForgeChatRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "interview",
              "copilot",
              "tailor"
            ],
            "description": "Operational persona: interview (Socratic Mentor), copilot (Career Co-Pilot), tailor (ATS Resume Tailoring)."
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "description": "Sequential array of chat messages."
          },
          "targetJob": {
            "type": "string",
            "description": "Target job description or technical role context."
          },
          "enableRecon": {
            "type": "boolean",
            "description": "Flag to enable Tier-2 Extended Intelligence reconnaissance via Google Gemini."
          }
        }
      },
      "TalentForgeChatResponse": {
        "type": "object",
        "required": [
          "success",
          "tier",
          "reply"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "tier": {
            "type": "string",
            "enum": [
              "native",
              "extended"
            ],
            "description": "Inference tier: native (Cloudflare Workers AI) or extended (Google Gemini Recon Bridge)."
          },
          "reply": {
            "type": "string",
            "description": "Synthesized AI response text."
          }
        }
      },
      "LeadCaptureRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "company"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Full name of the executive contact."
          },
          "email": {
            "type": "string",
            "format": "email",
            "minLength": 1,
            "maxLength": 100,
            "description": "Corporate or agency email address."
          },
          "company": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Organization, corporation, or defense agency."
          },
          "useCase": {
            "type": "string",
            "maxLength": 1000,
            "description": "Optional architectural scope, integration requirements, or assessment notes."
          }
        }
      },
      "LeadCaptureResponse": {
        "type": "object",
        "required": [
          "success",
          "message",
          "lead_id"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string",
            "example": "Lead captured successfully"
          },
          "lead_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique cryptographic tracking identifier for the captured lead."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Error category or HTTP status title."
          },
          "message": {
            "type": "string",
            "description": "Detailed error explanation or rate limit notice."
          }
        }
      },
      "BatchLeadStatusSummary": {
        "type": "object",
        "required": [
          "status",
          "total",
          "processed"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique batch tracking identifier."
          },
          "batch_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique cryptographic tracking identifier for the batch."
          },
          "status": {
            "type": "string",
            "description": "Overall batch processing status.",
            "enum": [
              "completed",
              "partial",
              "processing",
              "failed"
            ]
          },
          "total": {
            "type": "integer",
            "description": "Total number of leads submitted in the batch."
          },
          "processed": {
            "type": "integer",
            "description": "Number of leads successfully processed."
          },
          "failed": {
            "type": "integer",
            "description": "Number of leads that failed validation or processing."
          },
          "lead_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of generated lead tracking identifiers."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadCaptureResponse"
            },
            "description": "Detailed execution results per lead."
          },
          "job_id": {
            "type": "string",
            "description": "Associated asynchronous job ID if processed asynchronously."
          }
        }
      },
      "JobStatusResponse": {
        "type": "object",
        "required": [
          "id",
          "status",
          "progress",
          "result"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous job."
          },
          "status": {
            "type": "string",
            "description": "Current status of the asynchronous job."
          },
          "progress": {
            "type": "number",
            "description": "Job completion progress percentage (0-100)."
          },
          "result": {
            "type": "object",
            "description": "Job execution result data.",
            "additionalProperties": true
          }
        }
      },
      "JobAcceptedResponse": {
        "type": "object",
        "required": [
          "id",
          "status",
          "progress",
          "message"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous job."
          },
          "status": {
            "type": "string",
            "description": "Current status of the asynchronous job."
          },
          "progress": {
            "type": "number",
            "description": "Job completion progress percentage (0-100)."
          },
          "message": {
            "type": "string",
            "description": "Informational status message."
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "HMAC-SHA256 authenticated session token or instant sandbox token."
      },
      "OAuth2": {
        "type": "oauth2",
        "description": "Sovereign federated OAuth 2.0 with scoped permissions per RFC 9728.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://aetherioncyber.com/api/auth/token",
            "scopes": {
              "leads:write": "Permission to ingest sovereign assessment leads",
              "talent:chat": "Permission to access Talent Forge Socratic inference",
              "sovereign:admin": "Administrative control across sovereign enclaves",
              "telemetry:read": "Read-only access to vector telemetry streams",
              "alerts:stream": "Real-time SSE event stream from Kairos active NDR"
            }
          }
        }
      }
    }
  }
}