Skip to main content

AI response to plain text API

Paste a ChatGPT, Claude or Gemini answer and get clean plain text: headings, bold, tables and emoji gone.

EndpointPOST https://astraltext.com/api/v1/ai-response-to-text
AuthBearer token, free
Sendsinput: text
Returnsresult: text
PriceFree. 1,000 calls a day, 60 a minute.

When to call it

The usual job after calling a model is the same three steps every time: drop the Markdown, drop the emoji, drop the invisible characters. This is those three steps in one call, so the code between your model and your database is a single line.

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-response-to-text \
  -H "Authorization: Bearer ast_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"input": "## Summary 🎉\n\nThe **answer** is `42` — as expected​."}'
response
{
  "tool": "ai-response-to-text",
  "result": "Summary\n\nThe answer is 42 - as expected.",
  "chars": 40,
  "ms": 2
}

In your language

JavaScript
const res = await fetch("https://astraltext.com/api/v1/ai-response-to-text", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ASTRAL_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"input": "## Summary 🎉\n\nThe **answer** is `42` — as expected​."}),
});
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-response-to-text",
    headers={"Authorization": f"Bearer {os.environ['ASTRAL_TOKEN']}"},
    json={"input": "## Summary 🎉\n\nThe **answer** is `42` — as expected​."},
    timeout=30,
)
res.raise_for_status()
result = res.json()["result"]

Parameters

FieldTypeNotes
inputstringRequired. Up to 200,000 characters per call.

Errors

Errors are RFC 7807 problem documents with a stable type you can branch on.

missing-token401No Authorization header.
bad-request400input missing or the wrong type.
tool-failed422The input could not be processed. detail says why.
quota-exceeded429Past 1,000 calls today.

Questions

What is the difference from ai-text-cleaner?
ai-text-cleaner handles characters. This one also strips Markdown and emoji first, which is what a model's answer usually needs before it can be stored or sent.
Does it summarise or rewrite?
No. Nothing is rephrased or shortened. Only markup, emoji and formatting artefacts are removed.
Can I get the steps separately?
Yes. strip-markdown, remove-emoji and ai-text-cleaner are each their own endpoint if you want to control the order or skip a step.

Other endpoints

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