{"openapi":"3.1.0","info":{"title":"StructuraMCP","summary":"PDF Bills of Quantities, quotes, invoices and spec sheets to schema-strict JSON/CSV.","description":"Pay-per-page ($0.08) extraction API with a Model Context Protocol endpoint at /mcp. Agents: read /llms.txt first.","version":"1.0.0"},"paths":{"/":{"get":{"tags":["discovery"],"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llms.txt":{"get":{"tags":["discovery"],"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/.well-known/mcp.json":{"get":{"tags":["discovery"],"summary":"Mcp Manifest","operationId":"mcp_manifest__well_known_mcp_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mcp Manifest  Well Known Mcp Json Get"}}}}}}},"/healthz":{"get":{"tags":["ops"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/readyz":{"get":{"tags":["ops"],"summary":"Readyz","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/schemas":{"get":{"tags":["schemas"],"summary":"List Schemas Route","operationId":"list_schemas_route_v1_schemas_get","parameters":[{"name":"include_json_schema","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Json Schema"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Schemas Route V1 Schemas Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schemas/{name}":{"get":{"tags":["schemas"],"summary":"Get Schema","operationId":"get_schema_v1_schemas__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Schema V1 Schemas  Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/parse":{"post":{"tags":["parse"],"summary":"Parse an uploaded PDF (multipart)","operationId":"parse_upload_v1_parse_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_parse_upload_v1_parse_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/parse/url":{"post":{"tags":["parse"],"summary":"Parse a PDF given by URL or base64 (JSON body)","operationId":"parse_reference_v1_parse_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseByReference"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/validate/boq":{"post":{"tags":["validate"],"summary":"Validate a BoQ JSON document (free)","operationId":"validate_boq_v1_validate_boq_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Document"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Validate Boq V1 Validate Boq Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/compare/quotes":{"post":{"tags":["validate"],"summary":"Compare parsed supplier quotes (free)","operationId":"compare_quotes_route_v1_compare_quotes_post","requestBody":{"content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Quotes"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Compare Quotes Route V1 Compare Quotes Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys":{"post":{"tags":["billing"],"summary":"Get a free API key with trial pages (one per email)","operationId":"signup_v1_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Signup V1 Keys Post"}}}},"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":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Month"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage V1 Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/checkout":{"post":{"tags":["billing"],"summary":"Create a Stripe Checkout link to buy page credits","operationId":"credits_checkout_v1_credits_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Credits Checkout V1 Credits Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys":{"post":{"tags":["admin"],"summary":"Create Key","operationId":"create_key_admin_keys_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Key Admin Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/keys/{key_id}/credits":{"post":{"tags":["admin"],"summary":"Add Credits","operationId":"add_credits_admin_keys__key_id__credits_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"pages","in":"query","required":true,"schema":{"type":"integer","title":"Pages"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Credits Admin Keys  Key Id  Credits Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/breaker":{"get":{"tags":["admin"],"summary":"Breaker State","operationId":"breaker_state_admin_breaker_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Breaker State Admin Breaker Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/breaker/reset":{"post":{"tags":["admin"],"summary":"Breaker Reset","operationId":"breaker_reset_admin_breaker_reset_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Breaker Reset Admin Breaker Reset Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_parse_upload_v1_parse_post":{"properties":{"file":{"type":"string","format":"binary","contentMediaType":"application/octet-stream","title":"File","description":"The PDF file"},"schema":{"type":"string","title":"Schema","description":"boq | invoice | quote | spec_sheet"},"output_format":{"type":"string","enum":["json","csv","both"],"title":"Output Format","default":"json"},"allow_llm":{"type":"boolean","title":"Allow Llm","default":true}},"type":"object","required":["file","schema"],"title":"Body_parse_upload_v1_parse_post"},"CheckoutRequest":{"properties":{"pages":{"type":"integer","maximum":1000000.0,"minimum":10.0,"title":"Pages","description":"Number of page credits to buy"}},"type":"object","required":["pages"],"title":"CheckoutRequest"},"CreateKeyRequest":{"properties":{"customer":{"type":"string","title":"Customer"},"plan":{"type":"string","enum":["prepaid","metered"],"title":"Plan","default":"prepaid"},"credits":{"type":"integer","minimum":0.0,"title":"Credits","default":0},"monthly_llm_cap_usd":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Monthly Llm Cap Usd"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"}},"type":"object","required":["customer"],"title":"CreateKeyRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ParseByReference":{"properties":{"schema":{"type":"string","title":"Schema","description":"boq | invoice | quote | spec_sheet"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url","description":"Public http(s) URL of the PDF"},"pdf_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Base64","description":"Base64-encoded PDF bytes"},"output_format":{"type":"string","enum":["json","csv","both"],"title":"Output Format","default":"json"},"allow_llm":{"type":"boolean","title":"Allow Llm","default":true}},"type":"object","required":["schema"],"title":"ParseByReference"},"SignupRequest":{"properties":{"email":{"type":"string","title":"Email","description":"Contact email; one free key per address"}},"type":"object","required":["email"],"title":"SignupRequest"},"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"}}}}