{"openapi":"3.1.0","info":{"title":"Humanizer API","version":"1.0.0","description":"REST API for AI agents to submit documents or raw text to Humanizer (humanizer.chimera-realm.foo), split them cleanly by word limit, store humanized chunks, and retrieve the reassembled document."},"servers":[{"url":"https://humanizer.chimera-realm.foo"}],"paths":{"/api/health":{"get":{"summary":"Health check and server configuration","responses":{"200":{"description":"Server status and widget metadata"}}}},"/api/jobs":{"get":{"summary":"List all humanization jobs","responses":{"200":{"description":"Array of job summaries"}}},"post":{"summary":"Create a humanization job from raw text","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"title":{"type":"string","example":"Research Paper Draft"},"text":{"type":"string","description":"Full document text to split into word-limit chunks."},"wordLimit":{"type":"integer","default":1000,"minimum":20,"maximum":10000},"metadata":{"type":"object","additionalProperties":true}}}}}},"responses":{"201":{"description":"Created job with word-limit chunks"}}}},"/api/jobs/upload":{"post":{"summary":"Upload a document (.txt, .md, .docx, .pdf) and create a chunked job","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"title":{"type":"string"},"wordLimit":{"type":"integer","default":1000}}}}}},"responses":{"201":{"description":"Extracted and chunked job"}}}},"/api/jobs/{id}":{"get":{"summary":"Get full job details, chunks, and assembled text","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Full job object"},"404":{"description":"Job not found"}}},"delete":{"summary":"Delete a job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"}}}},"/api/jobs/{id}/next-chunk":{"get":{"summary":"Fetch the next pending chunk for an agent to humanize","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Next pending chunk or null if completed"}}}},"/api/jobs/{id}/chunks/{index}":{"put":{"summary":"Save the humanized text for a specific chunk","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["humanizedText"],"properties":{"humanizedText":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated chunk and job progress"}}}},"/api/jobs/{id}/result":{"get":{"summary":"Retrieve the fully reassembled humanized document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","txt","md"],"default":"json"}},{"name":"partial","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Assembled humanized document"},"409":{"description":"Job is not yet complete (pass partial=true for partial output)"}}}}}}