> ## 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.

# Stealth Agent

> Multi-step Stealth Agent that replaces the legacy /api/stealthify business mode

The **Stealth Agent** is StealthGPT's premium long-form content API. It replaces the legacy `business: true` flag on `/api/stealthify` with a complete generation pipeline that researches the topic, drafts the content, optionally fact-checks it, humanizes the prose, and (optionally) inserts images.

If you used to enable `business: true` for higher-quality output, this is your migration target.

<CardGroup cols={2}>
  <Card title="Synchronous endpoint" icon="terminal" href="/api-reference/endpoints/stealthify-agent">
    `POST /api/stealthify/agent` — wait for the final markdown in one long-running HTTP request.
  </Card>

  <Card title="Async runs endpoint" icon="webhook" href="/api-reference/endpoints/stealthify-agent-runs">
    `POST /api/stealthify/agent/runs` — create a run, poll status, and optionally receive a webhook callback.
  </Card>
</CardGroup>

## Why Stealth Agent

A single-pass humanizer (the `/api/stealthify` endpoint) is excellent at rewriting text you already have. For long-form generation where the model has to **plan, research, cite, and write from scratch**, a single pass is not enough. The Stealth Agent runs each step as a dedicated stage with its own model, prompt, and validation:

<CardGroup cols={2}>
  <Card title="Researched, not invented" icon="magnifying-glass">
    Web research grounds the draft in real sources before the writing model sees the prompt, reducing hallucinations.
  </Card>

  <Card title="Optional fact-checking" icon="shield-check">
    `enableFactCheck: true` runs an additional pass that verifies claims and rewrites unsupported ones before humanization.
  </Card>

  <Card title="Humanized last" icon="wand-magic-sparkles">
    Humanization runs **after** drafting and fact-checking, so the final text reads naturally and stays low-detection.
  </Card>

  <Card title="Format-aware output" icon="file-lines">
    Each preset returns markdown shaped for its medium — academic structure with citations, SEO sections with headings, or platform-tuned social posts.
  </Card>
</CardGroup>

## Presets

The endpoint accepts a discriminated union on `preset`. You pick the preset that matches your output, and the agent picks the right pipeline.

<Tabs>
  <Tab title="academic">
    **Use for**: essays, literature reviews, study-guide style explainers, research-paper drafts.

    Pipeline: web research → academic draft → optional fact-check → humanize → academic post-processing (citations + optional images).

    Returns markdown with citations formatted in your chosen style (APA by default).
  </Tab>

  <Tab title="seo">
    **Use for**: long-form blog posts, evergreen guides, comparison articles, programmatic-SEO landing pages.

    Pipeline: web research + keyword research (in parallel) → competitor analysis → SEO draft → meta generation → optional fact-check → humanize → optional images.

    Returns markdown with H1/H2/H3 structure shaped for search intent and discovered keywords.
  </Tab>

  <Tab title="social">
    **Use for**: LinkedIn thought-leadership posts and Medium articles.

    Pipeline: web research + platform-specific social research (in parallel) → platform-aware draft → optional fact-check → humanize → optional images.

    `platform` is required and must be `"linkedin"` or `"medium"`. The voice, structure, and length adapt to the platform.
  </Tab>
</Tabs>

## What you get back

Every successful run returns final markdown plus billing metadata. The synchronous endpoint returns it directly as `200 OK`; the async endpoint returns it from polling or webhook callback once the run is `completed`.

| Field                   | What it is                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------------------ |
| `result`                | Final humanized content as markdown. The exact same content stored against `documentId`.   |
| `runId`                 | Server-side identifier of the run. Useful for support tickets and future replay endpoints. |
| `documentId`            | Identifier of the persisted document for this run.                                         |
| `preset`                | Echoes your input preset.                                                                  |
| `outputWords`           | Word count of `result`, used for billing.                                                  |
| `creditsSpent`          | `ceil(outputWords × 10)` Stealth API words charged for this run.                           |
| `remainingCredits`      | Prepaid balance after the charge.                                                          |
| `billingMode`           | `"prepaid"` or `"payg"`.                                                                   |
| `meteredChargedCredits` | Words billed to metered usage (0 when fully prepaid).                                      |

See the [synchronous endpoint reference](/api-reference/endpoints/stealthify-agent) or [async runs reference](/api-reference/endpoints/stealthify-agent-runs) for complete schemas and error codes.

## Billing model

Stealth Agent uses the **same Stealth API balance and pay-as-you-go rules** as `/api/stealthify`, but charges by output:

* **`creditsSpent = ceil(outputWords × 10)`** — input length does not change the price.
* Billing falls back from prepaid balance to pay-as-you-go automatically when terms are accepted and a payment method is on file.
* Cancelled requests (HTTP `499`) are not charged.

See [Pricing](/api-reference/pricing) for full rate cards and tiers.

## How long does a run take

Stealth Agent runs are **multi-step** and can take **several minutes**. For direct synchronous calls, the server allows up to **600 seconds** per request and your client must use a 10-minute timeout. For production integrations, use async runs so your create request returns immediately and the final result is delivered through polling or webhook.

The [usage guide](/api-reference/stealth-agent/guide) walks through timeout configuration, balance preflight checks, error recovery, and idempotency considerations end-to-end.

## Next steps

<CardGroup cols={3}>
  <Card title="Usage guide" icon="book-open" href="/api-reference/stealth-agent/guide">
    End-to-end walkthrough: pick a preset, configure the client, handle errors, and ship to production.
  </Card>

  <Card title="Use cases" icon="lightbulb" href="/api-reference/stealth-agent/use-cases">
    Concrete prompts and recommended preset/option combinations for common workflows.
  </Card>

  <Card title="Async runs" icon="webhook" href="/api-reference/endpoints/stealthify-agent-runs">
    Create runs, poll status, receive callbacks, and use idempotency keys.
  </Card>
</CardGroup>
