{
    "openapi": "3.1.0",
    "info": {
        "title": "The Artillerist Agent Intelligence API",
        "version": "1.1.0",
        "description": "Citation-first company, vendor, and change-monitoring intelligence paid with x402 Base USDC."
    },
    "servers": [
        {
            "url": "https://theartillerist.com"
        }
    ],
    "paths": {
        "/api/v1/intelligence/company-snapshot": {
            "post": {
                "summary": "Company Snapshot",
                "description": "Resolve a company identity across GLEIF legal-entity records, SEC EDGAR public-company filings, and authoritative RDAP domain registration. Returns normalized facts, recent filing links, evidence timestamps, source gaps, and an explicit confidence assessment.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Input"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settled report"
                    },
                    "402": {
                        "description": "x402 payment required"
                    },
                    "422": {
                        "description": "Invalid input"
                    }
                }
            }
        },
        "/api/v1/intelligence/company-change-monitor": {
            "post": {
                "summary": "Company Change Monitor",
                "description": "Monitor a company or vendor for sanctions, SEC filing, legal-entity, and domain-registration changes. Compare current authoritative evidence with an earlier paid report or a supplied date and receive a structured, citation-first change summary with severity, timestamps, source URLs, confidence, and disclosed gaps. Designed for continuous vendor due diligence; it is not a legal or compliance determination.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Input"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settled report"
                    },
                    "402": {
                        "description": "x402 payment required"
                    },
                    "422": {
                        "description": "Invalid input"
                    }
                }
            }
        },
        "/api/v1/intelligence/vendor-risk": {
            "post": {
                "summary": "Vendor Risk Brief",
                "description": "Screen a vendor for OFAC sanctions and complete vendor due diligence and company verification. This citation-first Vendor Risk Brief checks exact normalized names against current U.S. Treasury OFAC SDN and Consolidated primary-name and alias files, then adds GLEIF legal-entity records, SEC EDGAR company filings, and authoritative RDAP domain-registration evidence. It returns match status, vendor risk signals, identity gaps, domain-age signals, source URLs, evidence timestamps, confidence, and limitations for vendor onboarding, supplier risk, procurement, AML, and counterparty preflight. A name match requires human review; a no-match result is not sanctions clearance or a compliance determination.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Input"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settled report"
                    },
                    "402": {
                        "description": "x402 payment required"
                    },
                    "422": {
                        "description": "Invalid input"
                    }
                }
            }
        },
        "/api/v1/intelligence/company-dossier": {
            "post": {
                "summary": "Company Dossier",
                "description": "Create a company due diligence report with citations from GLEIF legal-entity data, SEC EDGAR company and recent filing metadata, authoritative RDAP domain data, and exact normalized OFAC name screening. This structured Company Dossier ties every assertion to a public source URL and retrieval time and clearly identifies evidence gaps, confidence, and limitations.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Input"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Settled report"
                    },
                    "402": {
                        "description": "x402 payment required"
                    },
                    "422": {
                        "description": "Invalid input"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Input": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "title": "Company intelligence request",
                "type": "object",
                "properties": {
                    "company_name": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 180,
                        "description": "Legal or commonly used company name."
                    },
                    "domain": {
                        "type": "string",
                        "pattern": "^(?=.{3,253}$)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,63}$",
                        "description": "Bare domain only, without a URL path."
                    },
                    "jurisdiction": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80,
                        "description": "Optional country or jurisdiction hint."
                    },
                    "cik": {
                        "type": "string",
                        "pattern": "^[0-9]{1,10}$",
                        "description": "Optional SEC Central Index Key."
                    },
                    "lei": {
                        "type": "string",
                        "pattern": "^[A-Z0-9]{20}$",
                        "description": "Optional Legal Entity Identifier."
                    },
                    "since": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Optional monitoring-window start. Company Change Monitor defaults to 30 days ago."
                    },
                    "baseline_report_id": {
                        "type": "string",
                        "pattern": "^air_[a-f0-9]{32}$",
                        "description": "Optional prior paid Agent Intelligence report ID for an exact evidence comparison."
                    }
                },
                "required": [
                    "company_name"
                ],
                "additionalProperties": false
            },
            "Report": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "title": "Agent Intelligence report",
                "type": "object",
                "required": [
                    "schema_version",
                    "report_id",
                    "product",
                    "report_status",
                    "generated_at",
                    "query",
                    "identity",
                    "signals",
                    "confidence",
                    "evidence",
                    "limitations",
                    "payment"
                ],
                "properties": {
                    "schema_version": {
                        "type": "string"
                    },
                    "report_id": {
                        "type": "string",
                        "pattern": "^air_[a-f0-9]{32}$"
                    },
                    "product": {
                        "type": "object"
                    },
                    "report_status": {
                        "type": "string"
                    },
                    "generated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "fresh_until": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "query": {
                        "type": "object"
                    },
                    "identity": {
                        "type": "object"
                    },
                    "screening": {
                        "type": [
                            "object",
                            "null"
                        ]
                    },
                    "monitoring": {
                        "type": [
                            "object",
                            "null"
                        ]
                    },
                    "signals": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "confidence": {
                        "type": "object"
                    },
                    "evidence": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "methodology": {
                        "type": "array"
                    },
                    "limitations": {
                        "type": "array"
                    },
                    "duration_ms": {
                        "type": "integer"
                    },
                    "license": {
                        "type": "object"
                    },
                    "payment": {
                        "type": "object"
                    }
                },
                "additionalProperties": false
            }
        }
    }
}
