> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stealthgpt.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Start with https://docs.stealthgpt.ai/api-reference/quickstart.md for REST setup and https://docs.stealthgpt.ai/api-reference/models.md for Super, Standard and Lite model selection.
> For existing drafts, use the Writer & Humanizer endpoints; for research-to-draft generation, use the Stealth Agent guides. Choose polling, webhook callbacks or MCP with https://docs.stealthgpt.ai/api-reference/workflow-patterns.md.
> For bulk humanization and editorial review, use https://docs.stealthgpt.ai/api-reference/recipes/humanize-review.md. For fixed links, citations or other approved spans, use https://docs.stealthgpt.ai/api-reference/text-preservation.md and replace each protected span with a marker in your application.
> For assistant setup and verified client status, use https://docs.stealthgpt.ai/api-reference/integrations/mcp.md. Consult the Pricing and Data Handling references for API entitlements, word accounting and processing details; web subscriptions and API plans are separate.

# Writer & Humanizer

> Generate or rephrase content with the /api/stealthify endpoint

The `/api/stealthify` endpoint is the core of the StealthGPT API, allowing you to generate new content or rephrase existing text to be undetectable by AI detection tools.

> [!WARNING]
>
> **`model` is required.** You must explicitly pass `"super"`, `"standard"`, or `"lite"`. Requests that omit `model` return `400 Bad Request`. There is no default, please pick one.

> [!NOTE]
>
> For integrations that cannot keep a request open, use the async [`POST /api/stealthify/runs`](https://docs.stealthgpt.ai/api-reference/endpoints/stealthify-runs) flow. `rephrase` works the same way there. This synchronous endpoint remains unchanged for existing API clients.

> [!NOTE]
>
> Humanization automatically strips invisible AI text watermarks. Claude and Gemini embed a statistical pattern in their word choices, invisible to a reader, but it travels with copy and paste and can survive light editing. The humanizer rewrites at the sentence and structure level rather than swapping synonyms, which is the category of change those marks are not built to survive. Meaning stays intact; Claude, Gemini SynthID, and other invisible text watermarks do not.

## Request Parameters

**api-token** `string` *required*

Your unique API authentication token. You can find this in your StealthGPT dashboard under the API Key tab.

**idempotency-key** `string`

Optional, 1-255 characters. Only used when a long text runs as an async run (see [Usage Notes](#usage-notes)): sending the same request again with the same key picks up that run instead of starting and billing a new one. A run that failed stays failed under its key, so use a new key to try it again.

**prompt** `string` *required*

When `rephrase` is `false`, the topic or instructions for content generation. When `rephrase` is `true`, the existing text to humanize — send only that source text, with no instruction wrappers. Maximum 3,000 words per request.

**rephrase** `boolean` *required*

Set to `true` to rephrase the provided prompt text, or `false` to generate new content based on the prompt

**model** `string` *required*

Selects the humanizer model. **Required** — you must pass one of `"super"`, `"standard"`, or `"lite"`. Omitting `model` returns `400`. See [Models](https://docs.stealthgpt.ai/api-reference/models.md) for a full comparison.

**Available model options**

**super**

**Flagship.** Next-gen humanizer billed at **\$0.05 / 100 words**. Highest bypass rate; the structural rewrite also strips invisible text watermarks such as Claude's mark and Gemini's SynthID.

**standard**

Billed at **\$0.20 / 1,000 words**. Previous-generation full rewrite; removes invisible text watermarks such as Claude's mark and Gemini's SynthID.

**lite**

Fast AI-smell cleanup that keeps the text mostly unchanged. Billed at **\$0.20 / 1,000 words**. This mode is **not** designed to bypass AI detectors.

> [!WARNING]
>
> **Humanize / rephrase input:** when `rephrase` is `true`, put **only the source text** in `prompt`. Do not add instructions such as "Humanize the following text", "Rewrite this to sound more human", or "Make this undetectable". Those prefixes confuse the model and hurt output quality. Choose the model and speed with API parameters (`model`, `qualityMode`, `outputFormat`) instead. Instruction-style prompts, `tone` and `writingMode` are for generation (`rephrase: false`) only.

**tone** `string` (default: College)

Controls the style and complexity of generated content when `writingMode` is `essay` (ignored in default mode and when `rephrase` is `true`)

**Available tone options**

**Standard**

Ideal for casual writing. Easy to read and understand, suitable for general purposes.

**HighSchool**

Mimics the style of high school level writing. May contain grammatical errors. Scores high on Flesch-Kincaid Readability.

**College** `default`

Semi-complex style typical of college-level writing. May include minor grammatical errors. Moderate Flesch-Kincaid Readability score.

**PhD**

Complex, sophisticated style. No grammatical errors. Low Flesch-Kincaid Readability score, ideal for academic writing.

**writingMode** `string` (default: default)

Controls how content is generated when `rephrase` is `false`. Has no effect when `rephrase` is `true`.

**Available writingMode options**

**default** `default`

Follows the user's prompt as written. Does not force essay structure — suitable for emails, lists, product copy, summaries, or any other format you specify.

**essay**

Structures the output as an academic essay. Use with `tone` to set education level (Standard, HighSchool, College, PhD).

**qualityMode** `string` (default: quality)

Controls rewrite quality vs speed on `standard`. On `super` it only turns em dash cleanup on or off, and `lite` ignores it.

**Available qualityMode options**

**quality**

Default. On `standard`, runs our quality checks/repairs for better reliability and lower detection risk. On `super`, removes em dashes from the output.

**fast**

On `standard`, skips quality checks/repairs and performs a single-pass rewrite. Output may have more errors and be more detectable. On `super`, keeps em dashes.

**preservation** `boolean` (default: false)

Keeps every marker such as `[[T1]]` byte-for-byte, in order, while the text around it is humanized. Use it for links, HTML tags, headings or anything else you tokenize before sending. Requires `rephrase: true`. See [Text Preservation](https://docs.stealthgpt.ai/api-reference/text-preservation.md).

**preservationOpen** `string` (default: \[\[)

Opening delimiter of a marker, 1-10 characters, no spaces.

**preservationClose** `string` (default: ]])

Closing delimiter of a marker, 1-10 characters, no spaces. Must differ from `preservationOpen`.

**preservationMaxLookahead** `number` (default: 10)

Most characters allowed between the delimiters (1-64). A `[[` without a `]]` within this many characters is ordinary text.

**preservationMode** `string` (default: inline)

`"inline"` rewrites the text in one pass with the markers held in place, and falls back to `"split"` for any text where a marker moved. `"split"` rewrites each stretch between two markers on its own.

**outputFormat** `string` (default: text)

Controls the formatting of the returned content.

**Available output formats**

**text**

Default format. Returns plain text output.

**markdown**

Returns formatted content with markdown syntax (headings, lists, bold, etc.).

## Response

**result** `string`

The generated or rephrased content

**howLikelyToBeDetected** `number`

Human-likeness score from 0 to 100. **Higher is better**: a higher score means the content reads as more human and is less likely to be flagged as AI; a lower score means it is more likely to be detected as AI-generated. (The field name is historical — treat a higher value as the better result.)

**remainingCredits** `number`

Prepaid word balance remaining after this request.

**wordsSpent** `number`

Words charged for this request.

**billingMode** `string`

Whether the request was billed from prepaid words (`prepaid`) or pay-as-you-go metered billing (`payg`).

**meteredChargedCredits** `number`

If billed via pay-as-you-go, words added to metered usage for this request (0 when billed from prepaid).

**preservation** `object`

Only with `preservation: true`: `frozenCount` (markers in the input), `preservedCount` (markers returned unchanged, always equal to `frozenCount`), `mode` (the requested `inline` or `split`) and `fallbackUsed` (in `inline` mode, `true` when the text fell back to `split`). See [Text Preservation](https://docs.stealthgpt.ai/api-reference/text-preservation.md).

## Example Request

```bash curl-example theme={null}
curl --location 'https://www.stealthgpt.ai/api/stealthify' \
    --header 'api-token: YOUR_API_TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{
        "prompt": "Explain the benefits of renewable energy",
        "rephrase": false,
        "writingMode": "essay",
        "tone": "College",
        "qualityMode": "quality",
        "model": "super",
        "outputFormat": "markdown"
    }'
```

```python python-example theme={null}
import requests

response = requests.post(
    'https://www.stealthgpt.ai/api/stealthify',
    headers={
        'api-token': 'YOUR_API_TOKEN',
        'Content-Type': 'application/json'
    },
    json={
        'prompt': 'Explain the benefits of renewable energy',
        'rephrase': False,
        'writingMode': 'essay',
        'tone': 'College',
        'qualityMode': 'quality',
        'model': 'super',
        'outputFormat': 'markdown'
    }
)

print(response.json())
```

```javascript nodejs-example theme={null}
const axios = require('axios');

axios.post('https://www.stealthgpt.ai/api/stealthify', {
    prompt: 'Explain the benefits of renewable energy',
    rephrase: false,
    writingMode: 'essay',
    tone: 'College',
    qualityMode: 'quality',
    model: 'super',
    outputFormat: 'markdown'
}, {
    headers: {
        'api-token': 'YOUR_API_TOKEN',
        'Content-Type': 'application/json'
    }
}).then(response => {
    console.log(response.data);
});
```

> [!TIP]
>
> Super is billed at **\$0.05 / 100 words** (vs **\$0.20 / 1,000 words** for `standard` and `lite`). Both rates apply to **input words plus output words**.

## Example Response

```json theme={null}
{
  "result": "Renewable energy offers several significant advantages in our modern world. Students and researchers point to multiple benefits like reduced carbon emissions, which helps fight climate change. These energy sources, including solar and wind power, represent inexhaustible resources unlike finite fossil fuels. Many communities find economic advantages through job creation in the growing renewable sector. Additionally, these technologies typically require less maintenance after installation and reduce dependency on foreign energy imports. Advancements continue making these options more cost-competitive, with prices dropping significantly over recent years. While challenges exist in implementation, the long-term benefits to environmental health, economic stability, and energy independence make renewable energy sources increasingly attractive options for our global energy needs.",
  "howLikelyToBeDetected": 92,
  "wordsSpent": 260,
  "remainingCredits": 985000,
  "billingMode": "prepaid",
  "meteredChargedCredits": 0
}
```

## Usage Notes

* Texts over 3,000 words go to [`POST /api/stealthify/runs`](https://docs.stealthgpt.ai/api-reference/endpoints/stealthify-runs) in one request; see [Long Texts](https://docs.stealthgpt.ai/api-reference/advanced-usage.md#long-texts)
* With `rephrase: true` and `super` or `standard`, a text over 1,500 words is humanized as an [async run](https://docs.stealthgpt.ai/api-reference/endpoints/stealthify-runs.md). The request waits up to 9 minutes and returns the usual response; if the run is still going, it returns `202 Accepted` with `runId`, `status`, `statusUrl` and `description`. [Poll `statusUrl`](https://docs.stealthgpt.ai/api-reference/endpoints/stealthify-runs#poll-run-status) with the same `api-token` until the run is `completed`, `failed` or `cancelled`. Give these requests a client timeout of at least 10 minutes (Node's built-in `fetch` gives up after 5) and send an `idempotency-key`, so if the connection drops anyway, sending the same request again with the same key gets that run back instead of starting a new, billed one
* When `rephrase` is `true`, send only the source text in `prompt` — no "humanize / rewrite / make undetectable" wrappers
* When `rephrase` is `false`, the quality and relevance of generated content depends on the phrasing of your prompts
* To keep links, HTML or other spans unchanged, mark them and send `preservation: true`; see [Text Preservation](https://docs.stealthgpt.ai/api-reference/text-preservation.md)
* Humanization automatically strips invisible AI text watermarks (Claude, Gemini SynthID, and similar marks) as part of the sentence-level rewrite, no extra parameter
* For more advanced usage techniques, see our [Advanced Usage Guide](https://docs.stealthgpt.ai/api-reference/advanced-usage.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.