{"openapi":"3.1.0","info":{"title":"lei-api — LEI lookup, entity matching + ownership trees (live GLEIF)","description":"Legal Entity Identifier facts for AI agents over the live GLEIF registry: lookup, typed search, ranked entity→LEI matching, and bounded ownership-graph traversal. Free while in beta — no key, no signup (paid x402 tiers are paused). Fail-closed: when GLEIF is unreachable you get a machine-readable upstream_unavailable refusal, never stale or fabricated data. Source: GLEIF.","version":"0.1.0"},"paths":{"/v1/lei/{lei}":{"get":{"summary":"V1 Lei","description":"Look up one LEI record from the live GLEIF registry: legal name, addresses, jurisdiction, category, legal form, registration status and dates, BIC/MIC/OCID mappings. Optional parents/children fetch the direct ownership relations. Unknown LEI → 404 lei_not_found; malformed LEI → 422 invalid_input. x402 price: $0.001 per request.","operationId":"v1_lei_v1_lei__lei__get","parameters":[{"name":"lei","in":"path","required":true,"schema":{"type":"string","title":"Lei"}},{"name":"parents","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Parents"}},{"name":"children","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Children"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response V1 Lei V1 Lei  Lei  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/search":{"get":{"summary":"V1 Search","description":"Typed LEI search with pagination: fulltext name query (q) plus repeatable filter params in FIELD=VALUE form (e.g. filter=country=US&filter=status=ACTIVE). Same field repeated = OR, different fields = AND. Supported fields: lei, name, country, region, city, postal_code, address, hq_country, hq_region, hq_city, hq_postal_code, jurisdiction, category, status, legal_form, registered_as, registration_status, managing_lou, corroboration_level, bic, mic, ocid, conformity, owns, owned_by. x402 price: $0.001 per request.","operationId":"v1_search_v1_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Filter"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response V1 Search V1 Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/match":{"post":{"summary":"V1 Match","description":"Rank likely LEI records for a fuzzy entity identity (name plus optional country/city/address) — GLEIF retrieves candidates, the engine scores and orders them transparently, so the answer buys a decision: which LEI is this counterparty? Up to 50 candidates. x402 price: $0.010 per request.","operationId":"v1_match_v1_match_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response V1 Match V1 Match Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tree/{lei}":{"get":{"summary":"V1 Tree","description":"Traverse the corporate ownership graph from one LEI, breadth-first with cycle detection: direction parents/children/both, depth up to 5, max_nodes up to 100; the result's truncated flag is honest about a budget-capped walk. x402 price: $0.010 per request.","operationId":"v1_tree_v1_tree__lei__get","parameters":[{"name":"lei","in":"path","required":true,"schema":{"type":"string","title":"Lei"}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","default":"both","title":"Direction"}},{"name":"depth","in":"query","required":false,"schema":{"type":"integer","default":2,"title":"Depth"}},{"name":"max_nodes","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Max Nodes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response V1 Tree V1 Tree  Lei  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batch":{"post":{"summary":"V1 Batch","description":"Look up as many as 50 LEIs in one request. The result carries records (order may differ from input — GLEIF's ordering) plus not_found, the requested codes GLEIF did not return (it omits unregistered LEIs silently; agents need the diff). Exceeding the cap fails the whole call with a machine-readable protocol error. x402 price: $0.050 flat per request.","operationId":"v1_batch_v1_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response V1 Batch V1 Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/demo/lei/{lei}":{"get":{"summary":"V1 Demo Lei","description":"Free playground demo lane: the same live lookup as /v1/lei/{lei}, no payment — hard rate-limited (10 requests per 5 minutes per IP). For evaluation only; use /v1/lei/{lei} for production traffic.","operationId":"v1_demo_lei_v1_demo_lei__lei__get","parameters":[{"name":"lei","in":"path","required":true,"schema":{"type":"string","title":"Lei"}},{"name":"parents","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Parents"}},{"name":"children","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Children"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response V1 Demo Lei V1 Demo Lei  Lei  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/demo/match":{"post":{"summary":"V1 Demo Match","description":"Free playground demo lane: the same ranked entity matching as /v1/match, no payment — shares the demo rate limit (10 requests per 5 minutes per IP). For evaluation only.","operationId":"v1_demo_match_v1_demo_match_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response V1 Demo Match V1 Demo Match Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/health":{"get":{"summary":"V1 Health","description":"Free: service liveness, pinned lei-data version, and the upstream posture (gleif: live). Liveness of the service only — GLEIF is not probed; a down upstream surfaces as 503 upstream_unavailable on paid calls, never as fabricated data.","operationId":"v1_health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response V1 Health V1 Health Get"}}}}}}}},"components":{"schemas":{"BatchRequest":{"properties":{"leis":{"items":{"type":"string"},"type":"array","title":"Leis"}},"type":"object","required":["leis"],"title":"BatchRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MatchRequest":{"properties":{"name":{"type":"string","title":"Name"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"limit":{"type":"integer","title":"Limit","default":10}},"type":"object","required":["name"],"title":"MatchRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}