{
 "components": {
  "responses": {
   "BadRequest": {
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    },
    "description": "Bad request (for example a missing required field, a body that is not JSON, or a source that verify cannot recompute)."
   },
   "Forbidden": {
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    },
    "description": "The key is not scoped for this tool."
   },
   "NotFound": {
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    },
    "description": "No such route, tool, or source."
   },
   "RateLimited": {
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    },
    "description": "Rate limit exceeded. See the rate_limit object and the Retry-After header."
   },
   "Unauthorized": {
    "content": {
     "application/json": {
      "example": {
       "error": {
        "code": "unauthenticated",
        "message": "missing, invalid, or revoked API key"
       }
      },
      "schema": {
       "$ref": "#/components/schemas/ErrorResponse"
      }
     }
    },
    "description": "Missing, invalid, or revoked API key."
   }
  },
  "schemas": {
   "ErrorResponse": {
    "properties": {
     "error": {
      "properties": {
       "code": {
        "examples": [
         "unauthenticated",
         "forbidden",
         "not_found",
         "bad_request",
         "rate_limited"
        ],
        "type": "string"
       },
       "message": {
        "type": "string"
       },
       "rate_limit": {
        "$ref": "#/components/schemas/RateLimit"
       }
      },
      "required": [
       "code",
       "message"
      ],
      "type": "object"
     }
    },
    "required": [
     "error"
    ],
    "type": "object"
   },
   "HealthResponse": {
    "properties": {
     "service": {
      "example": "ground-truth-api",
      "type": "string"
     },
     "status": {
      "example": "ok",
      "type": "string"
     },
     "tier": {
      "example": "free",
      "type": "string"
     },
     "version": {
      "example": "1.0",
      "type": "string"
     }
    },
    "required": [
     "status",
     "service",
     "version",
     "tier"
    ],
    "type": "object"
   },
   "Match": {
    "properties": {
     "record": {
      "additionalProperties": true,
      "description": "The record exactly as sealed. Field names are the source's own (sanctions records use the Canada SEMA field names; tender records use a unified tender schema with a witness block).",
      "type": "object"
     },
     "seal_ref": {
      "$ref": "#/components/schemas/SealRef"
     }
    },
    "required": [
     "record",
     "seal_ref"
    ],
    "type": "object"
   },
   "RateLimit": {
    "properties": {
     "limit_per_day": {
      "example": 1000,
      "type": "integer"
     },
     "limit_per_minute": {
      "example": 60,
      "type": "integer"
     },
     "reason": {
      "description": "Present on some rejections, for example concurrency_cap when more than 4 calls are in flight for one key.",
      "type": "string"
     },
     "remaining_day": {
      "type": "integer"
     },
     "remaining_minute": {
      "type": "integer"
     },
     "retry_after_seconds": {
      "type": [
       "integer",
       "null"
      ]
     }
    },
    "type": "object"
   },
   "RecallCheckRequest": {
    "properties": {
     "query": {
      "description": "Product, brand, hazard, or agency terms to search. Required.",
      "type": "string"
     }
    },
    "required": [
     "query"
    ],
    "type": "object"
   },
   "RecallCheckResponse": {
    "properties": {
     "match_count": {
      "type": "integer"
     },
     "matches": {
      "items": {
       "$ref": "#/components/schemas/Match"
      },
      "type": "array"
     },
     "query": {
      "properties": {
       "query": {
        "type": "string"
       }
      },
      "type": "object"
     },
     "rate_limit": {
      "$ref": "#/components/schemas/RateLimit"
     },
     "scope_note": {
      "type": "string"
     },
     "source_head": {
      "$ref": "#/components/schemas/SourceHead"
     },
     "tier": {
      "example": "free",
      "type": "string"
     },
     "tool": {
      "example": "recall_check",
      "type": "string"
     },
     "verdict": {
      "enum": [
       "RECALLED",
       "NO_MATCH"
      ],
      "type": "string"
     }
    },
    "type": "object"
   },
   "SanctionsCheckRequest": {
    "properties": {
     "country": {
      "description": "Optional country filter, matched against the record's country field.",
      "type": "string"
     },
     "name": {
      "description": "Name to check. Required.",
      "type": "string"
     }
    },
    "required": [
     "name"
    ],
    "type": "object"
   },
   "SanctionsCheckResponse": {
    "properties": {
     "match_count": {
      "description": "True total. At most 10 matches are returned per call.",
      "type": "integer"
     },
     "matches": {
      "items": {
       "$ref": "#/components/schemas/Match"
      },
      "type": "array"
     },
     "query": {
      "properties": {
       "country": {
        "type": [
         "string",
         "null"
        ]
       },
       "name": {
        "type": "string"
       }
      },
      "type": "object"
     },
     "rate_limit": {
      "$ref": "#/components/schemas/RateLimit"
     },
     "scope_note": {
      "type": "string"
     },
     "source_head": {
      "$ref": "#/components/schemas/SourceHead"
     },
     "tier": {
      "example": "free",
      "type": "string"
     },
     "tool": {
      "example": "sanctions_check",
      "type": "string"
     },
     "verdict": {
      "enum": [
       "MATCH",
       "NO_MATCH"
      ],
      "type": "string"
     }
    },
    "type": "object"
   },
   "SealRef": {
    "properties": {
     "anchor": {
      "type": [
       "string",
       "null"
      ]
     },
     "chain": {
      "description": "Hash-chain value for this record.",
      "type": [
       "string",
       "null"
      ]
     },
     "data_class": {
      "type": "string"
     },
     "record_hash": {
      "description": "SHA-256 of the record exactly as sealed.",
      "type": "string"
     },
     "record_ref": {
      "type": "string"
     },
     "seal_label": {
      "type": [
       "string",
       "null"
      ]
     },
     "sealed_at": {
      "format": "date-time",
      "type": [
       "string",
       "null"
      ]
     },
     "segment": {
      "type": [
       "string",
       "null"
      ]
     },
     "segment_chain_head": {
      "type": [
       "string",
       "null"
      ]
     },
     "segment_merkle_root": {
      "type": [
       "string",
       "null"
      ]
     },
     "seq": {
      "type": [
       "integer",
       "null"
      ]
     },
     "source": {
      "example": "canada-sema",
      "type": "string"
     },
     "verify": {
      "$ref": "#/components/schemas/SealVerify"
     }
    },
    "type": "object"
   },
   "SealVerify": {
    "properties": {
     "arguments": {
      "type": "object"
     },
     "method": {
      "examples": [
       "POST /v1/verify",
       "extract-sha256"
      ],
      "type": "string"
     },
     "note": {
      "type": "string"
     }
    },
    "type": "object"
   },
   "SourceHead": {
    "properties": {
     "anchor": {
      "type": [
       "string",
       "null"
      ]
     },
     "data_class": {
      "type": "string"
     },
     "extract_sha256": {
      "description": "Legacy tender extract only: SHA-256 of the verified extract file (wired tender responses carry export_sha256 in source_head instead).",
      "type": "string"
     },
     "records": {
      "type": "integer"
     },
     "seal_label": {
      "type": [
       "string",
       "null"
      ]
     },
     "sealed_at": {
      "format": "date-time",
      "type": [
       "string",
       "null"
      ]
     },
     "segment": {
      "type": [
       "string",
       "null"
      ]
     },
     "segment_chain_head": {
      "type": [
       "string",
       "null"
      ]
     },
     "segment_merkle_root": {
      "type": [
       "string",
       "null"
      ]
     },
     "source": {
      "type": "string"
     }
    },
    "type": "object"
   },
   "TenderSearchRequest": {
    "properties": {
     "country": {
      "description": "Optional country filter.",
      "type": "string"
     },
     "query": {
      "description": "Search terms matched against the tender records. Required.",
      "type": "string"
     }
    },
    "required": [
     "query"
    ],
    "type": "object"
   },
   "TenderSearchResponse": {
    "properties": {
     "match_count": {
      "type": "integer"
     },
     "matches": {
      "items": {
       "$ref": "#/components/schemas/Match"
      },
      "type": "array"
     },
     "query": {
      "properties": {
       "country": {
        "type": [
         "string",
         "null"
        ]
       },
       "query": {
        "type": "string"
       }
      },
      "type": "object"
     },
     "rate_limit": {
      "$ref": "#/components/schemas/RateLimit"
     },
     "scope_note": {
      "type": "string"
     },
     "source_head": {
      "$ref": "#/components/schemas/SourceHead"
     },
     "tier": {
      "example": "free",
      "type": "string"
     },
     "tool": {
      "example": "tender_search",
      "type": "string"
     }
    },
    "type": "object"
   },
   "ToolDescriptor": {
    "properties": {
     "description": {
      "type": "string"
     },
     "inputSchema": {
      "type": "object"
     },
     "name": {
      "examples": [
       "sanctions_check",
       "recall_check",
       "tender_search"
      ],
      "type": "string"
     }
    },
    "type": "object"
   },
   "ToolListResponse": {
    "properties": {
     "rate_limit": {
      "$ref": "#/components/schemas/RateLimit"
     },
     "tier": {
      "example": "free",
      "type": "string"
     },
     "tools": {
      "items": {
       "$ref": "#/components/schemas/ToolDescriptor"
      },
      "type": "array"
     }
    },
    "type": "object"
   },
   "VerifyRequest": {
    "properties": {
     "source": {
      "description": "Optional. A source to verify, for example canada-sema. Omit to verify all wired sources.",
      "type": "string"
     }
    },
    "type": "object"
   },
   "VerifyResponse": {
    "properties": {
     "records_checked": {
      "type": "integer"
     },
     "result": {
      "enum": [
       "PASS",
       "FAIL"
      ],
      "type": "string"
     },
     "sources": {
      "items": {
       "$ref": "#/components/schemas/VerifySourceResult"
      },
      "type": "array"
     }
    },
    "type": "object"
   },
   "VerifySourceResult": {
    "properties": {
     "problems": {
      "items": {
       "type": "string"
      },
      "type": "array"
     },
     "records_checked": {
      "type": "integer"
     },
     "result": {
      "enum": [
       "PASS",
       "FAIL"
      ],
      "type": "string"
     },
     "source": {
      "type": "string"
     }
    },
    "type": "object"
   },
   "DutyGetRequest": {
    "type": "object",
    "properties": {
     "duty_id": {
      "type": "string"
     },
     "source_instrument_id": {
      "type": "string"
     }
    }
   },
   "DutySearchRequest": {
    "type": "object",
    "properties": {
     "duty_class": {
      "type": "string"
     },
     "obligated_class": {
      "type": "string"
     },
     "mechanism": {
      "type": "string"
     },
     "date_field": {
      "type": "string"
     },
     "date_from": {
      "type": "string"
     },
     "date_to": {
      "type": "string"
     }
    }
   },
   "DutyWatchRequest": {
    "type": "object",
    "properties": {
     "watch_id": {
      "type": "string"
     },
     "cursor": {
      "type": "string"
     }
    },
    "required": [
     "watch_id"
    ]
   },
   "DutyResponse": {
    "type": "object",
    "properties": {
     "result": {
      "type": "string"
     },
     "duties": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "answer_seal_ref": {
      "type": "object"
     },
     "served_from_segment_refs": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    }
   }
  },
  "securitySchemes": {
   "ApiKeyAuth": {
    "description": "Your API key, sent in the X-API-Key header. Required for every route except GET /health.",
    "in": "header",
    "name": "X-API-Key",
    "type": "apiKey"
   }
  }
 },
 "info": {
  "contact": {
   "name": "Cyan Eclipse Technologies LLC",
   "url": "https://cetech.ai"
  },
  "description": "Check names, products, and tenders against sealed records. Every answer \u2014 match or NO_MATCH \u2014 carries a seal reference you can cite and independently recompute. Sanctions data is the full sealed Canada SEMA store (5,803 records, current state). Tender data is 127,378 current-state records from nine sealed sources. Recall data is 6,440 records from seven sealed recalls stores, served verbatim. All exports were chain-verified at export on 2026-11-28; every answer states its exact coverage. The duty layer (duty_get, duty_search, duty_watch) serves live legislative-duty records joined across their lifecycle (bill, public law, rule, codification), sealed per answer. Paid endpoints settle per call in USDC on Base mainnet via the x402 protocol.",
  "title": "Cyan Eclipse Ground-Truth API",
  "version": "1.0.0"
 },
 "openapi": "3.1.0",
 "paths": {
  "/health": {
   "get": {
    "operationId": "health",
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HealthResponse"
        }
       }
      },
      "description": "Service is up."
     }
    },
    "security": [],
    "summary": "Service health check. No authentication required."
   }
  },
  "/v1/tools": {
   "get": {
    "operationId": "listTools",
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ToolListResponse"
        }
       }
      },
      "description": "Tool list."
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "List the available tools, their descriptions, and their input schemas."
   }
  },
  "/v1/tools/recall-check": {
   "post": {
    "description": "Paid tier: $0.02 per call. Free pilot: $0 per call with an API key (60 requests/minute, 1,000 requests/day per key). Failed calls are not charged. A NO_MATCH result is charged on the paid tier: it is a citable answer that carries the seal reference and states the exact source searched. Data scope: seven sealed recalls stores — US FDA, US CPSC, Health Canada, UK OPSS, Australia ACCC, Japan NITE, and US NHTSA — 6,440 current records, served verbatim.",
    "operationId": "recallCheck",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "query": "stroller"
       },
       "schema": {
        "$ref": "#/components/schemas/RecallCheckRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RecallCheckResponse"
        }
       }
      },
      "description": "RECALLED or NO_MATCH, with seal references."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Check a product or brand against recall records. Fixture data in the current deployment.",
    "x-price-per-call-usd": 0.02
   }
  },
  "/v1/tools/sanctions-check": {
   "post": {
    "description": "Paid tier: $0.05 per call. Free pilot: $0 per call with an API key (60 requests/minute, 1,000 requests/day per key). Failed calls are not charged. A NO_MATCH result is charged on the paid tier: it is a citable answer that carries the seal reference and states the exact source searched. Scope: the full Canada SEMA sealed store only (5,803 records, current state). NO_MATCH means no match in this source, not a global clearance.",
    "operationId": "sanctionsCheck",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "name": "Momeni"
       },
       "schema": {
        "$ref": "#/components/schemas/SanctionsCheckRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SanctionsCheckResponse"
        }
       }
      },
      "description": "MATCH or NO_MATCH, with seal references."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Check a name against the full sealed Canada SEMA sanctions store (5,803 records).",
    "x-price-per-call-usd": 0.05
   }
  },
  "/v1/tools/tender-search": {
   "post": {
    "description": "Paid tier: $0.01 per call. Free pilot: $0 per call with an API key (60 requests/minute, 1,000 requests/day per key). Failed calls are not charged. A NO_MATCH result is charged on the paid tier: it is a citable answer that carries the seal reference and states the exact source searched. Scope: 127,378 current-state records from nine sealed sources, with native seal references carried verbatim. Contact-person fields are withheld under procurement class rules and marked where applied.",
    "operationId": "tenderSearch",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "query": "golf"
       },
       "schema": {
        "$ref": "#/components/schemas/TenderSearchRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TenderSearchResponse"
        }
       }
      },
      "description": "Matching tender records, with native seal references."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Search 127,378 sealed tender records from nine sources.",
    "x-price-per-call-usd": 0.01
   }
  },
  "/v1/verify": {
   "post": {
    "description": "Recomputes sanctions and recalls record hashes in full, checks the tender export file hash and counts, and recomputes tender record hashes on a sample. With no source given, verifies all wired sources. Every export was built by full chain-replay verification of its sealed store.",
    "operationId": "verify",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "source": "canada-sema"
       },
       "schema": {
        "$ref": "#/components/schemas/VerifyRequest"
       }
      }
     },
     "required": false
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/VerifyResponse"
        }
       }
      },
      "description": "Verification passed."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "422": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/VerifyResponse"
        }
       }
      },
      "description": "Verification failed."
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Recompute seal references for a segmented source."
   }
  },
  "/v1/tools/duty-get": {
   "post": {
    "description": "Paid tier: $0.03 per call. Free pilot: $0 per call with an API key. Failed calls are not charged; NO_MATCH is charged. Returns the duty joined across its lifecycle with an answer_seal_ref.",
    "operationId": "dutyGet",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "duty_id": "duty:example"
       },
       "schema": {
        "$ref": "#/components/schemas/DutyGetRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DutyResponse"
        }
       }
      },
      "description": "MATCH or NO_MATCH, with an answer seal reference."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Fetch one legislative duty by id.",
    "x-price-per-call-usd": 0.03
   }
  },
  "/v1/tools/duty-search": {
   "post": {
    "description": "Paid tier: $0.03 per call. Free pilot: $0 per call with an API key. Failed calls are not charged; NO_MATCH is charged. Filters include duty class, obligated class, mechanism, and lifecycle dates.",
    "operationId": "dutySearch",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "duty_class": "reporting"
       },
       "schema": {
        "$ref": "#/components/schemas/DutySearchRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DutyResponse"
        }
       }
      },
      "description": "MATCH or NO_MATCH, with an answer seal reference."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Search legislative duties by filter.",
    "x-price-per-call-usd": 0.03
   }
  },
  "/v1/tools/duty-watch": {
   "post": {
    "description": "Subscription tool. Watch plans: Monitor $249/month, Professional $599/month, Enterprise $999/month (annual 10x). Returns lifecycle changes since the supplied cursor.",
    "operationId": "dutyWatch",
    "requestBody": {
     "content": {
      "application/json": {
       "example": {
        "watch_id": "watch:example"
       },
       "schema": {
        "$ref": "#/components/schemas/DutyWatchRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DutyResponse"
        }
       }
      },
      "description": "MATCH or NO_MATCH, with an answer seal reference."
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "summary": "Poll a duty watch for lifecycle changes.",
    "x-price-per-call-usd": 0
   }
  }
 },
 "security": [
  {
   "ApiKeyAuth": []
  }
 ],
 "servers": [
  {
   "description": "Live API base (key-gated).",
   "url": "https://connect.cetech.ai/gt-api"
  },
  {
   "description": "Production hostname, staged. Note: its DNS record does not exist yet, so this hostname does not resolve until that record is added at launch.",
   "url": "https://api.cetech.ai"
  }
 ]
}