LessTokens Logo
Docs
Getting Started

Documentation

Getting Started

  • Overview
  • Account Setup
  • First API Key
  • First Request
  • Understanding Metrics

API Reference

  • Overview
  • Authentication
  • Compressionnew
  • MCP Servernew
  • Errors

Integrations

  • Node.js / TypeScript
  • Python
  • cURL

Resources

  • Best Practices

Need help?

Join our community or contact support for assistance.

Contact Support →

Getting Started

Welcome to LessToken! This guide will walk you through everything you need to know to start compressing tokens and reducing your LLM costs.

What is LessToken?

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.

Up to 60% Savings

Reduce token consumption by compressing prompts intelligently

Easy Integration

Simple REST API works with any LLM provider

Real-time Analytics

Track savings and compression rates in the dashboard

How It Works

1

Sign Up & Get API Key

Create your account and generate your first API key in seconds.

2

Compress Your Text

Send your text to our API and receive compressed output.

3

Use with Your LLM

Send the compressed text to any LLM provider and save on costs.

4

Monitor Savings

Track your token savings and compression rates in real-time.

Quick Example

Here's a simple example of compressing text with LessToken:

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

Response

{
  "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!

Next Steps

Create Your First API Key

Learn how to generate and manage API keys securely.

Continue

Make Your First Request

Step-by-step guide to your first compression request.

Continue

Understand Metrics

Learn how to interpret dashboard metrics and track savings.

Continue

Explore Integrations

Check out our SDKs and integration guides for your language.

Continue