Welcome to LessToken! This guide will walk you through everything you need to know to start compressing tokens and reducing your LLM costs.
LessToken is a powerful API that compresses text before sending it to Large Language Models (LLMs), dramatically reducing token usage and costs while maintaining semantic meaning.
Reduce token consumption by compressing prompts intelligently
Simple REST API works with any LLM provider
Track savings and compression rates in the dashboard
Create your account and generate your first API key in seconds.
Send your text to our API and receive compressed output.
Send the compressed text to any LLM provider and save on costs.
Track your token savings and compression rates in real-time.
Here's a simple example of compressing text with LessToken:
curl -X POST https://lesstokens.hive-hub.ai/api/compress \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "This is a very long text that needs compression to reduce token usage when sending to language models. The compression algorithm will intelligently reduce the size while maintaining semantic meaning.",
"options": {
"jsonMinify": true,
"removeComments": true
}
}'{
"compressedText": "Lng txt needs cmprsn 4 tkn reductn whn sndng 2 LMs. Algrtm wll rdce sze whl mntng smntic mnng.",
"metrics": {
"inputTokens": 142,
"outputTokens": 58,
"compressionRate": 59.15,
"processingTimeMs": 45
},
"requestId": "req_abc123xyz"
}59% Token Reduction
This example saved 84 tokens, reducing costs and improving response times!
Learn how to generate and manage API keys securely.
Step-by-step guide to your first compression request.
Learn how to interpret dashboard metrics and track savings.
Check out our SDKs and integration guides for your language.