compression
Compress a text input
Compresses a single input — a string, or an object or array that is JSON-encoded first — and returns the compressed text with before-and-after token counts. Send the result to any LLM in place of the original. Wrap any span in <ttc_safe> tags to exclude it from compression. Aggressiveness guidance: 0.05-0.2 for text the model must answer questions about, 0.5-0.8 for conversation history and background context. If the compression backend is unavailable the API returns the original input unchanged rather than failing, so a compression outage never breaks the calling flow.
post/v1/compress
Request
- Base URLhttps://api.thetokencompany.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"model": "bear-2"
}Response
The compressed text and its token counts.
Changes
No recorded changes to this operation across all 1 revision of this API.