AI text cleaner API
Strip the em dashes, curly quotes and hidden characters that make text read as AI-generated.
| Endpoint | POST https://astraltext.com/api/v1/ai-text-cleaner |
| Auth | Bearer token, free |
| Sends | input: text |
| Returns | result: text |
| Price | Free. 1,000 calls a day, 60 a minute. |
When to call it
A model's output carries fingerprints that no human types: em dashes where a comma belongs, curly quotes, zero-width joiners, non-breaking spaces. Cleaning them by hand works once. In a content pipeline, a CMS import or a publishing step, it has to happen to every document without anyone remembering to do it.
For a one-off, the browser version needs no token and never sends your data anywhere: it runs on your own machine.
Example
curl
curl -X POST https://astraltext.com/api/v1/ai-text-cleaner \
-H "Authorization: Bearer ast_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"input": "The result — as we’ll see — is “clean” text​ with no artefacts."}'response
{
"tool": "ai-text-cleaner",
"result": "The result - as we'll see - is \"clean\" text with no artefacts.",
"chars": 62,
"ms": 1
}In your language
JavaScript
const res = await fetch("https://astraltext.com/api/v1/ai-text-cleaner", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ASTRAL_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"input": "The result — as we’ll see — is “clean” text​ with no artefacts."}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const { result } = await res.json();Python
import os, requests
res = requests.post(
"https://astraltext.com/api/v1/ai-text-cleaner",
headers={"Authorization": f"Bearer {os.environ['ASTRAL_TOKEN']}"},
json={"input": "The result — as we’ll see — is “clean” text​ with no artefacts."},
timeout=30,
)
res.raise_for_status()
result = res.json()["result"]Parameters
| Field | Type | Notes |
|---|---|---|
| input | string | Required. Up to 200,000 characters per call. |
Errors
Errors are RFC 7807 problem documents with a stable type you can branch on.
| missing-token | 401 | No Authorization header. |
| bad-request | 400 | input missing or the wrong type. |
| tool-failed | 422 | The input could not be processed. detail says why. |
| quota-exceeded | 429 | Past 1,000 calls today. |
Questions
- What exactly does it remove?
- Em and en dashes become hyphens, curly quotes become straight ones, and invisible characters go: zero-width spaces and joiners, the byte-order mark, soft hyphens, bidirectional marks and exotic spaces such as the non-breaking and thin space.
- Does it rewrite my sentences?
- No. It touches characters, never words. Nothing is rephrased, summarised or reordered, so the meaning and the length of the text are unchanged.
- Will this make text pass an AI detector?
- It removes formatting artefacts, which is a real signal some tools use, but no detector is defeated by punctuation alone. Treat it as tidying, not as a disguise.
Other endpoints
- Remove em dashes API
- Remove invisible characters API
- Remove emoji API
- Remove line breaks API
- Strip Markdown API
- Remove citations API
A token takes thirty seconds
Free, no card, 1,000 calls a day, and the same token works on astraltext.com, astralpdf.com, astraljson.com and astralbatch.com.
Get a free token