Overview
Cut a document down to a token budget by dropping the lowest-priority sections first and truncating the last one at a sentence boundary; exact count of the result. Accepts explicit sections with priorities (or Markdown that is split at headings, with optional priorities by heading text). Required sections are never dropped.
Protocol
x402 (POST)
Price
$0.0020
Payment Asset
USD Coin
Payment Network
eip155:8453
Category
uncategorized
Provider
denk
Indexed
2026-11-20 16:11:02
Health
Status
unknown
Latency (p50)
—
Uptime (30d)
—
Reliability Score
—
Last Checked
Never
Last Healthy
Never
Consecutive Failures
0
Input Schema
{
"body": {
"budget_tokens": 12,
"sections": [
{
"id": "a",
"priority": 90,
"text": "Keep this sentence."
},
{
"id": "b",
"priority": 10,
"text": "Drop this one first. It is less important."
}
]
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Output Schema
{
"example": {
"limitations": [
"Priorities are taken from the caller; the service does not judge content importance."
],
"result": {
"budget_tokens": 12,
"sections": [
{
"id": "a",
"priority": 90,
"required": false,
"status": "kept",
"title": null,
"tokens_after": 4,
"tokens_before": 4
},
{
"id": "b",
"priority": 10,
"required": false,
"status": "truncated",
"title": null,
"tokens_after": 5,
"tokens_before": 10
}
],
"text": "Keep this sentence.\n\nDrop this one first.",
"tokenizer": "o200k_base",
"tokens_after": 9,
"tokens_before": 14,
"within_budget": true
},
"service": "token-budget-trim",
"status": "success"
},
"type": "json"
}