{"openapi":"3.1.0","info":{"title":"BluePaper","description":"Upload an untrusted document and receive a PDF rebuilt from pixels, plus a\nregexp report on the original bytes.\n\nSafety comes from destruction, not detection. Zero regexp hits is not \"clean.\"\n\nIntegrators send `Authorization: Bearer <api-key>` on conversion routes.\nThe console at `/` does not. `POST /v1/conversions` accepts a completed\nTurnstile token instead, and that conversion id then authorizes status,\nreport, PDF, and delete. Key-created conversions still require the API key.\n`GET /v1/source`, the site pages (`/`, `/about`, `/how-it-works`,\n`/for-agents`), `/ui`, `/robots.txt`, `/sitemap.xml`, `/llms.txt`,\n`/healthz`, `/openapi.json`, `/docs`, and `/redoc` are unauthenticated.","license":{"name":"AGPL-3.0","url":"https://www.gnu.org/licenses/agpl-3.0.html"},"version":"0.1.0"},"paths":{"/v1/source":{"get":{"tags":["meta"],"summary":"AGPL corresponding source","operationId":"source_v1_source_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceResponse"}}}}}}},"/v1/conversions":{"post":{"tags":["conversions"],"summary":"Queue a conversion","operationId":"create_conversion_v1_conversions_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_conversion_v1_conversions_post"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Unsupported ocr_lang","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported file type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Concurrency limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Turnstile verification failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Queue saturated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]},{}]}},"/v1/conversions/{conversion_id}":{"get":{"tags":["conversions"],"summary":"Get conversion status","operationId":"get_conversion_v1_conversions__conversion_id__get","security":[{"HTTPBearer":[]},{}],"parameters":[{"name":"conversion_id","in":"path","required":true,"schema":{"type":"string","title":"Conversion Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Conversion not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["conversions"],"summary":"Cancel or delete a conversion","operationId":"delete_conversion_v1_conversions__conversion_id__delete","security":[{"HTTPBearer":[]},{}],"parameters":[{"name":"conversion_id","in":"path","required":true,"schema":{"type":"string","title":"Conversion Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Conversion not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/conversions/{conversion_id}/report":{"get":{"tags":["conversions"],"summary":"Get regexp report","operationId":"get_report_v1_conversions__conversion_id__report_get","security":[{"HTTPBearer":[]},{}],"parameters":[{"name":"conversion_id","in":"path","required":true,"schema":{"type":"string","title":"Conversion Id"}}],"responses":{"200":{"description":"Regexp hits on the original bytes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Conversion not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Report not available yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/conversions/{conversion_id}/pdf":{"get":{"tags":["conversions"],"summary":"Download sanitized PDF","description":"PDF rebuilt from pixels. Content-Disposition names the file `{original stem}-safe.pdf`.","operationId":"get_pdf_v1_conversions__conversion_id__pdf_get","security":[{"HTTPBearer":[]},{}],"parameters":[{"name":"conversion_id","in":"path","required":true,"schema":{"type":"string","title":"Conversion Id"}}],"responses":{"200":{"description":"PDF rebuilt from pixels","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Conversion not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"PDF not available yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"tags":["meta"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}}},"components":{"schemas":{"AcceptedResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"$ref":"#/components/schemas/ConversionStatus"},"sha256":{"type":"string","title":"Sha256"},"bytes":{"type":"integer","title":"Bytes"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","status","sha256","bytes","created_at"],"title":"AcceptedResponse"},"Body_create_conversion_v1_conversions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"ocr_lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Lang"},"cf_turnstile_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cf Turnstile Response","description":"Cloudflare Turnstile token. Required when the integrator API key is omitted."}},"type":"object","required":["file"],"title":"Body_create_conversion_v1_conversions_post"},"ConversionOutcome":{"properties":{"status":{"type":"string","title":"Status"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"ocr_lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Lang"},"output_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Bytes"}},"type":"object","required":["status"],"title":"ConversionOutcome"},"ConversionStatus":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"],"title":"ConversionStatus"},"ErrorResponse":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"ErrorResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"HealthResponse"},"Hit":{"properties":{"id":{"type":"string","title":"Id"},"count":{"type":"integer","title":"Count"},"first_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"First Offset"}},"type":"object","required":["id","count"],"title":"Hit"},"Report":{"properties":{"schema_version":{"type":"string","title":"Schema Version","default":"1.0.0"},"conversion_id":{"type":"string","title":"Conversion Id"},"sha256":{"type":"string","title":"Sha256"},"catalog_version":{"type":"string","title":"Catalog Version","default":"1.0.0"},"conversion_justified":{"type":"boolean","title":"Conversion Justified"},"caveat":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caveat"},"hits":{"items":{"$ref":"#/components/schemas/Hit"},"type":"array","title":"Hits"},"conversion":{"anyOf":[{"$ref":"#/components/schemas/ConversionOutcome"},{"type":"null"}]}},"type":"object","required":["conversion_id","sha256","conversion_justified"],"title":"Report"},"SourceResponse":{"properties":{"license":{"type":"string","title":"License","default":"AGPL-3.0"},"source_url":{"type":"string","title":"Source Url"},"commit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commit"}},"type":"object","required":["source_url"],"title":"SourceResponse"},"StatusResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"$ref":"#/components/schemas/ConversionStatus"},"sha256":{"type":"string","title":"Sha256"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"created_at":{"type":"string","title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","status","sha256","created_at"],"title":"StatusResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"Integrator API key. Send as `Authorization: Bearer <api-key>`. Browser clients omit this and complete Turnstile on `POST /v1/conversions` instead.","scheme":"bearer"}}},"tags":[{"name":"conversions","description":"Queue, inspect, and fetch conversion artifacts."},{"name":"meta","description":"Health and AGPL corresponding source."}]}