Clean prompts programmatically — in your agents, pipelines, and coding tools. Removes filler, hedging, and redundancy while keeping every requirement: same result, fewer input tokens. One REST endpoint, plus a plug-and-play MCP for Claude Code, Cursor, and any MCP-capable agent.
API keys are tied to your account. Sign in or create a free account to generate one — the free tier includes API access.
Remote MCP over Streamable HTTP at https://aitokencleaner.com/api/mcp — nothing to install. It exposes one tool, clean_prompt, your agent can call before sending long prompts anywhere.
claude mcp add token-cleaner --transport http https://aitokencleaner.com/api/mcp \
--header "Authorization: Bearer atc_YOUR_KEY"{
"mcpServers": {
"token-cleaner": {
"url": "https://aitokencleaner.com/api/mcp",
"headers": { "Authorization": "Bearer atc_YOUR_KEY" }
}
}
}Tool parameters: text (required), mode, sub_format, model, target_model, concise — same semantics as the REST API below.
POST https://aitokencleaner.com/api/v1/clean with your key as a Bearer token.
curl -X POST https://aitokencleaner.com/api/v1/clean \
-H "Authorization: Bearer atc_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "could you please write me a really nice short poem about the sea, nothing too long please, maybe something calm",
"mode": "plain-clean",
"target_model": "gemini-2.5-flash"
}'{
"cleaned": "Write a short, calm poem about the sea.",
"mode": "plain-clean",
"model": "gemini-2.5-flash",
"stats": {
"original_tokens": 28,
"cleaned_tokens": 10,
"savings_percent": 64,
"estimated_usd_saved": 0.0000054,
"target_model": "gemini-2.5-flash"
},
"usage": { "credits_charged": 0, "cleans_today": 1, "daily_limit": 100 }
}| Field | Type | Notes |
|---|---|---|
| prompt | string | Required. The prompt to clean (2,000 chars free / 10,000 Pro). |
| mode | string | plain-clean (default) · caveman · structured-clean |
| sub_format | string | For structured-clean: json (default) or xml. |
| model | string | Cleaner model (default gemini-2.5-flash) — see the table below. |
| target_model | string | Where the cleaned prompt will be used — tunes token math and the $-saved estimate. |
| concise | boolean | Appends a directive so the target AI answers concisely (cuts output tokens too). Not applied to structured-clean. |
JSON { error, code } with standard statuses: 400 (validation), 401 (missing_key / invalid_key), 403 (premium_required / insufficient_credits), 422 (moderation_blocked), 429 (rate_limited / daily_limit, with Retry-After), 502 (clean_failed).
| Model id | Name | Tier | Credits / clean (Pro) |
|---|---|---|---|
| gemini-2.5-flashdefault | Gemini 2.5 Flash | Standard | 1 |
| mistral-large-latest | Mistral Large 3 | Standard | 1 |
| open-mixtral-8x22b | Mixtral 8x22B | Standard | 1 |
| ministral-8b-latest | Ministral 8B | Standard | 1 |
| ministral-14b-latest | Ministral 14B | Standard | 1 |
| sarvam-30b | Sarvam 30B | Standard | 1 |
| llama-3.3-70b-versatile | Llama 3.3 70B | Standard | 1 |
target_model.