LookAI
← Blog
Engineering 2 min read

Add AI detection to your app in an afternoon

A practical guide to building AI text detection into a learning platform, a hiring tool or a publishing workflow, from the first request to showing results your users can trust.

Most teams that need AI detection do not want a separate tool. They want a score next to the essay in their LMS, a flag on a job application, or a check before an article goes live. This guide walks through building that with the LookAI API.

1. Get a key and make one request

Create an account, open the dashboard and create an API key. Then send a text:

curl -X POST https://lookai.io/v1/analyze \
  -H "Authorization: Bearer $LOOKAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Paste the text to check here..."}'

The response arrives in the same request, usually within a few seconds, with a predicted_class, a score, a confidence level and every sentence with its character offsets.

2. Call it from your server, never the browser

Your API key identifies your account and is charged for usage. Keep it on your backend, and have your frontend call your own endpoint, which then calls LookAI. That also lets you add your own access rules, caching and logging.

Set your HTTP timeout to at least 120 seconds. Most requests take one to five seconds, but long files and the first request after a quiet period can take longer.

3. Send files directly

If your users upload documents, you do not need to extract the text yourself. Send the file base64-encoded with its name:

{ "file": "JVBERi0xLjcK...", "filename": "essay.pdf" }

PDF, DOCX, TXT and Markdown files up to 10 MB are supported, and the response has the same shape as for text.

4. Show results people can act on

How you present a result matters as much as the result itself. A few patterns that work well:

  • Lead with the class, not the number. "Inconclusive, review recommended" is easier to act on than "52.4".
  • Highlight passages, not sentences. Use the highlight flag on each sentence. It is only set for runs of at least two sentences, so you will not light up random lines.
  • Show the confidence. When confidence is low, say so plainly and suggest a human review.
  • Store the model_version. If a result is ever questioned, you can tell exactly which model produced it.

5. Handle errors and limits

Every error returns a JSON body with a code. The ones worth handling explicitly:

Code What to do
invalid_text The text is under 30 words or the file cannot be read. Tell the user.
plan_required The free allowance is used up. Choose a plan in the dashboard.
rate_limited Wait for the seconds in Retry-After, then retry.
analysis_failed, timeout Retry with a growing delay. Nothing was charged.

6. Ship it inside your product

You are allowed to build LookAI into your own product and show results to your own customers, including products you sell. You do not need a separate agreement. The only thing that is not allowed is reselling raw access to the API itself, such as handing out your keys.

Costs that scale with you

Plans start at $40 a month for 300,000 words, and words past your plan are billed at $135 per million instead of stopping your integration. The pricing section has a calculator if you want to estimate a month of usage, and the documentation has every field and error in detail.

Keep reading