<leantokn>

API Reference

One endpoint. Stable contract.

Authentication

Authorization: Bearer ltk_...

Generate keys in the dashboard. All keys begin with ltk_.

POST /v1/trim

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"}'

Parameters

inputstringRequired. The content to trim.
typestringRequired. "html" "prompt"
intensitystringOnly applies to type "prompt". Ignored otherwise.

Response

{
  "result":  "...",
  "type":    "html",
  "stats": {
    "input_tokens":    12847,
    "output_tokens":   1923,
    "tokens_saved":    10924,
    "savings_percent": 85
  }
}

Errors

400unsupported_typetype is not one of the supported values
400invalid_requestmissing/invalid prompt or type, bad JSON, or invalid intensity
401invalid_api_keymissing, malformed, or revoked API key
402insufficient_fundswallet balance empty and free tier exhausted
413payload_too_largeprompt exceeds 5 MB
429rate_limit_exceededrate limit hit — check Retry-After header for seconds until reset
500internal_errorunexpected server error
rate limits (per API key, per minute)
"low"120 req / min
"medium"10 req / min
"high"10 req / min

Need higher limits? admin@leantokn.com