TextMind API reference
One API for text understanding. Six endpoints run deterministic algorithms with zero marginal cost, four call Cloudflare Workers AI when you need generation rather than measurement.
Deterministic (costClass "free", no model, stable output): keyword extraction with TF-IDF over sentences and 1/2/3-grams, entity extraction with exact spans, lexicon sentiment with per-sentence breakdown, language detection across twelve languages, readability metrics and the stopword reference lists.
Neural (costClass "neural", Workers AI binding required): summarisation with chunking, tone rewriting, zero-shot classification and translation. These return 503 AI_UNAVAILABLE when the binding is missing or a model call fails, never a 500.
Honest limits: sentiment is a curated word list, so sarcasm, emoji and irony are missed. Language detection uses short built-in samples and is unreliable below about three words. Readability formulas are English-calibrated. AI output quality and factual accuracy depend on the model, and typical latency is 1-3 seconds. Plain text is expected: HTML is not stripped.
Built for: support ticket triage, CMS and SEO content tooling, lead qualification from free text, migration audits, moderation pre-screens, and any product that needs a few text features without an OpenAI bill.
Auth
Two headers on every call. The marketplace rejects requests without them before they reach the API.
X-RapidAPI-Key: YOUR_KEY
X-RapidAPI-Host: aitext.p.rapidapi.com
Errors
Every failure returns the same envelope, with a requestId you can quote to support.
{ "error": { "code": "INVALID_INPUT", "message": "...", "hint": "..." }, "requestId": "uuid", "timestamp": "ISO-8601" }
11 endpoints
Rank keywords and key phrases from plain text
Single-document TF-IDF: sentences are documents, terms are 1/2/3-grams built from contiguous tokens. Stopwords in twelve languages are removed, dense and repeated phrases rank first. The GET variant accepts up to 8,000 characters because of URL length limits; use POST /v1/keywords for up to 100,000.
| Parameter | In | Type | Description |
|---|---|---|---|
| text | query | string (required) | Plain text to analyse. The GET variant accepts up to 8,000 characters because of URL length limits; POST /v1/keywords accepts up to 100,000. |
| limit | query | integer | Maximum number of keywords to return (1-100). |
curl example
curl -s -X GET 'https://textmind.ayamk.in/v1/keywords' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com'
Rank keywords from a JSON body (up to 100,000 characters)
Same scoring as the GET variant with a larger input limit. Returns the ranked keyword list, document statistics and a truncated flag.
Request body
{
"text": "Solar panels convert sunlight into electricity. Solar panels are cheaper than ever, and solar adoption keeps growing.",
"limit": 20
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/keywords' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "Solar panels convert sunlight into electricity. Solar panels are cheaper than ever, and solar adoption keeps growing.", "limit": 20}'
Extract emails, URLs, phones, dates, money and more
Deterministic regex extraction of eleven entity types with exact [start, end) UTF-16 spans and a confidence per type. No model, no network call. Overlaps are resolved by type priority, so a URL wins over an email embedded in it and a date wins over a phone number shaped like a date. At most 200 entities are returned per request, and at most 50 of any one type, so a wall of URLs cannot crowd out emails.
Request body
{
"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/entities' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."}'
Score sentiment with a curated lexicon (free, deterministic)
Sums word valences from a built-in AFINN-style lexicon and normalises them to [-1, 1]. Negators within two tokens flip and halve a word's valence. Returns per-sentence scores for the first 20 sentences plus the strongest positive and negative tokens. Word lists do not understand sarcasm, irony, emoji or non-English text.
Request body
{
"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/sentiment' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."}'
Detect one of twelve languages with a confidence score
Combines written-script detection (Cyrillic, Arabic, Devanagari, Han) with stopword coverage and character-trigram similarity for the eight Latin-script languages. Returns the best language, a confidence in [0, 1], the top three candidates and the script mix. Short inputs (under about three words) are often unreliable; check isReliable.
Request body
{
"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/detect-language' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."}'
Flesch, Flesch-Kincaid and Gunning fog readability scores
Standard English readability formulas with an estimated syllable count (vowel-group heuristic, no dictionary). Returns Flesch reading ease, Flesch-Kincaid grade, Gunning fog, word/sentence/syllable counts, averages and the longest sentence. Formulas are English-calibrated, so treat other languages as indicative only.
Request body
{
"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/readability' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "We shipped the new billing page on January 12, 2024 and support tickets dropped 38%. Contact billing@acme.io or call +1 415 555 2671. Our IBAN is DE89370400440532013000."}'
List supported stopword lists, or fetch one language
Without lang, returns every supported language with its stopword count. With lang, also returns the full curated list for that language. These are the lists used by keyword extraction and language detection.
| Parameter | In | Type | Description |
|---|---|---|---|
| lang | query | string | Return the stopword list for this language. Omit it to list every supported language with its stopword count. |
curl example
curl -s -X GET 'https://textmind.ayamk.in/v1/stopwords' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com'
Summarise up to 12,000 characters with Llama 3.1 8B
Calls Cloudflare Workers AI. Input is trimmed, split into sentence-aligned chunks of 4,000 characters and summarised; when there is more than one chunk the partial summaries are merged in a final call, so a 12,000 character request uses at most four model calls. Returns the summary, the compression ratio and the model id. Latency is typically 1-3 s and quality depends on the model. Returns 503 AI_UNAVAILABLE when the binding is missing or the model fails.
Request body
{
"text": "Acme reported record revenue in the third quarter, driven by strong demand for its industrial sensors. Margins improved because the company renegotiated component contracts. Management warned that shipping costs may rise next year, and that hiring will slow until the new factory in Ohio opens.",
"maxWords": 80,
"style": "paragraph"
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/summarize' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "Acme reported record revenue in the third quarter, driven by strong demand for its industrial sensors. Margins improved because the company renegotiated component contracts. Management warned that shipping costs may rise next year, and that hiring will slow until the new factory in Ohio opens.", "maxWords": 80, "style": "paragraph"}'
Rewrite text in a chosen tone and return the model's notes
Calls Cloudflare Workers AI (Llama 3.1 8B) and asks for the rewritten text followed by a NOTES section. The notes are the model's own, capped at five lines; if the model ignores the format the notes array is empty and the whole answer is returned as the rewritten text. One model call per request. Returns 503 AI_UNAVAILABLE when the binding is missing or the model fails.
Request body
{
"text": "we got the thing working lol, it was a config typo. gonna ship it tomorrow if nothing explodes",
"tone": "professional"
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/rewrite' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "we got the thing working lol, it was a config typo. gonna ship it tomorrow if nothing explodes", "tone": "professional"}'
Zero-shot classification into 2-20 labels you supply
Calls Cloudflare Workers AI and asks the model for one label plus a score per label, in JSON. Scores are normalised relevance values, not calibrated probabilities: when the model returns no numbers the winning label scores 1 and the rest 0 and scoreSource says "choice-only". Labels the model invents are dropped. Returns 503 AI_UNAVAILABLE when the binding is missing or the model fails.
Request body
{
"text": "My card was charged twice and nobody answered my emails for a week.",
"labels": [
"billing",
"shipping",
"product defect",
"account access",
"other"
]
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/classify' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "My card was charged twice and nobody answered my emails for a week.", "labels": ["billing", "shipping", "product defect", "account access", "other"]}'
Translate up to 2,000 characters between twelve languages
Calls Cloudflare Workers AI with M2M100 (1.2B parameters). Source language is optional: when omitted the built-in detector runs first and the request fails with 400 instead of guessing if the detection is unreliable. One model call per request, typically 1-3 s. Returns 503 AI_UNAVAILABLE when the binding is missing or the model fails.
Request body
{
"text": "Your invoice is attached. Please pay it within 14 days.",
"target": "es",
"source": "en"
}
curl example
curl -s -X POST 'https://textmind.ayamk.in/v1/translate' \
-H 'X-RapidAPI-Key: YOUR_KEY' \
-H 'X-RapidAPI-Host: aitext.p.rapidapi.com' \
-H 'Content-Type: application/json' \
-d '{"text": "Your invoice is attached. Please pay it within 14 days.", "target": "es", "source": "en"}'
Generated from textmind.ayamk.in/openapi.json on 2026-11-22. If the page and the spec ever disagree, the spec is right.