← All articles

AI detection

How to Add AI Text Detection to Your App with the DetectInk API

If a teacher or editor asks why a passage needs a closer look, your app should be able to show the passage. Choosing the right request mode gives you both the overall AI rate and the sentences behind it.

The short answer

Send the text to POST /api/v1/detect with an API key and set mode to sentences. One response includes the overall AI rate, a verdict, a score for each sentence, and the credits charged. If you leave out the mode, DetectInk uses document and returns the overall result without sentence scores. Only prepaid credit-pack credits work with the API.

Make your first detection request

  1. Create a key. Open API keys in your Wofo Ink workspace. Keep the key on your server rather than in code sent to a reader’s browser. You can revoke a key in the workspace if it’s exposed.
  2. Prepare the text. The minimum is 50 words, or 120 characters for Chinese, Japanese or Korean. The developer page lists a limit of 5,000 credits per request. If someone selects a passage that’s too short, ask for more text rather than adding unrelated material to reach the minimum.
  3. Send a JSON request. Set Content-Type to application/json and send the key in the Authorization header as a Bearer token. Put the passage in the text field and your choice of mode in mode. An optional title appears in your history. The developer page has request examples you can copy.

What the response fields are for

Response fieldHow to use it in your app
ai_rate and verdictShow the overall estimate and its summary label. Keep the detector’s verdict separate from the reviewer’s decision.
sentencesIn sentences mode, each entry has text, start, end and its own ai_rate. Use these to show the score beside the sentence it describes.
id, model and modeIdentify the check, the reported DetectInk version and the mode used. Check the mode before trying to display sentence results.
wordsShow the word count for the text that was checked, especially if the user selected only part of a document.
credits_charged and credits_remainingRecord the cost of this request and the balance left after it. Keep billing details in the account view rather than the writer’s report.

Attach highlights to the version of the text you submitted. If an editor moves a paragraph while the request is running, the original start and end positions may now point to a different passage. Display the checked version, or tell the editor the draft has changed. Don’t place an old score beside new wording.

How API credits and pricing work

The pricing page lists prepaid packs including 100K credits for $4.99 and 400K credits for $19.99. Pack credits never expire and can also be used on the web and in the apps. The reverse doesn’t apply: sign-up credits and credits included with a plan can’t pay for API requests. Buying DetectInk Pro alone won’t fund your integration.

Check the actual charge before quoting a per-document price. Sentences mode costs more than document mode, which returns only the overall result. The developer page lists the current rates, and every response reports credits_charged.

To budget for a rollout, test the mode you plan to offer on a passage typical of your app. Read credits_charged from the response rather than calculating the bill from words. To check the available API balance without running another detection request, send GET /api/v1/balance with the same Bearer token and read credits_remaining.

Where sentence scores belong in a review workflow

Learning platforms. Put the marked passage beside the assignment instructions, not beside an automatic grade deduction. Give the teacher a way to ask about a particular sentence and the student a place to explain an edit or share an earlier draft. For help text on that screen, link to how to read a sentence-level detection report.

Publishing workflows. Let an editor open the checked draft from the submission list and read a marked sentence in context. A quote from an interview and a paragraph supplied by the author raise different editorial questions. Give the editor a way to ask about the passage without sending the author a rejection notice.

Moderation queues. Show the post, its sentence scores and the rule a moderator is being asked to apply. A score is not a finding that the author broke that rule. Let the moderator dismiss the item or ask for context; don’t remove a post or suspend an account because its AI rate crosses a threshold.

Handle a failed check without assigning a score

Give your interface a distinct “Not checked” state. A missing result is neither a low AI rate nor a reason to hold a student responsible for a failed submission. Use the error code to send the next step to the person who can fix it.

  • 400: input problem. For too_short or too_long, explain the length requirement. For unsupported_language, explain which languages the app can check. Don’t silently truncate a submission and label the result as a check of the whole document.
  • 401 or 403: access problem. A missing or invalid key returns 401; a disabled account returns 403. Alert the integration owner. Asking the writer to revise the passage won’t resolve either issue.
  • 402: insufficient_credits. Ask the account owner to check the credit-pack balance. Preserve the draft so the writer doesn’t have to submit it again just because the app ran out of credits.

Questions

Why didn’t the DetectInk API return sentence scores?

Check the mode in the response. The default is document, which gives the overall result only. Set mode to sentences when sending the text; you don’t need a separate request for each sentence.

Which languages does the detection API support?

DetectInk accepts Chinese, English, Japanese, Korean, Spanish, French, German, Portuguese, Italian, Russian, Arabic and Indonesian.

Can I use free DetectInk credits to test the API?

No. Sign-up and plan credits are for the web and the apps. To test an authenticated detection request, use credits from a prepaid pack.

Start with a sample passage. Compare the overall result, the sentence scores and the reported charge before connecting the check to a live review queue.

Open the API docs

Related articles

AI detectionSigns of AI Writing: What Readers Notice and Why They Can Be WrongGeneric phrases, even rhythm, missing detail, and hedged conclusions can make writing sound like AI. Learn what those signs tell you and what they don’t.AI detectionHow to Check Your Essay Before Submitting ItAn essay checklist for checking the prompt, testing phrases, reviewing grammar fixes, reading AI flags and catching mistakes in the file you submit.AI detectionDetectInk vs GPTZero: Which AI Detector Is More Accurate on Edited Text?We ran DetectInk and GPTZero on 300 essays, including 100 human essays partly rewritten by AI. Accuracy, sentence-level results, RAID scores and price, side by side.

Your writing workspace

Explore English usage, check grammar, and detect AI-written text in one place.

Open workspace