LLM
Dedent & normalize prompt API
Normalizes a prompt — strips common leading indentation, collapses runs of blank lines, trims trailing whitespace, normalizes line endings — and reports the token count before vs after plus tokens saved (cleaner prompts often cost less). Answers 'how do I clean up this indented prompt?', 'how many tokens can I save by normalizing whitespace?'.
Price$0.02per request
MethodPOST
Route/v1/llm/dedent-prompt
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
llmpromptdedentnormalizewhitespacetokenscleanagent
API URL
Integration docshttps://x402.hexl.dev/v1/llm/dedent-promptExample request
{
"text": " line one\n line two\n\n\n line three "
}Example response
{
"normalized": "line one\nline two\n\nline three",
"removedIndent": 4,
"tokensBefore": 12,
"tokensAfter": 8,
"tokensSaved": 4
}Input schema
{
"type": "object",
"required": [
"text"
],
"properties": {
"text": {
"type": "string",
"examples": [
" line one\n line two\n\n\n line three "
]
},
"collapseBlankLines": {
"type": "boolean",
"default": true
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}