Supaklin — text cleaning API for LLMs

API Documentation

Complete reference for integrating Supaklin into your applications.

Quick Start

Installation
Install the Python SDK via pip
pip install supaklin

Basic Usage

from supaklin import Supaklin

client = Supaklin(api_key="sk_live_your_api_key")

result = client.clean(
    text="Your raw text content here",
    url="https://example.com"
)

print(result.text)

API Reference

POSTGET/api/v1/clean
Clean raw text or HTML by removing UI boilerplate

Authentication

Header
Value
Required
Authorization
Bearer sk_live_your_api_key
Required
Content-Type
application/json
Required

The legacy X-API-Key header is also supported.

Request Body

Field
Type / Description
Required
text
string
Raw text to clean. Max 100,000 characters.
Required
url
string
Source URL of the text (e.g., "https://reddit.com/r/tech/post").
Required
categories
string[]
Which boilerplate categories to remove. Options: "Navigation", "Interactive", "Promotional", "Chrome". Default: all.
Optional

Response (200 OK)

Field
Type / Description
clean_text
string
The cleaned output text.
tokens_used
integer
Total tokens consumed (input + output).
warning
string | null
Optional warning (e.g., new domain detected).

Error Responses

All errors follow a consistent format:

{
  "error": {
    "message": "API key required. Get one at https://supaklin.com",
    "type": "authentication_error",
    "code": 401
  }
}
401
authentication_error
Missing API key.
403
authentication_error
Invalid or inactive API key.
422
invalid_request_error
Missing required fields or validation error.
429
rate_limit_error
Insufficient token balance or rate limit exceeded.

Code Examples

Python SDK
Recommended for Python applications
from supaklin import Supaklin

client = Supaklin(api_key="sk_live_your_api_key")

result = client.clean(
    text="Header Menu Home About Contact Main Content Article Text Footer Copyright 2024",
    url="https://example.com"
)

print(f"Cleaned: {result.text}")
print(f"Tokens: {result.metadata['tokens_used']}")