{"openapi":"3.1.0","info":{"title":"Humanize API","version":"1.0.0","description":"Offline, deterministic prose rewriter. Free and keyless; provided best effort and may be rate limited or withdrawn if usage costs grow."},"servers":[{"url":"https://humanize.lbyte.app"}],"security":[],"components":{"schemas":{"RewriteResponse":{"type":"object","properties":{"revised":{"type":"string"},"before":{"$ref":"#/components/schemas/Analysis"},"after":{"$ref":"#/components/schemas/Analysis"}},"required":["revised","before","after"]},"Analysis":{"type":"object","properties":{"words":{"type":"integer"},"sentences":{"type":"integer"},"paragraphs":{"type":"integer"},"averageSentenceWords":{"type":"number"},"sentenceLengthVariation":{"type":"number"},"averageParagraphSentences":{"type":"number"},"paragraphLengthVariation":{"type":"number"},"contractionRate":{"type":"number","minimum":0,"maximum":1},"punctuationPer100Words":{"type":"object","properties":{"commas":{"type":"number"},"semicolons":{"type":"number"},"colons":{"type":"number"},"parentheses":{"type":"number"},"questions":{"type":"number"}},"required":["commas","semicolons","colons","parentheses","questions"]},"emDashes":{"type":"integer"},"emDashesPer100Words":{"type":"number"},"stockPhrases":{"type":"array","items":{"type":"object","properties":{"phrase":{"type":"string"},"count":{"type":"integer"}},"required":["phrase","count"]}},"repeatedOpenings":{"type":"array","items":{"type":"object","properties":{"opening":{"type":"string"},"count":{"type":"integer"}},"required":["opening","count"]}},"repeatedTrigrams":{"type":"array","items":{"type":"object","properties":{"trigram":{"type":"string"},"count":{"type":"integer"}},"required":["trigram","count"]}}},"required":["words","sentences","paragraphs","averageSentenceWords","sentenceLengthVariation","averageParagraphSentences","paragraphLengthVariation","contractionRate","punctuationPer100Words","emDashes","emDashesPer100Words","stockPhrases","repeatedOpenings","repeatedTrigrams"]},"Error":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"RewriteRequest":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000,"description":"Draft to rewrite."},"typos":{"type":"boolean","default":false,"description":"Insert up to two minor slips in prose of at least 250 words."},"stripFormatting":{"type":"boolean","default":false,"description":"Remove Markdown emphasis, code delimiters, quote markers, and table decoration. Links become \"label (url)\"."},"contractions":{"type":"boolean","default":false,"description":"Add conversational contractions such as \"do not\" to \"don't\"."},"expandContractions":{"type":"boolean","default":false,"description":"Spell out contractions such as \"don't\" to \"do not\". Ignored when contractions or a usable sample is set."},"synonyms":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"default":false,"description":"Force plainer synonyms from a built-in dictionary, such as \"utilization\" to \"use\". true swaps every match; a number from 0 to 1 swaps that share of matches, spread evenly. Mostly safe; review the result."},"splitSentences":{"type":"boolean","default":false,"description":"Split long sentences joined by \", and I\" or \", but we\" into two sentences."},"expandAbbreviations":{"type":"boolean","default":false,"description":"Spell out short forms such as \"apps\", \"e.g.\", and \"ASAP\"."},"extraSpaces":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"default":false,"description":"Slip in spacing: a double space between words or after a sentence, or one trailing space at a line end. A number from 0 to 1 is the chance per word gap, and line ends get 5 times that chance (at most 1); true uses 0.02. Seeded from the text, so the same input gives the same result."},"sample":{"type":"string","maxLength":50000,"description":"Genuine author prose (100+ words). Moves contraction use toward the sample's rate and overrides contractions."}},"required":["text"]},"BatchResponse":{"type":"object","properties":{"seed":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"revised":{"type":"string"},"settings":{"type":"object","properties":{"mood":{"type":"string","enum":["casual","neutral","formal"]},"contractions":{"type":"boolean"},"expandContractions":{"type":"boolean"},"stripFormatting":{"type":"boolean"},"typos":{"type":"boolean"},"synonyms":{"type":"boolean"},"splitSentences":{"type":"boolean"},"expandAbbreviations":{"type":"boolean"},"extraSpaces":{"type":"boolean"},"variants":{"type":"object","additionalProperties":{"type":"string"},"description":"Rule or style key to the wording chosen for this item."},"slips":{"type":"array","items":{"type":"string"},"description":"Words given a typo in this item."}},"required":["contractions","expandContractions","stripFormatting","typos","synonyms","splitSentences","expandAbbreviations","extraSpaces","variants","slips"]}},"required":["revised","settings"]}},"report":{"type":"object","properties":{"before":{"$ref":"#/components/schemas/BatchReport"},"after":{"$ref":"#/components/schemas/BatchReport"}},"required":["before","after"]}},"required":["seed","items","report"]},"BatchReport":{"type":"object","properties":{"sharedOpenings":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"items":{"type":"array","items":{"type":"integer"},"description":"Zero-based item indexes."}},"required":["text","items"]},"description":"First word or two shared by several items."},"sharedClosings":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"items":{"type":"array","items":{"type":"integer"},"description":"Zero-based item indexes."}},"required":["text","items"]},"description":"Last three words shared by several items."},"sharedTrigrams":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"items":{"type":"array","items":{"type":"integer"},"description":"Zero-based item indexes."}},"required":["text","items"]},"description":"Three-word sequences found in at least 30% of items (min 2)."},"nearDuplicates":{"type":"array","items":{"type":"object","properties":{"items":{"type":"array","prefixItems":[{"type":"integer"},{"type":"integer"}]},"similarity":{"type":"number"}},"required":["items","similarity"]},"description":"Item pairs whose content-word bigrams overlap by at least 0.5 (Jaccard)."},"shape":{"type":"object","properties":{"words":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"},"mean":{"type":"number"},"stddev":{"type":"number"}},"required":["min","max","mean","stddev"]},"averageSentenceWords":{"type":"object","properties":{"min":{"type":"number"},"max":{"type":"number"},"mean":{"type":"number"},"stddev":{"type":"number"}},"required":["min","max","mean","stddev"]},"withLists":{"type":"integer"},"withHeadings":{"type":"integer"},"plainProse":{"type":"integer"},"uniformLength":{"type":"boolean","description":"At least 3 items whose word counts vary by under 15%."}},"required":["words","averageSentenceWords","withLists","withHeadings","plainProse","uniformLength"]}},"required":["sharedOpenings","sharedClosings","sharedTrigrams","nearDuplicates","shape"]},"BatchRequest":{"type":"object","properties":{"texts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":20000},"minItems":1,"maxItems":50,"description":"Drafts to rewrite, 1 to 50 items, 60,000 characters in total."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"Seed for every shuffle. Omit to derive one from the texts; the response returns the seed used."},"contractions":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Add conversational contractions. true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"typos":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Allow slips: one per 250 eligible words across the batch, at most one or two per item, never the same slip twice. true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"stripFormatting":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Remove Markdown styling. true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"synonyms":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Force plainer synonyms from a built-in dictionary on every match in the chosen items. Mostly safe; review the result. true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"expandContractions":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Spell out contractions; contractions win where both apply. true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"splitSentences":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Split long sentences joined by \", and I\" or \", but we\". true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"expandAbbreviations":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Spell out short forms such as \"apps\" and \"e.g.\". true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"extraSpaces":{"anyOf":[{"type":"boolean"},{"type":"number","minimum":0,"maximum":1}],"description":"Slip in spacing (double spaces, trailing spaces at line ends) at a 0.02 chance per word gap (5 times that at line ends) in the chosen items. true applies to every item; a number from 0 to 1 is the exact share of items, chosen by seeded shuffle."},"moods":{"type":"array","items":{"type":"string","enum":["casual","neutral","formal"]},"minItems":1,"maxItems":3,"description":"Deal mood presets evenly across items instead of per-option settings. casual: contractions, stripped formatting, typos, extra spaces. neutral: phrase cleanup only. formal: expand contractions and abbreviations."},"vary":{"type":"boolean","default":false,"description":"Rotate equally safe replacement wording and em-dash aside style across items."},"sample":{"type":"string","maxLength":50000,"description":"Genuine author prose (100+ words). Its contraction rate applies to every item and overrides contraction settings and moods."}},"required":["texts"]},"Health":{"type":"object","properties":{"status":{"type":"string"},"commit":{"type":"string"},"builtAt":{"type":"string"}},"required":["status","commit","builtAt"]}},"parameters":{}},"paths":{"/api/rewrite":{"post":{"operationId":"rewrite","summary":"Rewrite text and return before/after metrics","description":"Code, Markdown links and images, URLs, and double-quoted text are never edited. Whole request body must be under 75,000 characters.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewriteRequest"}}}},"responses":{"200":{"description":"Rewritten text with analysis of the original and revised text.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RewriteResponse"}}}},"400":{"description":"Invalid JSON or fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Content-Type is not application/json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this client. Honor the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server is at capacity. Honor the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/batch":{"post":{"operationId":"rewriteBatch","summary":"Rewrite a list of drafts with seeded variety and a cross-item report","description":"Same protections as /api/rewrite. Whole request body must be under 120,000 characters.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}}},"responses":{"200":{"description":"Revised items with their assigned settings and before/after cross-item reports.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"Invalid JSON or fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Content-Type is not application/json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Processing failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests from this client. Honor the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server is at capacity. Honor the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/healthz":{"get":{"operationId":"healthz","summary":"Service status and build identity","responses":{"200":{"description":"Service is up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}}},"webhooks":{}}