{"openapi":"3.1.0","info":{"title":"Trimwise API","description":"Free public text trimming, independent batches, and shared-budget context.","version":"0.1.1"},"paths":{"/api/v1/trim":{"post":{"summary":"Trim","operationId":"trim_api_v1_trim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrimResponse"}}}},"408":{"description":"Request Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/trim/batch":{"post":{"summary":"Batch","operationId":"batch_api_v1_trim_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"408":{"description":"Request Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/context":{"post":{"summary":"Context","operationId":"context_api_v1_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse"}}}},"408":{"description":"Request Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Unsupported Media Type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/docs":{"get":{"summary":"Docs","operationId":"docs_docs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/healthz":{"get":{"summary":"Health","operationId":"health_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Healthz Get"}}}}}}},"/readyz":{"get":{"summary":"Ready","operationId":"ready_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Ready Readyz Get"}}}}}}}},"components":{"schemas":{"BatchRequest":{"properties":{"inputs":{"items":{"$ref":"#/components/schemas/TrimRequest"},"type":"array","minItems":1,"title":"Inputs"}},"additionalProperties":false,"type":"object","required":["inputs"],"title":"BatchRequest"},"BatchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/TrimResponse"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"BatchResponse"},"ContextRequest":{"properties":{"sources":{"items":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ContextSourceRequest"}]},"type":"array","minItems":1,"title":"Sources"},"limit":{"type":"integer","minimum":0.0,"title":"Limit"},"unit":{"anyOf":[{"type":"string","enum":["tokens","words","characters"]},{"type":"null"}],"title":"Unit"},"strategy":{"anyOf":[{"type":"string","enum":["auto","structural","lexical","semantic","hybrid"]},{"type":"null"}],"title":"Strategy"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"deduplicate":{"type":"boolean","title":"Deduplicate","default":false},"separator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Separator"}},"additionalProperties":false,"type":"object","required":["sources","limit"],"title":"ContextRequest"},"ContextResponse":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/ContextSourceResponse"},"type":"array","title":"Sources"},"input_count":{"type":"integer","title":"Input Count"},"output_count":{"type":"integer","title":"Output Count"},"limit":{"type":"integer","title":"Limit"},"unit":{"type":"string","enum":["tokens","words","characters"],"title":"Unit"},"strategy":{"type":"string","enum":["auto","structural","lexical","semantic","hybrid"],"title":"Strategy"},"trimmed":{"type":"boolean","title":"Trimmed"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"type":"object","required":["sources","input_count","output_count","limit","unit","strategy","trimmed","text"],"title":"ContextResponse"},"ContextSourceRequest":{"properties":{"text":{"type":"string","title":"Text"},"prefix":{"type":"string","title":"Prefix","default":""},"suffix":{"type":"string","title":"Suffix","default":""}},"additionalProperties":false,"type":"object","required":["text"],"title":"ContextSourceRequest"},"ContextSourceResponse":{"properties":{"source_index":{"type":"integer","title":"Source Index"},"text":{"type":"string","title":"Text"},"input_count":{"type":"integer","title":"Input Count"},"output_count":{"type":"integer","title":"Output Count"},"trimmed":{"type":"boolean","title":"Trimmed"},"spans":{"items":{"$ref":"#/components/schemas/Span"},"type":"array","title":"Spans"}},"type":"object","required":["source_index","text","input_count","output_count","trimmed","spans"],"title":"ContextSourceResponse"},"ErrorDetail":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"type":"object","required":["code","message"],"title":"ErrorDetail"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["error"],"title":"ErrorResponse"},"Span":{"properties":{"start":{"type":"integer","title":"Start"},"end":{"type":"integer","title":"End"}},"type":"object","required":["start","end"],"title":"Span"},"TrimRequest":{"properties":{"text":{"type":"string","title":"Text"},"limit":{"type":"integer","minimum":0.0,"title":"Limit"},"unit":{"anyOf":[{"type":"string","enum":["tokens","words","characters"]},{"type":"null"}],"title":"Unit"},"strategy":{"anyOf":[{"type":"string","enum":["auto","structural","lexical","semantic","hybrid"]},{"type":"null"}],"title":"Strategy"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"}},"additionalProperties":false,"type":"object","required":["text","limit"],"title":"TrimRequest"},"TrimResponse":{"properties":{"text":{"type":"string","title":"Text"},"input_count":{"type":"integer","title":"Input Count"},"output_count":{"type":"integer","title":"Output Count"},"limit":{"type":"integer","title":"Limit"},"unit":{"type":"string","enum":["tokens","words","characters"],"title":"Unit"},"strategy":{"type":"string","enum":["auto","structural","lexical","semantic","hybrid"],"title":"Strategy"},"trimmed":{"type":"boolean","title":"Trimmed"},"spans":{"items":{"$ref":"#/components/schemas/Span"},"type":"array","title":"Spans"}},"type":"object","required":["text","input_count","output_count","limit","unit","strategy","trimmed","spans"],"title":"TrimResponse"}}}}