LessTokens Logo
Docs
Api Reference

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 →

API Reference

Complete reference for the LessToken API. Learn about authentication, endpoints, request/response formats, and error handling.

Quick Start

Base URL: https://lesstokens.hive-hub.ai

Authentication: X-API-Key header

Content-Type: application/json

Rate Limit: 1000 requests/hour (Free tier)

Authentication

All API requests must include your API key using the X-API-Key header:

Example Request
curl https://lesstokens.hive-hub.ai/api/compress \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Keep your API key secure

Never expose your API key in client-side code, public repositories, or version control systems. Use environment variables instead.

Available Endpoints

POST/api/compressPrimary

Compress text using advanced algorithms to reduce token count

GET/api/statusComing Soon

Check API status and current rate limit information

Response Format

All successful API responses return JSON with the following structure:

{
  "data": {
    // Response data specific to the endpoint
  },
  "meta": {
    "requestId": "req_abc123xyz",
    "timestamp": "2025-01-18T12:00:00Z"
  }
}

Error Handling

Errors return appropriate HTTP status codes with detailed error messages:

400Bad Request

Invalid request parameters or malformed JSON

401Unauthorized

Missing or invalid API key

429Too Many Requests

Rate limit exceeded

500Internal Server Error

Server error occurred

View complete error reference

Rate Limiting

Rate limits are applied per API key. Response headers include current limit information:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1705579200

Free

1,000

requests/hour

Pro

10,000

requests/hour

Enterprise

Custom

requests/hour

Explore More

Compression API

Detailed documentation for the compression endpoint

Authentication

Learn about API key management and security

Integration Guides

SDK examples and code snippets for your language