API Reference · v1

API Documentation

API Documentation

Introduction

The StealthAiHumanizer API lets you humanize AI-generated text and detect AI-written content from your own applications. Every endpoint accepts a JSON request body and returns a JSON response. All requests are made over HTTPS.

Base URL
https://stealthaihumanizer.com/api/v1
Content-Type application/json
Methods All endpoints use POST.

Authentication

Every request carries your API token as a bearer token in the Authorization header. Tokens look like sk_live_… and are tied to your subscription. A missing, invalid or disabled token is rejected with 401. A valid token whose subscription is not an active API plan gets 403, and one whose subscription is past due gets 402 until it is paid.

request header
Authorization: Bearer sk_live_your_api_token
Content-Type: application/json
Need a token? Tokens are issued with a paid API plan. Purchase a plan or contact support to receive one. Treat it like a password and never expose it in client-side code.

Plan limits

Your API plan sets the limits below, and every request is checked against them. When one is reached you get 429 with code: "limit_exceeded"; the reason field names the exact limit so you can handle it programmatically.

LimitApplies toReasonDescription
Words per requestAll endpointswords_per_inputMaximum words in a single request's text. Humanize and the two detector endpoints each have their own value.
Plan allowanceAll endpointsgroup_budgetThe total your plan allows for a tool, counted in calls or in words, per day or per billing cycle. Both detector endpoints draw from the same allowance.
Rate limitAll endpointsnoneAt most 50 requests per minute. Beyond that you get 429 with {"message": "Too Many Attempts."} and a Retry-After header.

Allowances only count successful (200) requests — calls that fail validation, hit a limit or error out never consume them. A daily allowance resets at midnight (server time); a cycle or billing-period allowance resets when that period renews.

A limit your plan does not set blocks the request. If your plan has no words-per-request value or no allowance for a tool, calls to it are refused with 403 and reason: "limit_not_configured". Contact support to adjust your plan.

Humanize

POST /api/v1/humanize sk_live token

Rewrites AI-generated text so it reads as natural, human-written content. Returns one or more humanized variations of the supplied text.

Subject to words_per_input and your humanize group_budget. See Plan limits and Errors.

Body
textstring
The text to humanize. required
ninteger
Number of humanized variations to generate, from 1 to 10. required
modelstring
Which model rewrites the text: mini (Fantom Mini, the default) or pro (Fantom Pro).
levelinteger
Humanization intensity, from 1 to 5. Higher values rewrite more aggressively.
stylestring
Writing style / tone of the output: standard, natural, fluency, creative, simple, formal, academic or optimistic.
langstring
Language of the text: en, es, fr, pt, de or it.
avoid_contractionsboolean
When true, the output avoids contractions (for example "do not" instead of "don't").
curl -X POST https://stealthaihumanizer.com/api/v1/humanize \
  -H "Authorization: Bearer sk_live_your_api_token" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The mitochondria is the powerhouse of the cell.",
    "n": 1,
    "model": "pro",
    "level": 2,
    "style": "natural"
  }'
const res = await fetch("https://stealthaihumanizer.com/api/v1/humanize", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_live_your_api_token",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "The mitochondria is the powerhouse of the cell.",
    n: 1,
    model: "pro",
    level: 2,
    style: "natural",
  }),
});

const data = await res.json();
$client = new \GuzzleHttp\Client();

$response = $client->post('https://stealthaihumanizer.com/api/v1/humanize', [
    'headers' => [
        'Authorization' => 'Bearer sk_live_your_api_token',
        'Content-Type'  => 'application/json',
    ],
    'json' => [
        'text'  => 'The mitochondria is the powerhouse of the cell.',
        'n'     => 1,
        'model' => 'pro',
        'level' => 2,
        'style' => 'natural',
    ],
]);

$data = json_decode((string) $response->getBody(), true);
{
  "backend": "local",
  "sentences": [
    {
      "index": 0,
      "input_sentence": "The mitochondria is the powerhouse of the cell.",
      "outputs": [
        {
          "text": "Honestly, the mitochondria is what keeps the cell powered up.",
          "readability": 45.29,
          "label": 0
        }
      ]
    }
  ]
}

Response fields are passed through from the StealthAiHumanizer engine and may include additional metadata.

Detect a passage

POST /api/v1/detector/passage sk_live token

Analyzes a passage as a whole and returns the likelihood that it was written by AI.

Subject to words_per_input and the detector group_budget, shared with /detector/sentence. See Plan limits.

Body
textstring
The passage to analyze. required
detectorstring
Sensitivity: one of easy, normal or strict. Defaults to normal.
curl -X POST https://stealthaihumanizer.com/api/v1/detector/passage \
  -H "Authorization: Bearer sk_live_your_api_token" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Paste the passage you want to analyze here.",
    "detector": "normal"
  }'
const res = await fetch("https://stealthaihumanizer.com/api/v1/detector/passage", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_live_your_api_token",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "Paste the passage you want to analyze here.",
    detector: "normal",
  }),
});

const data = await res.json();
$client = new \GuzzleHttp\Client();

$response = $client->post('https://stealthaihumanizer.com/api/v1/detector/passage', [
    'headers' => [
        'Authorization' => 'Bearer sk_live_your_api_token',
        'Content-Type'  => 'application/json',
    ],
    'json' => [
        'text'     => 'Paste the passage you want to analyze here.',
        'detector' => 'normal',
    ],
]);

$data = json_decode((string) $response->getBody(), true);
{
  "ai_prob": 0.9881510734558105,
  "human_prob": 0.0118489945307374,
  "label": "AI"
}

ai_prob and human_prob are floats between 0 and 1 (not percentages) that sum to 1. label is the verdict for the passage as a whole.

Detect by sentence

POST /api/v1/detector/sentence sk_live token

Splits the text into sentences and returns a per-sentence AI/human label — useful for highlighting exactly which parts read as AI-generated.

Subject to words_per_input and the detector group_budget, shared with /detector/passage. See Plan limits.

Body
textstring
The text to analyze sentence by sentence. required
detectorstring
Sensitivity: one of easy, normal or strict — controls how aggressively sentences are flagged.
curl -X POST https://stealthaihumanizer.com/api/v1/detector/sentence \
  -H "Authorization: Bearer sk_live_your_api_token" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "First sentence. Second sentence to check.",
    "detector": "normal"
  }'
const res = await fetch("https://stealthaihumanizer.com/api/v1/detector/sentence", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_live_your_api_token",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text: "First sentence. Second sentence to check.",
    detector: "normal",
  }),
});

const data = await res.json();
$client = new \GuzzleHttp\Client();

$response = $client->post('https://stealthaihumanizer.com/api/v1/detector/sentence', [
    'headers' => [
        'Authorization' => 'Bearer sk_live_your_api_token',
        'Content-Type'  => 'application/json',
    ],
    'json' => [
        'text'     => 'First sentence. Second sentence to check.',
        'detector' => 'normal',
    ],
]);

$data = json_decode((string) $response->getBody(), true);
[
  { "label": "Human" },
  { "label": "AI" }
]

A bare JSON array of per-sentence labels, in sentence order; the sentence text is not echoed back.

Sentences under 5 words are skipped, so the array is often shorter than your sentence count — and [] is a valid 200 result. Don't assume item n is your n-th sentence.

Errors

Errors are JSON with a stable machine-readable code and a reason. Never parse the message — it is written for humans. Body-validation errors (422) use Laravel's message + errors shape instead.

{
  "success": false,
  "code": "unauthorized",
  "reason": "invalid-api-token",
  "message": "The API token is invalid or has been disabled."
}
{
  "success": false,
  "code": "forbidden",
  "reason": "limit_not_configured",
  "message": "Your plan does not configure this limit, so the request cannot be authorized. Contact support."
}
{
  "success": false,
  "code": "limit_exceeded",
  "reason": "group_budget",
  "message": "This request would exceed the 50000 words shared allowance for Humanizer (you have used 49800 so far)."
}
{
  "message": "The text parameter is required.",
  "errors": {
    "text": ["The text parameter is required."],
    "n": ["The n parameter is required."]
  }
}
StatusCodeReasonWhat to do
401unauthorizedinvalid-api-tokenToken is missing, invalid or disabled.
402payment_requiredsubscription-past-dueYour subscription is past due. Settle the payment to resume.
422n/asee errorsFix the request body; each field lists what failed.
403forbiddennot-an-api-plan
subscription-inactive
limit_not_configured
group_budget_unit_unsupported
subscription-unresolved
The subscription is not an active API plan, your plan does not set a limit or allowance this endpoint needs, or the subscription could not be resolved. Contact support.
429limit_exceededwords_per_input
group_budget
A plan limit was reached — shorten the text or wait for the allowance to reset.
429n/an/aMore than 50 requests in a minute. Wait for Retry-After seconds.
429upstream_error429The engine is busy — slow down and retry shortly.
502upstream_error
invalid_upstream_response
request-failed
non-json
The engine returned an error or an invalid response. Retry with backoff.
503service_not_configuredmissing-api-configThe service is not configured. Contact support.
504upstream_timeouttimeoutThe engine did not respond in time. Retry the request.