--- name: ai-text-check description: Estimate how much of an English text reads as AI-written, using the AssetFeed AI Detector API. Use when the user asks whether a text, draft or file was written by AI. English only, at least 50 words. --- # AI text check Sends text to the AssetFeed AI Detector and reports the estimated AI-written share. Free check in the browser: https://assetfeed.com/ai-content-detector. API docs: https://assetfeed.com/ai-content-detector/api. ## Requirements - `ASSETFEED_API_KEY` set in the environment. Create a key at https://assetfeed.com/api-keys. Pricing: https://assetfeed.com/pricing. - `curl` and `jq`. - The text is sent to `api.assetfeed.com`. Checks made with an API key are not stored. - English text only, at least 50 words. Shorter or non-English text is not scored. ## Steps 1. Get the text from the user's message or read the file they name. Tell the user the text will be sent to AssetFeed if it is not already clear. 2. Send it: ```bash jq -n --arg text "$TEXT" '{text: $text}' | curl -sS -X POST https://api.assetfeed.com/api/v1/ai-detector/checks \ -H "Authorization: Bearer $ASSETFEED_API_KEY" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d @- ``` For a file, use `jq -n --rawfile text path/to/file '{text: $text}'`. 3. Read the result from the `data` object of the response: - `status`: `ok` when the text was scored. `too_short` means fewer than 50 words. `unsupported_language` means the text is not English. Any other status means the text could not be scored. - `ai_fraction`: estimated AI-written share, from 0 to 1. - `unsure_fraction`: share the detector could not decide. - `verdict`: the overall verdict. - `words`: word count. - `windows`: per-segment results, each with `paragraphs`, `words`, `score` and `verdict`. - `detector_version`. 4. Report `ai_fraction` as a percentage, the `verdict`, and the segments with the highest `score` if the user wants detail. ## Errors - 401: the API key was rejected. - 402: not enough credits. See https://assetfeed.com/pricing. - 429: rate limit exceeded. Wait and retry. ## Reading the result The result is a probabilistic estimate, not proof. Say so when you report it. Do not present it as evidence that a person did or did not write the text, and do not use it alone for decisions about people.