Skip to main content
POST
/
api
/
stealthify
/
agent
Stealth Agent
curl --request POST \
  --url https://stealthgpt.ai/api/stealthify/agent \
  --header 'Content-Type: application/json' \
  --header 'api-token: <api-token>' \
  --data '
{
  "preset": "<string>",
  "prompt": "<string>",
  "enableFactCheck": true,
  "enableImageGeneration": true,
  "platform": "<string>"
}
'
{
  "runId": "<string>",
  "documentId": "<string>",
  "preset": "<string>",
  "result": "<string>",
  "outputWords": 123,
  "creditsSpent": 123,
  "remainingCredits": 123,
  "billingMode": "<string>",
  "meteredChargedCredits": 123
}
The /api/stealthify/agent endpoint runs a Stealth Agent pipeline: research, generation, humanization, and optional fact-checking and image insertion. It uses the same Stealth API word balance and pay-as-you-go rules as /api/stealthify. Requests can take several minutes. Use a client timeout of at least 10 minutes (the server allows up to 600 seconds).

Authentication

api-token
string
required
Your Stealth API token from the Stealth API dashboard.

Request body

Send JSON with a required preset that selects one of three shapes (discriminated union). Unknown fields are rejected (strict schema).

Academic

preset
string
required
Must be "academic".
prompt
string
required
Topic or instructions for the academic-style document (non-empty).
enableFactCheck
boolean
default:"false"
When true, runs a fact-check pass on the draft and applies fixes before humanization.
enableImageGeneration
boolean
default:"false"
When true, may embed generated images in the final markdown where supported.

SEO

preset
string
required
Must be "seo".
prompt
string
required
Topic or brief for SEO-oriented content (non-empty).
enableFactCheck
boolean
default:"false"
Same behavior as academic.
enableImageGeneration
boolean
default:"false"
Same behavior as academic.

Social

preset
string
required
Must be "social".
prompt
string
required
Topic or brief for the social post (non-empty).
platform
string
required
Target platform: "linkedin" or "medium".
enableFactCheck
boolean
default:"false"
Same behavior as academic.
enableImageGeneration
boolean
default:"false"
Same behavior as academic.

Successful response (200)

runId
string
Identifier of the Stealth Agent run (stored server-side).
documentId
string
Identifier of the saved document record for this run.
preset
string
Echoes the request preset: academic, seo, or social.
result
string
Final content as markdown (same primary output that is stored for the document; may include embedded images when enableImageGeneration is true).
outputWords
number
Word count of result used for billing.
creditsSpent
number
Stealth API words charged for this request (see Pricing).
remainingCredits
number
Prepaid word balance after this charge (metered usage may still be reported separately).
billingMode
string
"prepaid" when the request was covered from balance, or "payg" when metered pay-as-you-go usage was applied for part or all of the charge.
meteredChargedCredits
number
Words billed to metered usage for this request (0 when fully prepaid).

Errors

StatusMeaning
400Invalid JSON or validation error. Body may include message and info (issue details).
401Missing api-token header or token not found.
402Insufficient credits, pay-as-you-go not available, payment method missing, or billing cap delay. message describes the case.
499Request was aborted (client disconnect or cancellation).
500Server error. message may contain a short description.

Example: academic

curl --request POST \
  --url 'https://stealthgpt.ai/api/stealthify/agent' \
  --header 'Content-Type: application/json' \
  --header 'api-token: YOUR_API_TOKEN' \
  --max-time 600 \
  --data '{
    "preset": "academic",
    "prompt": "Outline creatine benefits for older adults in resistance training",
    "enableFactCheck": true,
    "enableImageGeneration": false
  }'

Example: social

{
  "preset": "social",
  "prompt": "Post about sustainable remote work habits",
  "platform": "linkedin",
  "enableFactCheck": false,
  "enableImageGeneration": true
}

Usage notes

  • Billing uses output words only: charged words = ceil(outputWords × 10) toward your Stealth API balance (see Pricing).
  • You must have prepaid words or accepted pay-as-you-go terms with a valid payment method when balance is low—same rules as other Stealth API endpoints.
  • Prefer idempotent retries with care: each successful 200 run creates a new run and document and charges credits again.