# Ellora Docs: the full documentation > Every page of docs.getellora.com in one file. Each page is also available alone: add index.md to its URL. The index is at https://docs.getellora.com/llms.txt. --- # Ellora Platform API The Ellora Platform API finds the AI-slop patterns in a piece of text. You send it text, and it returns a list of findings. Each finding points at a sentence and explains what matched. The API gives findings only. It never rewrites your text, and it does not give the text a score. If you are new to the API, the [quickstart](https://docs.getellora.com/platform/quickstart/) will walk you through making your first call. Once you have done that, the reference pages describe every field of the request and response. ## Get Started - [Quickstart](https://docs.getellora.com/platform/quickstart/): Create a key and make your first call in about two minutes. - [Authentication](https://docs.getellora.com/platform/authentication/): How to send your API key, and how to keep it safe. ## Guides - [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/): What to send: plain text or Markdown, what is checked, length and what you are charged for. - [Using Findings](https://docs.getellora.com/platform/using-findings/): Recipes: gate a build, rewrite and check again, ignore findings, long documents. - [Reliability](https://docs.getellora.com/platform/reliability/): Which errors to retry, timeouts and charging, response times, rate limit headers and support. - [Credit and Billing](https://docs.getellora.com/platform/credit-and-billing/): How credit works, free credit, adding credit and what happens when it runs out. - [AI Agents](https://docs.getellora.com/platform/ai-agents/): Machine-readable docs, a ready-made tool definition and how an agent should act on findings. ## API Reference - [API Reference](https://docs.getellora.com/platform/api/): Every field of the request and the response, with examples. - [Errors](https://docs.getellora.com/platform/errors/): Each error type, when it happens and what to do about it. - [Rate Limits](https://docs.getellora.com/platform/rate-limits/): The per-key, per-workspace and per-IP limits. ## More - [FAQ](https://docs.getellora.com/platform/faq/): Short answers to common questions. - [Glossary](https://docs.getellora.com/platform/glossary/): Plain definitions of the terms used by the API and these docs. - [Changelog](https://docs.getellora.com/platform/changelog/): What changed in the API and its rules. Source: https://docs.getellora.com/platform/ --- # Quickstart In this guide, you will create an API key and send your first piece of text to the API. There are three steps, and they should take about two minutes. [Watch the whole flow in 2:20: signing up, creating a key, trying the Playground, making your first call and reading the findings.](https://media.getellora.com/platform/deslop-api-workflow-v1.mp4) ## Creating an Account and a Key First, [sign up](https://platform.getellora.com/signup) for an account. You get $5 of free credit, and no card is needed. Once you are signed in, open [API keys](https://platform.getellora.com/keys) in the console and choose **Create key**. Copy the key right away, since it is shown once. You may wish to store the key in an environment variable so that it stays out of your code. ```bash export ELLORA_API_KEY="elk_live_..." ``` ## Sending Text Next, call the API with the text you would like to check. The examples below show how to do this using curl, Python, and JavaScript. **curl** ```bash curl https://platform-api.getellora.com/v1/detect \ -H "Authorization: Bearer $ELLORA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text": "Let'\''s delve into the rich tapestry of modern marketing. It'\''s worth noting that every team must navigate an ever-evolving landscape."}' ``` **Python** ```python import os import requests response = requests.post( "https://platform-api.getellora.com/v1/detect", headers={"Authorization": f"Bearer {os.environ['ELLORA_API_KEY']}"}, json={"text": "Let's delve into the rich tapestry of modern marketing. It's worth noting that every team must navigate an ever-evolving landscape."}, timeout=10, ) response.raise_for_status() result = response.json() print(result["findings_count"]) for finding in result["findings"]: print(finding["severity"], finding["rule_id"], "-", finding["suggestion"]) ``` **JavaScript** ```javascript const response = await fetch("https://platform-api.getellora.com/v1/detect", { method: "POST", headers: { Authorization: `Bearer ${process.env.ELLORA_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ text: "Let's delve into the rich tapestry of modern marketing. It's worth noting that every team must navigate an ever-evolving landscape." }), }); if (!response.ok) throw new Error(`Ellora ${response.status}: ${await response.text()}`); const result = await response.json(); console.log(result.findings_count); for (const finding of result.findings) { console.log(finding.severity, finding.rule_id, "-", finding.suggestion); } ``` ## Reading the Findings Each finding names the rule that matched, the sentence, the matching excerpt, why it reads as machine-written, and a suggestion. The response also includes a `findings_count` object, which counts the findings by severity. The API gives no verdict. If you want a pass or fail rule, you may build it from `findings_count`, for example `findings_count.red === 0`. Yellow findings need a judgment call, and blue findings are optional polish. ```json { "id": "req_01jc8m3y6q0v7k2h9d4x5n8r1t", "words_count": 20, "characters_count": 131, "cost": 0.002, "findings_count": { "total": 8, "red": 5, "yellow": 0, "blue": 3 }, "findings": [ { "id": "01m6ya0a1b2c3d4e5f6g7h8j9k", "rule_id": "ai.delve", "category": "ai", "severity": "red", "scope": "sentence", "sentence": 1, "excerpt": "Let's delve into the rich tapestry of modern marketing.", "reason": "A stock phrase can flatten the writer's meaning.", "suggestion": "use a specific verb: dig, explore, look at" } ], "stored": true } ``` The example above is trimmed to the first of its eight findings. The `cost` field is what this call cost, in US dollars, as a number. Remember, the response has no score and never contains rewritten text. ## Next Steps Now that you have made your first call, you may want to read about [authentication](https://docs.getellora.com/platform/authentication/) and key handling. The [API reference](https://docs.getellora.com/platform/api/) describes every field of the request and response, and the [errors page](https://docs.getellora.com/platform/errors/) explains what to do about each error. The guides cover what to send, how to act on findings, and what to do when a call fails. Source: https://docs.getellora.com/platform/quickstart/ --- # Authentication Every call to the API carries an API key as a bearer token. ```http Authorization: Bearer elk_live_... ``` ## Keys Belong to a Workspace Keys, balance and usage belong to a workspace, not to a person. Admins create and revoke keys in the [console](https://platform.getellora.com/keys); members can use the playground and see usage and balance but not keys. A workspace can hold up to 20 active keys. ## Handling a Key The full key is shown once, when you create it. We store only a hash, so we cannot show it again. If you lose a key, you will need to create a new one. You should call the API from your server. Do not ship a key in a browser or mobile app. Anyone who opens it can spend your balance. It is a good idea to use one key per service or environment and to name it that way. Then, when a key is revoked, the name tells you what to fix. Revoking a key takes effect on the next call. A leaked key should be revoked straight away. ## Failures A missing, unknown or revoked key returns `401 invalid_api_key`. A suspended workspace returns `403 account_suspended`. You may read more about both in the [Errors](https://docs.getellora.com/platform/errors/) documentation. The console itself signs in with an emailed code or link. There are no passwords. Source: https://docs.getellora.com/platform/authentication/ --- # Preparing Your Text You may send plain text or Markdown. This guide explains what the API does with what you send, how long it may be, and what you are charged for. ## Plain Text or Markdown You may send plain text or Markdown, and common HTML tags are understood too. Before it checks anything, the API turns what you sent into plain text. That means a sentence in a bullet, a heading or a bold phrase is checked just like a sentence in a paragraph. Send the text as you have it. You do not need to strip the formatting first, because the API also looks at the formatting itself, such as headings and lists. ## What Is Checked and What Is Skipped | In your text | What the API does | | --- | --- | | Headings, list items and quotes | The words are checked. The markers (`#`, `-`, `1.`, `>`) are removed. | | Bold and italic text | The words are checked. The marks are removed. | | Link text | The words are checked. The address is skipped. | | Table cells | Each cell is checked as its own sentence. | | Words inside common HTML tags | The words are checked. The tags are removed. | | Code, in fenced blocks or inline | Skipped, because code is not prose. | | Web addresses | Skipped. | | Images | Skipped, including the alt text. | | Dividers and HTML comments | Skipped. | | Footnote marks and link definitions | Skipped. | Code that is indented but not fenced is not recognised as code, so its words are checked like any other text. A line that is wrapped in the middle of a sentence is joined to the next one, so a phrase that crosses a line break is still found. ## Sentence Numbers and Excerpts Findings refer to the text after it has been turned into plain text. Sentence 1 is the first sentence of the prose, after any code, divider or comment, and an excerpt is the words of that sentence without any Markdown marks. The API does not return character offsets. To find a finding in your original, search for a few words from its excerpt. ## Length Each request may contain up to 100,000 characters. Characters are Unicode characters, not bytes, so an accented letter or an emoji counts as one. Whitespace at the start and end is removed before the text is checked. Text that is empty, or only whitespace, is rejected with `400 invalid_request`. Text over the limit is rejected with `413 text_too_large`. For a longer document, send it in parts and add up the results. Split it at paragraph breaks, so that no sentence is cut in two. Each part is a separate call. Sentence numbers start again at 1 in every part. Findings about the text as a whole (scope `document`) are reported for each part, not for the whole document. ```python def split_text(text: str, limit: int = 100_000) -> list[str]: parts, current = [], "" for paragraph in text.split("\n\n"): if len(paragraph) > limit: raise ValueError("A paragraph is longer than the limit; split it at a sentence.") if current and len(current) + len(paragraph) + 2 > limit: parts.append(current) current = "" current = f"{current}\n\n{paragraph}" if current else paragraph if current: parts.append(current) return parts ``` ## Language The API supports English text only. Other languages are not supported. ## What You Are Charged For You are charged for the words in what you send, before it is turned into plain text. So the words in code, links and markup count too, even though they are skipped when the text is checked. If you do not want to pay for them, remove them before you send. The [API Reference](https://docs.getellora.com/platform/api/) has the exact rule for counting words. You can work out the cost before you send. The price is $0.10 per 1,000 words, and the API rounds the cost up to the next micro-dollar. This counting rule matches the API's for English text. **Python** ```python PRICE_PER_1000_WORDS = 0.10 # US dollars def count_words(text: str) -> int: """Counts words the way the API charges for them (for English text).""" return sum(1 for piece in text.split() if any(ch.isalnum() for ch in piece)) def estimate_cost(text: str) -> float: return count_words(text) / 1000 * PRICE_PER_1000_WORDS ``` **JavaScript** ```javascript const PRICE_PER_1000_WORDS = 0.10; // US dollars // Counts words the way the API charges for them (for English text). const countWords = (text) => text.split(/\s+/).filter((piece) => /[\p{L}\p{N}]/u.test(piece)).length; const estimateCost = (text) => (countWords(text) / 1000) * PRICE_PER_1000_WORDS; ``` Source: https://docs.getellora.com/platform/preparing-your-text/ --- # Using Findings The API returns findings and leaves the decisions to you. These recipes show common ways to act on them. ## Deciding What Passes The API gives no verdict, so the rule for what passes is yours to write. A simple rule is that a text passes when `findings_count.red` is `0`. Treat yellow findings as a prompt for a judgment call, and blue findings as optional polish. This script checks a file and fails when it has a red finding, so you can run it in your CI. Keep the key in a secret, and a non-zero exit code will fail the build. ```python import os import sys import requests with open(sys.argv[1], encoding="utf-8") as file: text = file.read() response = requests.post( "https://platform-api.getellora.com/v1/detect", headers={"Authorization": f"Bearer {os.environ['ELLORA_API_KEY']}"}, json={"text": text}, timeout=10, ) response.raise_for_status() red = [f for f in response.json()["findings"] if f["severity"] == "red"] for finding in red: where = f"sentence {finding['sentence']}" if finding["sentence"] else "the text as a whole" print(f"{where}: {finding['reason']}\n Suggestion: {finding['suggestion']}") sys.exit(1 if red else 0) ``` Run it with `python check_text.py draft.md`. ## Rewriting and Checking Again The API never rewrites your text. To improve a draft, send it, rewrite the sentences that have red findings, by hand or with your own tool, and send it again. Each finding gives you the `excerpt` to change, the `reason` it was flagged, and a short `suggestion`. The suggestion is a hint, not a replacement sentence. Stop when `red` is `0`, or after a fixed number of passes. Each pass is a call, and every call is charged. ```python text = open("draft.md", encoding="utf-8").read() for attempt in range(3): result = check(text) # sends the text to the API and returns the response if result["findings_count"]["red"] == 0: break text = rewrite(text, result["findings"]) # your own step, by hand or with an LLM ``` ## Findings You Disagree With You cannot switch checks off for an API key, so every call runs the same checks. If a finding does not suit your text, filter it in your own code. Each finding has a stable `rule_id`, so you can keep a list of the ones you accept. ```javascript const ignored = new Set(["ai.delve"]); // rule IDs you have decided to accept const findings = result.findings.filter((finding) => !ignored.has(finding.rule_id)); const red = findings.filter((finding) => finding.severity === "red").length; ``` The counts in `findings_count` include every finding, so count the ones you keep yourself. The last line above does this. ## Long Documents A document over the length limit has to be sent in parts. Split it at paragraph breaks, check each part, and add up the counts. Splitting does not change the price, because you are charged by words. [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/) has a function that splits a document for you. ## Staying Under the Rate Limit Each API key may make 60 requests per minute, and all the keys in a workspace share a limit of 300. To stay under the limit of one key, send at most one request a second. If you reach a limit anyway, the API answers `429` with a `Retry-After` header. [Reliability](https://docs.getellora.com/platform/reliability/) shows how to wait and try again. ## Estimating Cost You can work out what a call will cost before you send it. [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/) has a short function for it, in Python and JavaScript. Source: https://docs.getellora.com/platform/using-findings/ --- # Reliability This guide covers what to do when a call does not go as planned. It explains which errors to retry, what a timeout costs, and where to get help. ## Which Errors to Retry In short, retry a `429` and a `500`, and nothing else until you have changed something. Every other error will fail the same way if you send the request again. | Status | type | Retry? | | --- | --- | --- | | 400 | `invalid_request` | No. Fix the request first. | | 401 | `invalid_api_key` | No. Send a valid key. | | 402 | `insufficient_credit` | After you add credit. | | 403 | `account_suspended` | No. Contact support. | | 404 | `not_found` | No. Fix the URL. | | 413 | `text_too_large` | No. Split the text first. | | 429 | `rate_limited` | Yes, after the Retry-After delay. | | 500 | `internal_error` | Yes. Wait a moment first. | ## Retrying Safely For a `429`, wait the number of seconds in the `Retry-After` header. For a `500`, wait a moment and try again, a little longer each time. Add a little random jitter, so that several workers do not retry at the same instant, and give up after a few tries. ```python import os import random import time import requests URL = "https://platform-api.getellora.com/v1/detect" HEADERS = {"Authorization": f"Bearer {os.environ['ELLORA_API_KEY']}"} def detect_with_retries(text: str, attempts: int = 4) -> dict: for attempt in range(attempts): try: response = requests.post(URL, headers=HEADERS, json={"text": text}, timeout=10) except (requests.ConnectionError, requests.Timeout): # No answer. The call may still have finished and been charged, so retry sparingly. response = None if response is not None: if response.status_code == 200: return response.json() if response.status_code == 429: wait = int(response.headers.get("Retry-After", 5)) elif response.status_code == 500: wait = 2**attempt else: response.raise_for_status() # 400, 401, 402, 403, 413: sending it again cannot help else: wait = 2**attempt time.sleep(wait + random.random()) # a little jitter, so parallel workers do not retry together raise RuntimeError("The API did not answer after several tries.") ``` ## Timeouts and Charging Set your client's timeout to at least 10 seconds. If your client gives up before the answer arrives, the call may still have finished and been charged. There is no idempotency key. A call you send again is a new call, and it is charged again. Keep your timeouts generous, and retry after a timeout only when a second charge would not matter. ## How Long Calls Take We do not publish a response-time commitment. In our own tests the checking itself takes a fraction of a second, even for a text at the limit of 100,000 characters. Use a timeout of at least 10 seconds. ## Rate Limit Headers Every successful response carries two headers. `X-RateLimit-Limit` is the number of requests per minute your API key may make. `X-RateLimit-Remaining` is how many that key has left in the current minute. These headers describe the limit of your key only. The limit of your workspace (300 requests per minute) and the limit of your IP address (120 per minute) are not counted in them, so a `429` can arrive while `X-RateLimit-Remaining` is above zero. A `429` always carries a `Retry-After` header. ## Calling From a Browser The API does not send CORS headers, so a browser cannot call it directly. Call it from your server. That also keeps your key out of the page, which is where it must stay. ## Testing Without a Sandbox There is no sandbox and there are no test keys. Every key, which starts with `elk_live_`, makes real calls. Your free credit of $5 covers about 50,000 words, and it is your test budget. The playground in the console lets you try a text without writing any code. It spends credit in the same way. ## Versioning The URLs of the API carry a version, such as `/v1`. A change that could break your code is released under a new version prefix, so code written against `/v1` is not changed by it. New fields can be added to a response at any time, so your code should ignore the fields it does not use. Every change is listed in the [Changelog](https://docs.getellora.com/platform/changelog/). ## Getting Help Email [support@getellora.com](mailto:support@getellora.com). Include the request ID, which is the `X-Request-Id` header or the `request_id` in an error, and what you expected to happen. Please do not send the text itself unless we ask for it. Source: https://docs.getellora.com/platform/reliability/ --- # Credit and Billing The API is prepaid. This guide explains how credit works, how it is spent, and what happens when it runs out. ## How Credit Works Credit belongs to your workspace, and everyone in the workspace shares it. Each call that succeeds spends credit according to the number of words in the text, at $0.10 per 1,000 words. [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/) explains how words are counted. A request that is rejected costs nothing, and a call that fails with a `500` error is refunded automatically. ## Free Credit A new account gets $5 of credit once. It is applied to the first workspace created at signup, and it covers about 50,000 words. ## Adding Credit A workspace admin adds credit in the console, on the Billing page, with Add credit. You may choose any amount from $5. There are no fixed packs, and credit does not expire. Each payment has a receipt, which you will find on the Billing page. You receive credit equal to the amount you choose. Tax, where it applies, is added at checkout and does not change the credit. The [Pricing and Credits](https://getellora.com/platform/#pricing) page says whether paid top-ups are open yet. ## When Your Balance Runs Out When the balance is too low for a request, the API answers `402 insufficient_credit` and charges nothing. Sending the request again does not help until credit has been added. The console shows how many words are left, and it warns you before the balance runs out. Only admins can add credit, so a member who sees the warning should ask an admin. The message in the `402` includes a link to the Billing page. ## Seeing What You Spent The Billing page lists everything that changed the balance: free credit, top-ups, usage and refunds. Admins and members can both see the balance and the list. ## Questions About a Payment If you have a question about a payment, email [support@getellora.com](mailto:support@getellora.com), and include the receipt or the request ID. Source: https://docs.getellora.com/platform/credit-and-billing/ --- # AI Agents This page is for AI agents and for the people who build them. It lists the machine-readable files, shows how to give an agent the API as a tool, and explains how an agent should act on the results. ## Machine-Readable Docs Every page of these docs is available in a form an agent can read without a browser. - [/llms.txt](https://docs.getellora.com/llms.txt) is an index of every page, with the base URL and how to authenticate. - [/llms-full.txt](https://docs.getellora.com/llms-full.txt) has all of the documentation in one file. - Every page is also Markdown. Add `index.md` to its URL, for example [/platform/quickstart/index.md](https://docs.getellora.com/platform/quickstart/index.md). - [/platform/openapi.json](https://docs.getellora.com/platform/openapi.json) is the OpenAPI file, with examples for the request, the response and every error. - [/platform/limits.json](https://docs.getellora.com/platform/limits.json) has the limits, the price and the errors as JSON, including which errors can be retried. ## How an Agent Should Use the API 1. Check that the text is English and under the limit of 100,000 characters, and work out what it will cost. [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/) has a function for that. 2. Send the text to the API. 3. Read `findings_count`. If `red` is `0`, the text passes and you may stop. Yellow findings need a judgment call, so follow the rule you were given or ask the person. 4. Otherwise, rewrite the sentences that have red findings. The `excerpt` shows the sentence, and the `reason` and `suggestion` are hints. Change only what the findings point at. 5. Send the new text. Stop when `red` is `0`, or after a fixed number of passes, three being a sensible limit, and tell the person what is left. 6. Handle errors as [Reliability](https://docs.getellora.com/platform/reliability/) describes. Retry a `429` and a `500`, and nothing else. ## Giving an Agent the API as a Tool Most agent frameworks take a tool as a name, a description and a schema for its input. This definition is ready to use with the Anthropic API. ```json { "name": "check_text_for_ai_slop", "description": "Checks English text for AI-slop patterns and returns findings, each with a severity (red, yellow or blue), the sentence it is about, an excerpt, a reason and a short suggestion. It never rewrites the text and gives no score. Use it on a draft before you show it to the person: fix every red finding, then check again.", "input_schema": { "type": "object", "properties": { "text": { "type": "string", "description": "The English text to check, as plain text or Markdown. Up to 100,000 characters." } }, "required": [ "text" ] } } ``` This is the same tool for the OpenAI API. ```json { "type": "function", "function": { "name": "check_text_for_ai_slop", "description": "Checks English text for AI-slop patterns and returns findings, each with a severity (red, yellow or blue), the sentence it is about, an excerpt, a reason and a short suggestion. It never rewrites the text and gives no score. Use it on a draft before you show it to the person: fix every red finding, then check again.", "parameters": { "type": "object", "properties": { "text": { "type": "string", "description": "The English text to check, as plain text or Markdown. Up to 100,000 characters." } }, "required": [ "text" ] } } } ``` When the model calls `check_text_for_ai_slop`, your code sends the text to the API and returns the result. The function below keeps only the fields an agent needs, which saves space in its context. ```python # detect_with_retries is the function from the Reliability guide. def check_text_for_ai_slop(text: str) -> dict: result = detect_with_retries(text) return { "counts": result["findings_count"], "findings": [ {key: finding[key] for key in ("severity", "sentence", "excerpt", "reason", "suggestion")} for finding in result["findings"] ], "cost_usd": result["cost"], } ``` ## Keeping the Key Safe Keep the API key in the environment of the code that runs the tool. Never put it in a prompt, a tool description or a log. The API never echoes your text back in an error, so a failed call does not leak it either. ## Controlling Cost Every pass is charged by the words in the text, so a loop with no limit has no limit on cost either. Give the agent a maximum number of passes. A `402 insufficient_credit` means the workspace is out of credit. Stop, and tell the person, because sending the request again will not help. [Credit and Billing](https://docs.getellora.com/platform/credit-and-billing/) explains how credit works. Source: https://docs.getellora.com/platform/ai-agents/ --- # API Reference The API has one endpoint. This page describes every field you may send to it and every field it returns. ## `POST /v1/detect` Detect AI slop patterns in text. The base URL is `https://platform-api.getellora.com`, and you should authenticate with a [bearer API key](https://docs.getellora.com/platform/authentication/). The API supports English text only. Other languages are not supported. Each request is charged by its length in words. To work out the cost, divide the number of words by 1,000, then multiply the result by the price per 1,000 words, rounding up to the next micro-dollar. Rejected requests are never charged, and a request that fails with a 500 error is refunded. To count the words in your text, the API splits it on whitespace, such as a space, a tab or a line break. A piece counts as one word if it contains at least one letter or digit. Bare punctuation, such as a dash or an ellipsis, is not counted. So "don't", "well-known", "3.14" and a URL are one word each, and "Hello, world!" is two. For what to send and how it is read, see [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/). For what to do when a call fails, see [Reliability](https://docs.getellora.com/platform/reliability/). ## Request ### Definition The request body is JSON. | Field | Type | Description | | --- | --- | --- | | `text` | `string` | Required. The English text to check, as plain text or Markdown. Characters are Unicode characters, not bytes. Empty or whitespace-only text is rejected, and whitespace at the start and end is removed. Up to 100,000 characters. | ### Example **curl** ```bash curl https://platform-api.getellora.com/v1/detect \ -H "Authorization: Bearer $ELLORA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text": "Let'\''s delve into the rich tapestry of modern marketing. It'\''s worth noting that every team must navigate an ever-evolving landscape."}' ``` **Python** ```python import os import requests response = requests.post( "https://platform-api.getellora.com/v1/detect", headers={"Authorization": f"Bearer {os.environ['ELLORA_API_KEY']}"}, json={"text": "Let's delve into the rich tapestry of modern marketing. It's worth noting that every team must navigate an ever-evolving landscape."}, timeout=10, ) response.raise_for_status() result = response.json() print(result["findings_count"]) for finding in result["findings"]: print(finding["severity"], finding["rule_id"], "-", finding["suggestion"]) ``` **JavaScript** ```javascript const response = await fetch("https://platform-api.getellora.com/v1/detect", { method: "POST", headers: { Authorization: `Bearer ${process.env.ELLORA_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ text: "Let's delve into the rich tapestry of modern marketing. It's worth noting that every team must navigate an ever-evolving landscape." }), }); if (!response.ok) throw new Error(`Ellora ${response.status}: ${await response.text()}`); const result = await response.json(); console.log(result.findings_count); for (const finding of result.findings) { console.log(finding.severity, finding.rule_id, "-", finding.suggestion); } ``` ## Response ### Definition A successful call answers `200` with a JSON body. | Field | Type | Description | | --- | --- | --- | | `id` | `string` | The ID of this call. It is the same as the `X-Request-Id` response header. | | `words_count` | `integer` | The number of words in your text, counted the way you are charged. | | `characters_count` | `integer` | The number of characters in your text. | | `cost` | `number` | What this call cost, in US dollars, exact to the micro-dollar. | | `findings_count` | `object` | How many findings were found, in total and by severity. | | `findings` | `Finding[]` | The findings, one for each pattern found in your text. Findings about the whole text come first, then the others in the order they appear in the text. | | `stored` | `boolean` | True when the text and findings of this call were stored (the default). False under Zero Data Retention, or if storing failed (the call is still answered and charged). | Response headers: `X-Request-Id`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`. #### `findings_count` | Field | Type | Description | | --- | --- | --- | | `total` | `integer` | The number of findings of every severity. | | `red` | `integer` | The number of findings with severity `red`. | | `yellow` | `integer` | The number of findings with severity `yellow`. | | `blue` | `integer` | The number of findings with severity `blue`. | #### `Finding` | Field | Type | Description | | --- | --- | --- | | `id` | `string` | A ULID. When the call is stored, it is the id of the stored finding. | | `rule_id` | `string` | The ID of the rule that matched. Use it to identify the rule: a rule ID is never renamed or removed within a major version. | | `category` | `string` | The group the rule belongs to, such as `ai`. | | `severity` | `"red" \| "yellow" \| "blue"` | How serious the finding is. `red`: fix before publishing. `yellow`: needs a judgment call. `blue`: optional polish. | | `scope` | `"document" \| "sentence"` | What the finding is about. `document`: the text as a whole (it has no sentence). `sentence`: one sentence. Paragraph and word scopes are reserved. | | `sentence` | `integer \| null` | The 1-based number of the sentence, counted after Markdown is converted to plain text. Null for a document finding. | | `excerpt` | `string \| null` | The full text of the sentence the finding is about, not only the matched words. Null for a document finding. The API does not return character offsets. | | `reason` | `string` | Why it is flagged. Explanatory, and the same sentence can repeat across findings of a kind. | | `suggestion` | `string` | A short fragment ("use a specific verb"), not a full sentence. | ### Example ```json { "id": "req_01jc8m3y6q0v7k2h9d4x5n8r1t", "words_count": 20, "characters_count": 131, "cost": 0.002, "findings_count": { "total": 8, "red": 5, "yellow": 0, "blue": 3 }, "findings": [ { "id": "01m6ya0a1b2c3d4e5f6g7h8j9k", "rule_id": "ai.delve", "category": "ai", "severity": "red", "scope": "sentence", "sentence": 1, "excerpt": "Let's delve into the rich tapestry of modern marketing.", "reason": "A stock phrase can flatten the writer's meaning.", "suggestion": "use a specific verb: dig, explore, look at" } ], "stored": true } ``` The example is trimmed to the first of its eight findings. The `cost` field is what this call cost, in US dollars, as a number. ## Status Codes | Status | Meaning | | --- | --- | | 200 | Findings returned. | | 400 | `invalid_request`, see [Errors](https://docs.getellora.com/platform/errors/) | | 401 | `invalid_api_key`, see [Errors](https://docs.getellora.com/platform/errors/) | | 402 | `insufficient_credit`, see [Errors](https://docs.getellora.com/platform/errors/) | | 403 | `account_suspended`, see [Errors](https://docs.getellora.com/platform/errors/) | | 413 | `text_too_large`, see [Errors](https://docs.getellora.com/platform/errors/) | | 429 | `rate_limited`, see [Errors](https://docs.getellora.com/platform/errors/) | | 500 | `internal_error`, see [Errors](https://docs.getellora.com/platform/errors/) | You may also download the raw OpenAPI file as [openapi.json](https://docs.getellora.com/platform/openapi.json). Source: https://docs.getellora.com/platform/api/ --- # Errors Errors use a single JSON shape and a stable type string. You should match on type, not on the message. ```json { "error": { "type": "insufficient_credit", "message": "Not enough credit for this request. Add credit to continue: https://platform.getellora.com/01jc8m2w5r3x9t7q4k6n0b8d2f/billing", "request_id": "req_01jc8m3y6q0v7k2h9d4x5n8r1t" } } ``` Every response, success or failure, carries an `X-Request-Id` header with the same value. Be sure to quote it when you contact support. Error bodies never echo the text you sent. | Status | type | When | What to do | | --- | --- | --- | --- | | 400 | `invalid_request` | The body is not JSON, or "text" is missing, empty or not a string. | Send {"text": "..."} with Content-Type: application/json. | | 401 | `invalid_api_key` | The key is missing, unknown or revoked. | Send Authorization: Bearer . Create a key in the console. | | 402 | `insufficient_credit` | The workspace's balance is below this request's cost. | Add credit in the console. Nothing is charged for the failed request. | | 403 | `account_suspended` | The workspace is suspended. | Contact support@getellora.com. | | 404 | `not_found` | The URL does not exist. | Check the URL against the API Reference. | | 413 | `text_too_large` | "text" is longer than 100,000 characters. | Split the document and send it in parts. | | 429 | `rate_limited` | A per-key, per-workspace or per-IP limit was reached. | Wait for the number of seconds in the Retry-After header, then retry. | | 500 | `internal_error` | Something failed on our side. | Retry. You are not charged for a failed request. Quote the request_id if you contact us. | Only a `429` and a `500` can be sent again as they are. [Reliability](https://docs.getellora.com/platform/reliability/) explains how to retry them safely. ## Wrong Method A request with the wrong HTTP method answers `405`, with an `Allow` header that names the method to use. ## Charging and Failures A request is charged only when it succeeds. Requests rejected before processing (400, 401, 403, 413, 429) cost nothing, and a 500 is refunded automatically. Source: https://docs.getellora.com/platform/errors/ --- # Rate Limits Rate limits make sure no single caller can crowd out the others. They are per minute and counted per key and per workspace. | Scope | Limit | | --- | --- | | Per API key | 60 requests per minute | | Per workspace (all keys together) | 300 requests per minute | | Per IP address, before authentication | 120 requests per minute | | Text per request | 100,000 characters | ## When You Hit a Limit The response is `429 rate_limited` with a `Retry-After` header in seconds. Successful responses also carry `X-RateLimit-Limit` and `X-RateLimit-Remaining`, which describe the limit of your API key only. You should wait for `Retry-After`, then retry. If several workers share a key, you may wish to add jitter. The [Reliability](https://docs.getellora.com/platform/reliability/) guide explains these headers and shows how to retry safely. If you need higher limits, email [support@getellora.com](mailto:support@getellora.com) with your expected volume. Source: https://docs.getellora.com/platform/rate-limits/ --- # FAQ ## What does the API do? The API checks text against a library of patterns that tend to make writing read as machine-generated, such as stock phrases, formulaic structures and uniform rhythm. For each match, it returns a finding with a reason and a suggestion. ## Does the API rewrite my text? No. The API returns findings only. You may rewrite the text with your own tool or by hand, and then call the API again to check the result. ## Does the API give a score or say who wrote my text? No. The API reports which patterns are present. It does not say who or what wrote the text, and a clean result is not a statement about authorship. ## Do you store my text? By default, yes. The text and the findings of each call are stored encrypted for 365 days, and only your workspace admins can read them. Admins can delete any of it at any time, and they may switch on Zero Data Retention so that nothing is stored. The text is never written to logs. You may read more on the [Privacy](https://getellora.com/legal/platform/privacy/) page. ## Do you learn from my text? We may. By default, we may learn from the text and findings of stored calls. A workspace admin can switch learning off in the console, and under Zero Data Retention nothing is stored, so there is nothing to learn from. ## What is Zero Data Retention? Zero Data Retention is a workspace setting. With it on, the text and findings of your calls are not stored, so nothing is learned from them. We still keep counts and metadata for billing. ## How much does the API cost? The API is prepaid at $0.10 per 1,000 words, and you get $5 of free credit at signup. [Credit and Billing](https://docs.getellora.com/platform/credit-and-billing/) explains how credit works. ## How are words counted? The API splits your text on whitespace, and a piece counts as one word if it contains at least one letter or digit. The [API Reference](https://docs.getellora.com/platform/api/) has the details. ## Am I charged when a request fails? No. Rejected requests are never charged, and a request that fails with a 500 error is refunded. See [Errors](https://docs.getellora.com/platform/errors/) for each status. ## How long can my text be? Each request may contain up to 100,000 characters. If you have a longer document, you should split it. ## Can I send Markdown? Yes. You may send plain text or Markdown, and the API turns it into plain text before it checks it. [Preparing Your Text](https://docs.getellora.com/platform/preparing-your-text/) explains what is checked and what is skipped. ## Can I call the API from a browser? No. The API does not send CORS headers, so a browser cannot call it directly. Call it from your server. See [Reliability](https://docs.getellora.com/platform/reliability/). ## Is there a test mode? No. There is no sandbox and there are no test keys, and every call is real. Your free credit is your test budget, and the playground in the console lets you try a text without writing code. ## Which languages does the API support? The API supports English text only. Other languages are not supported. ## Are rule IDs stable? Yes. A rule ID is never renamed or removed within a major version, so you can store IDs and suppress or route on them. ## Can my team share an account? Yes. You may invite people to your workspace, and they share one balance and one set of keys, with admin and member roles. ## Is there an SDK? Not yet. The API is a single JSON endpoint, and the [Quickstart](https://docs.getellora.com/platform/quickstart/) has curl, Python and JavaScript examples. Source: https://docs.getellora.com/platform/faq/ --- # Glossary These are the terms you will meet in the Ellora Platform API and in its documentation, in alphabetical order. ## AI Slop AI slop is the set of patterns that make writing read as machine-generated, such as stock phrases, formulaic structures and uniform rhythm. The API reports which patterns are present in your text. It does not say who or what wrote the text. ## API Key An API key identifies your workspace when you call the API. You send it as a bearer token in the `Authorization` header. The full key is shown once, when you create it. See [Authentication](https://docs.getellora.com/platform/authentication/). ## Console The console is the web app where you create API keys, try the playground, see your usage and billing, and manage the members of your workspace. ## Credit Credit is the prepaid money in your workspace. Each call that succeeds spends credit according to its length in words. If your balance is too low for a request, the API answers `402 insufficient_credit`. ## Excerpt An excerpt is the full text of the sentence a finding is about, not only the matched words. A document finding has no excerpt. ## Finding A finding is one pattern the API found in your text. It names the rule that matched, the sentence, the matching excerpt, why it reads as machine-written, and a suggestion. ## Findings Count The `findings_count` object in a response counts the findings, in total and by severity. ## Micro-dollar A micro-dollar is one millionth of a US dollar. The cost of a call is rounded up to the next micro-dollar. ## Rate Limit A rate limit caps how many requests you may send per minute. There are limits per API key, per workspace and per IP address. When you reach one, the API answers `429 rate_limited` with a `Retry-After` header. See [Rate Limits](https://docs.getellora.com/platform/rate-limits/). ## Request ID The request ID identifies one call. It is the `id` in the response body and the `X-Request-Id` header. You should quote it when you contact support. ## Rule A rule is a pattern the API looks for in text, such as a stock phrase or a formulaic structure. Every finding comes from one rule. ## Rule ID A rule ID names a rule, and the API returns it as `rule_id` in each finding. A rule ID is never renamed or removed within a major version, so you may store it and suppress or route on it. ## Scope The scope of a finding says what it is about. It is `sentence` for one sentence, or `document` when the finding is about the text as a whole. ## Severity The severity of a finding is `red` (fix before publishing), `yellow` (needs a judgment call) or `blue` (optional polish). ## Stored In a response, `stored` is true when the text and findings of the call were stored. By default they are stored encrypted for 365 days. Under Zero Data Retention, they are not stored. ## Word A word is the unit you are charged by. The API splits your text on whitespace, and a piece counts as one word if it contains at least one letter or digit. See the [API Reference](https://docs.getellora.com/platform/api/). ## Workspace A workspace owns your credit, API keys and usage. People in a workspace share one balance and one set of keys, with admin and member roles. ## Zero Data Retention Zero Data Retention is a workspace setting. With it on, the text and findings of your calls are not stored, so nothing is learned from them. We still keep counts and metadata for billing. Source: https://docs.getellora.com/platform/glossary/ --- # Changelog You will find every change to the API and its rules on this page. Breaking changes get a new version prefix. Additions land here first. ## Launch At launch, the API checks your text against 246 rules. You can also use the console, which launched with API keys, a playground, usage, a billing view and workspace members. A rule ID the API returns is never renamed or removed within a major version. If you rely on a rule, you will see it listed here when it is retired, before it stops matching. Source: https://docs.getellora.com/platform/changelog/