One endpoint. Stable contract.
Authorization: Bearer ltk_...
Generate keys in the dashboard. All keys begin with ltk_.
curl -X POST https://api.leantokn.com/v1/trim \
-H "Authorization: Bearer ltk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"<h1>Hello</h1><p>World</p>","type":"html"}'| input | string | Required. The content to trim. |
| type | string | Required. "html" "prompt" |
| intensity | string | Only applies to type "prompt". Ignored otherwise. |
{
"result": "...",
"type": "html",
"stats": {
"input_tokens": 12847,
"output_tokens": 1923,
"tokens_saved": 10924,
"savings_percent": 85
}
}| 400 | unsupported_type | type is not one of the supported values |
| 400 | invalid_request | missing/invalid prompt or type, bad JSON, or invalid intensity |
| 401 | invalid_api_key | missing, malformed, or revoked API key |
| 402 | insufficient_funds | wallet balance empty and free tier exhausted |
| 413 | payload_too_large | prompt exceeds 5 MB |
| 429 | rate_limit_exceeded | rate limit hit — check Retry-After header for seconds until reset |
| 500 | internal_error | unexpected server error |
| "low" | 120 req / min |
| "medium" | 10 req / min |
| "high" | 10 req / min |
Need higher limits? admin@leantokn.com