Catalog/text-pad-align

Text

Pad and align API

Pads a string to a target width with left, right, or center alignment using a custom fill character. Answers 'how do I align this to a fixed width?', 'how do I center text with dots/spaces?'.

Price$0.01per request
MethodPOST
Route/v1/text/pad-align
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
textpadalignjustifycenterformattingfixed-widthlayout
API URLhttps://x402.hexl.dev/v1/text/pad-align
Integration docs
Example request
{
  "text": "hi",
  "width": 6,
  "align": "center",
  "fill": "."
}
Example response
{
  "padded": "..hi..",
  "align": "center",
  "added": 4
}
Input schema
{
  "type": "object",
  "required": [
    "text",
    "width"
  ],
  "properties": {
    "text": {
      "type": "string",
      "examples": [
        "hi"
      ]
    },
    "width": {
      "type": "number",
      "examples": [
        6
      ]
    },
    "align": {
      "type": "string",
      "enum": [
        "left",
        "right",
        "center"
      ],
      "examples": [
        "center"
      ]
    },
    "fill": {
      "type": "string",
      "examples": [
        "."
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}