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,
"duration_ms": 12
}
}| 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 |
| 413 | payload_too_large | prompt exceeds 5 MB |
| 500 | internal_error | unexpected server error |
Rate limit: 10 req/min on free tier. Exceeded → 429 with Retry-After.