{"openapi":"3.1.0","info":{"title":"en-tities.ai","summary":"Turn any document into a knowledge graph.","version":"0.1.0"},"paths":{"/v1/demo/extract":{"post":{"tags":["demo"],"summary":"Demo Extract","description":"Extraction for the public demo page.\n\nThe only unauthenticated route that spends upstream budget, so it is\nbounded on every axis: text length, label counts, per-IP rate, and a\nservice-wide daily token ceiling shared by all visitors.","operationId":"demo_extract_v1_demo_extract_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schema/suggest":{"post":{"tags":["extraction"],"summary":"Suggest Schema","description":"Propose entity and relationship types for a document.\n\nGLiNER needs a vocabulary and cannot invent one. This asks a small\ndecoder to name the types once, from a sample; the result is then reused\nacross the corpus, so the LLM cost is paid per schema rather than per\ndocument.","operationId":"suggest_schema_v1_schema_suggest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestion"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/demo/suggest":{"post":{"tags":["demo"],"summary":"Demo Suggest","operationId":"demo_suggest_v1_demo_suggest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestion"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schema/discover":{"post":{"tags":["extraction"],"summary":"Discover Layer","description":"Derive an L2 layer, and its projection to L1, from a document.\n\nReturned so a caller can inspect, edit and reuse it across a corpus\nrather than rediscovering per document.","operationId":"discover_layer_v1_schema_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayerInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/demo/discover":{"post":{"tags":["demo"],"summary":"Demo Discover","operationId":"demo_discover_v1_demo_discover_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayerInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/layers":{"get":{"tags":["extraction"],"summary":"List Layers","description":"The frozen L1 schema and the available L2 layers.\n\nL1 never changes, so consumers can be written against it once. L2 is\nchosen to fit the content; callers whose vertical is not covered can\ndefine one inline with `custom_layer`.","operationId":"list_layers_v1_layers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayersResponse"}}}}}}},"/v1/schema/default":{"get":{"tags":["extraction"],"summary":"Default Schema","description":"The label set used when a request omits `entities`.","operationId":"default_schema_v1_schema_default_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaSuggestion"}}}}}}},"/health":{"get":{"tags":["ops"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/models":{"get":{"tags":["extraction"],"summary":"List Models","operationId":"list_models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponse"}}}}}}},"/v1/extract":{"post":{"tags":["extraction"],"summary":"Extract","operationId":"extract_v1_extract_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/extract/batch":{"post":{"tags":["extraction"],"summary":"Extract Batch","operationId":"extract_batch_v1_extract_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchExtractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchExtractResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs":{"post":{"tags":["jobs"],"summary":"Submit Job","description":"Queue a corpus for background extraction and return immediately.","operationId":"submit_job_v1_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"List Jobs","operationId":"list_jobs_v1_jobs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"all","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"All"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get Job","operationId":"get_job_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["jobs"],"summary":"Cancel Job","operationId":"cancel_job_v1_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["billing"],"summary":"Usage","operationId":"usage_v1_usage_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(1h|24h|7d|30d|all)$","default":"24h","title":"Window"}},{"name":"all","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"All"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/limits":{"get":{"tags":["billing"],"summary":"Limits","description":"Current headroom, without consuming any of it.","operationId":"limits_v1_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitsResponse"}}}}}}}},"components":{"schemas":{"BatchExtractRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentInput"},"type":"array","minItems":1,"title":"Documents"},"entities":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","minItems":1},{"type":"null"}],"title":"Entities"},"relationships":{"items":{"$ref":"#/components/schemas/RelationSpec"},"type":"array","title":"Relationships"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Threshold"},"layer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer","description":"L2 layer for the whole batch, or 'auto' to discover one from the first document and reuse it. One layer per corpus keeps entity types consistent across documents, which per-document discovery would not."},"custom_layer":{"anyOf":[{"$ref":"#/components/schemas/CustomLayer"},{"type":"null"}]},"merge":{"type":"boolean","title":"Merge","description":"Resolve entities across all documents into a single graph. Per-document entities and relationships are then omitted from `results` to keep the payload small; find them in `graph`, filtered by document_id.","default":false}},"additionalProperties":false,"type":"object","required":["documents"],"title":"BatchExtractRequest"},"BatchExtractResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/DocumentResult"},"type":"array","title":"Results"},"graph":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeGraph"},{"type":"null"}]},"usage":{"$ref":"#/components/schemas/Usage"},"succeeded":{"type":"integer","title":"Succeeded","default":0},"failed":{"type":"integer","title":"Failed","default":0}},"additionalProperties":false,"type":"object","title":"BatchExtractResponse"},"CustomLayer":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name","description":"Identifier recorded as source_layer."},"description":{"type":"string","title":"Description","default":""},"entities":{"additionalProperties":{"type":"string","maxLength":128,"minLength":1},"propertyNames":{"maxLength":128,"minLength":1},"type":"object","minProperties":1,"title":"Entities","description":"L2 entity type -> L1 entity type."},"relationships":{"additionalProperties":{"type":"string","maxLength":128,"minLength":1},"propertyNames":{"maxLength":128,"minLength":1},"type":"object","title":"Relationships","description":"L2 relation type -> L1 relation type."}},"additionalProperties":false,"type":"object","required":["name","entities"],"title":"CustomLayer","description":"An L2 layer supplied by the caller.\n\nL2 is chosen to fit the content, so no fixed set of built-in layers can\ncover every vertical. A caller defines their own vocabulary here and states\nhow each type projects down to the frozen L1 schema; the projection is\nvalidated before any extraction runs, so an unmappable type fails fast\nrather than producing a graph that cannot be merged with anything else."},"DocumentInfo":{"properties":{"source_type":{"type":"string","title":"Source Type","description":"text, html, pdf or docx.","default":"text"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"The URL, when fetched."},"text_length":{"type":"integer","title":"Text Length"},"chunks":{"type":"integer","title":"Chunks","description":"Windows the document was split into.","default":1}},"additionalProperties":false,"type":"object","required":["text_length"],"title":"DocumentInfo","description":"What was actually extracted from, after fetching and parsing."},"DocumentInput":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Defaults to doc_<index>."},"text":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"additionalProperties":false,"type":"object","title":"DocumentInput"},"DocumentResult":{"properties":{"document_id":{"type":"string","title":"Document Id"},"status":{"type":"string","enum":["ok","error"],"title":"Status"},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorInfo"},{"type":"null"}]},"document":{"anyOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"null"}]},"entities":{"items":{"$ref":"#/components/schemas/Entity"},"type":"array","title":"Entities"},"relationships":{"items":{"$ref":"#/components/schemas/Relationship"},"type":"array","title":"Relationships"},"usage":{"$ref":"#/components/schemas/Usage"}},"additionalProperties":false,"type":"object","required":["document_id","status"],"title":"DocumentResult"},"Entity":{"properties":{"id":{"type":"string","title":"Id","description":"Stable within a response, e.g. 'e1'."},"text":{"type":"string","title":"Text","description":"Canonical surface form."},"type":{"type":"string","title":"Type"},"start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start","description":"Offset of the first mention."},"end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","description":"Highest confidence across mentions."},"mentions":{"items":{"$ref":"#/components/schemas/Mention"},"type":"array","title":"Mentions"},"layer1_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer1 Type","description":"Generic L1 type this L2 type projects to. Set when a layer is used."}},"additionalProperties":false,"type":"object","required":["id","text","type"],"title":"Entity"},"ErrorInfo":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"additionalProperties":false,"type":"object","required":["code","message"],"title":"ErrorInfo"},"ExtractRequest":{"properties":{"text":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Text","description":"Document text to extract from."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"http(s) URL to fetch instead of passing text. HTML, PDF and DOCX are parsed."},"include_text":{"type":"boolean","title":"Include Text","description":"Return the extracted text the offsets index into. Worth enabling for url sources, where the caller cannot otherwise reconstruct it.","default":false},"entities":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","minItems":1},{"type":"null"}],"title":"Entities","description":"Entity labels to extract, e.g. ['person', 'company']. Omit to use the service's standard set. An explicit empty list is an error, since it asks for nothing."},"relationships":{"items":{"$ref":"#/components/schemas/RelationSpec"},"type":"array","title":"Relationships","description":"Relationship types to extract. Omit for entities only."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"GLiNER model id. Defaults to the service default."},"threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Threshold"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id","description":"Caller-supplied id echoed onto every relationship for provenance."},"layer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer","description":"L2 layer to extract with, e.g. 'layer2_business'. Supplies the vocabulary when entities/relationships are omitted, and projects results down to the generic L1 schema. See GET /v1/layers."},"custom_layer":{"anyOf":[{"$ref":"#/components/schemas/CustomLayer"},{"type":"null"}],"description":"Define an L2 layer inline, for content no built-in layer covers. Every type must map to an L1 type or the request is rejected."}},"additionalProperties":false,"type":"object","title":"ExtractRequest"},"ExtractResponse":{"properties":{"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"document":{"anyOf":[{"$ref":"#/components/schemas/DocumentInfo"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Present only when include_text was set."},"entities":{"items":{"$ref":"#/components/schemas/Entity"},"type":"array","title":"Entities"},"relationships":{"items":{"$ref":"#/components/schemas/Relationship"},"type":"array","title":"Relationships"},"usage":{"$ref":"#/components/schemas/Usage"},"projection":{"anyOf":[{"$ref":"#/components/schemas/ProjectionInfo"},{"type":"null"}],"description":"Present when an L2 layer was used; records the L2->L1 lift."}},"additionalProperties":false,"type":"object","title":"ExtractResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","enum":["ok","degraded"],"title":"Status"},"upstream_configured":{"type":"boolean","title":"Upstream Configured"},"relation_schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relation Schema"}},"additionalProperties":false,"type":"object","required":["status","upstream_configured"],"title":"HealthResponse"},"JobDetail":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"],"title":"Status"},"created_at":{"type":"number","title":"Created At"},"started_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Finished At"},"total":{"type":"integer","title":"Total","default":0},"completed":{"type":"integer","title":"Completed","default":0},"failed":{"type":"integer","title":"Failed","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result"}},"additionalProperties":false,"type":"object","required":["id","status","created_at"],"title":"JobDetail"},"JobListResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobSummary"},"type":"array","title":"Jobs"}},"additionalProperties":false,"type":"object","title":"JobListResponse"},"JobSubmitRequest":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/DocumentInput"},"type":"array","minItems":1,"title":"Documents"},"entities":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","minItems":1},{"type":"null"}],"title":"Entities"},"relationships":{"items":{"$ref":"#/components/schemas/RelationSpec"},"type":"array","title":"Relationships"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Threshold"},"layer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer","description":"L2 layer for the whole batch, or 'auto' to discover one from the first document and reuse it. One layer per corpus keeps entity types consistent across documents, which per-document discovery would not."},"custom_layer":{"anyOf":[{"$ref":"#/components/schemas/CustomLayer"},{"type":"null"}]},"merge":{"type":"boolean","title":"Merge","description":"Resolve entities across all documents into a single graph. Per-document entities and relationships are then omitted from `results` to keep the payload small; find them in `graph`, filtered by document_id.","default":false}},"additionalProperties":false,"type":"object","required":["documents"],"title":"JobSubmitRequest","description":"A batch large enough that the caller should not hold a connection open."},"JobSummary":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"],"title":"Status"},"created_at":{"type":"number","title":"Created At"},"started_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Finished At"},"total":{"type":"integer","title":"Total","default":0},"completed":{"type":"integer","title":"Completed","default":0},"failed":{"type":"integer","title":"Failed","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":false,"type":"object","required":["id","status","created_at"],"title":"JobSummary"},"KnowledgeGraph":{"properties":{"documents":{"items":{"type":"string"},"type":"array","title":"Documents"},"entities":{"items":{"$ref":"#/components/schemas/Entity"},"type":"array","title":"Entities"},"relationships":{"items":{"$ref":"#/components/schemas/Relationship"},"type":"array","title":"Relationships"}},"additionalProperties":false,"type":"object","title":"KnowledgeGraph","description":"Entities resolved across every document in a batch."},"LayerInfo":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"entity_types":{"items":{"type":"string"},"type":"array","title":"Entity Types"},"relation_types":{"items":{"type":"string"},"type":"array","title":"Relation Types"},"entity_projection":{"additionalProperties":{"type":"string"},"type":"object","title":"Entity Projection"},"relation_projection":{"additionalProperties":{"type":"string"},"type":"object","title":"Relation Projection"}},"additionalProperties":false,"type":"object","required":["name"],"title":"LayerInfo"},"LayersResponse":{"properties":{"schema_version":{"type":"string","title":"Schema Version"},"layer1_entity_types":{"items":{"type":"string"},"type":"array","title":"Layer1 Entity Types"},"layer1_relation_types":{"items":{"type":"string"},"type":"array","title":"Layer1 Relation Types"},"layer1_weak_relations":{"items":{"type":"string"},"type":"array","title":"Layer1 Weak Relations"},"layers":{"items":{"$ref":"#/components/schemas/LayerInfo"},"type":"array","title":"Layers"}},"additionalProperties":false,"type":"object","required":["schema_version"],"title":"LayersResponse"},"LimitsResponse":{"properties":{"client_id":{"type":"string","title":"Client Id"},"rate_limit_per_minute":{"type":"integer","title":"Rate Limit Per Minute"},"requests_remaining":{"type":"integer","title":"Requests Remaining"},"daily_token_quota":{"type":"integer","title":"Daily Token Quota"},"tokens_remaining":{"type":"integer","title":"Tokens Remaining"}},"additionalProperties":false,"type":"object","required":["client_id","rate_limit_per_minute","requests_remaining","daily_token_quota","tokens_remaining"],"title":"LimitsResponse"},"Mention":{"properties":{"text":{"type":"string","title":"Text"},"start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id","description":"Which document these offsets index into. Set only in merged, multi-document graphs, where offsets are otherwise ambiguous."}},"additionalProperties":false,"type":"object","required":["text"],"title":"Mention","description":"One surface occurrence of an entity in the source text."},"ModelInfo":{"properties":{"id":{"type":"string","title":"Id"},"supports_inference":{"type":"boolean","title":"Supports Inference","default":true}},"additionalProperties":false,"type":"object","required":["id"],"title":"ModelInfo"},"ModelsResponse":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Models"},"source":{"type":"string","enum":["upstream","fallback"],"title":"Source","default":"upstream"}},"additionalProperties":false,"type":"object","title":"ModelsResponse"},"ProjectionInfo":{"properties":{"schema_version":{"type":"string","title":"Schema Version"},"source_layer":{"type":"string","title":"Source Layer"},"lift_policy_sha256":{"type":"string","title":"Lift Policy Sha256"},"dropped":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Dropped","description":"Edges the projection refused, with the reason for each."}},"additionalProperties":false,"type":"object","required":["schema_version","source_layer","lift_policy_sha256"],"title":"ProjectionInfo","description":"Stamped onto any response that was projected, so runs are auditable."},"RelationSpec":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"title":"Type"},"source":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Source"},"target":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Target"}},"additionalProperties":false,"type":"object","required":["type"],"title":"RelationSpec","description":"A relationship type to look for, optionally constrained by endpoint type.\n\nCallers may pass a bare string (`\"acquired\"`) or constrain the endpoints\n(`{\"type\": \"acquired\", \"source\": \"company\", \"target\": \"company\"}`).\nConstraining endpoints measurably reduces spurious pairings, so it is worth\nexposing even though it makes the request slightly more verbose."},"Relationship":{"properties":{"id":{"type":"string","title":"Id","description":"Stable within a response, e.g. 'r1'."},"source":{"type":"string","title":"Source","description":"Entity id of the source node."},"source_text":{"type":"string","title":"Source Text"},"type":{"type":"string","title":"Type"},"target":{"type":"string","title":"Target","description":"Entity id of the target node."},"target_text":{"type":"string","title":"Target Text"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"evidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence","description":"Source sentence supporting this edge."},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start","description":"Offset of the evidence span."},"end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End"},"layer1_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layer1 Type","description":"Generic L1 relation this projects to."},"source_layer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Layer","description":"L2 layer the edge was extracted with."},"source_relation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Relation","description":"Pre-projection L2 predicate, kept so specificity is never lost."},"weak":{"type":"boolean","title":"Weak","description":"True for L1 'related_to', which carries little meaning.","default":false}},"additionalProperties":false,"type":"object","required":["id","source","source_text","type","target","target_text"],"title":"Relationship","description":"A typed edge with the provenance needed to verify it."},"SchemaSuggestRequest":{"properties":{"text":{"type":"string","minLength":1,"title":"Text","description":"A representative sample of the corpus."}},"additionalProperties":false,"type":"object","required":["text"],"title":"SchemaSuggestRequest"},"SchemaSuggestion":{"properties":{"entities":{"items":{"type":"string"},"type":"array","title":"Entities"},"relationships":{"items":{"type":"string"},"type":"array","title":"Relationships"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model that proposed it, if any."},"source":{"type":"string","enum":["suggested","default"],"title":"Source","default":"suggested"}},"additionalProperties":false,"type":"object","title":"SchemaSuggestion","description":"A proposed (or default) extraction vocabulary."},"Usage":{"properties":{"tokens":{"type":"integer","title":"Tokens","default":0},"cost":{"type":"number","title":"Cost","default":0.0},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"additionalProperties":false,"type":"object","title":"Usage"},"UsageResponse":{"properties":{"client_id":{"type":"string","title":"Client Id"},"window":{"type":"string","title":"Window","description":"e.g. '24h', '30d', 'all'."},"requests":{"type":"integer","title":"Requests","default":0},"documents":{"type":"integer","title":"Documents","default":0},"tokens":{"type":"integer","title":"Tokens","default":0},"cost":{"type":"number","title":"Cost","default":0.0},"entities":{"type":"integer","title":"Entities","default":0},"relationships":{"type":"integer","title":"Relationships","default":0},"errors":{"type":"integer","title":"Errors","default":0}},"additionalProperties":false,"type":"object","required":["client_id","window"],"title":"UsageResponse","description":"Billable usage over a window, for one client or all of them."},"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"}}}}