Catalog/text-word-wrap

Text

Smart word wrap API

Wraps text to a target column width on word boundaries (never splitting words), with optional per-line indent, returning both joined text and the line array. Answers 'how do I reflow this paragraph to 80 columns?', 'how do I word-wrap without breaking words?'.

Price$0.02per request
MethodPOST
Route/v1/text/word-wrap
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
textword-wrapwrapreflowcolumnsformattinglayoutterminal
API URLhttps://x402.hexl.dev/v1/text/word-wrap
Integration docs
Example request
{
  "text": "the quick brown fox jumps over the lazy dog",
  "width": 20
}
Example response
{
  "wrapped": "the quick brown fox\njumps over the lazy\ndog",
  "lines": [
    "the quick brown fox",
    "jumps over the lazy",
    "dog"
  ],
  "lineCount": 3,
  "width": 20
}
Input schema
{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "examples": [
        "the quick brown fox jumps over the lazy dog"
      ]
    },
    "width": {
      "type": "number",
      "examples": [
        20
      ]
    },
    "indent": {
      "type": "string"
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}