Precise budgets
Limit output by tokens, words, or characters while retaining source spans.
Trimwise helps fit long documents into a small AI prompt budget by picking the most relevant excerpts across them. It supports both queryless and query-aware extraction and can be used as a prompt and context compressor.
Use it to trim retrieved documents to fit either a per-document limit or a single budget shared across all documents.
Limit output by tokens, words, or characters while retaining source spans.
Choose structural, lexical, semantic, or hybrid extraction—or let auto decide.
Trim a single or several sources under one budget, with optional wrappers and separators.
This queryless request uses the configured auto default. Add a query to focus the result on a question.
curl -sS https://trimwise.aatbit.com/api/v1/trim \
-H 'Content-Type: application/json' \
-d '{"text": "The useful detail is here. More background follows.", "limit": 6, "unit": "words"}'No key required. The current limit is 15,000 aggregate input words per request. See both examples and the JSON field reference →
We use your text and query only to return the trimmed result. This API processes them in memory; it does not save your prompts, queries, or results, and does not use them to train models.
We keep basic service information, such as request counts, timing, and errors, without your text. For full control, run the open-source Python library on your own machine.
This API runs the Trimwise Python package. For local or private workloads, install the library directly. Read the library docs.