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
Request body
Send JSON with a required preset that selects one of three shapes (discriminated union). Unknown fields are rejected (strict schema).
Academic
Topic or instructions for the academic-style document (non-empty).
When true, runs a fact-check pass on the draft and applies fixes before humanization.
When true, may embed generated images in the final markdown where supported.
SEO
Topic or brief for SEO-oriented content (non-empty).
Same behavior as academic.
Same behavior as academic.
Social
Topic or brief for the social post (non-empty).
Target platform: "linkedin" or "medium".
Same behavior as academic.
Same behavior as academic.
Successful response (200)
Identifier of the Stealth Agent run (stored server-side).
Identifier of the saved document record for this run.
Echoes the request preset: academic, seo, or social.
Final content as markdown (same primary output that is stored for the document; may include embedded images when enableImageGeneration is true).
Word count of result used for billing.
Stealth API words charged for this request (see Pricing).
Prepaid word balance after this charge (metered usage may still be reported separately).
"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.
Words billed to metered usage for this request (0 when fully prepaid).
Errors
| Status | Meaning |
|---|
| 400 | Invalid JSON or validation error. Body may include message and info (issue details). |
| 401 | Missing api-token header or token not found. |
| 402 | Insufficient credits, pay-as-you-go not available, payment method missing, or billing cap delay. message describes the case. |
| 499 | Request was aborted (client disconnect or cancellation). |
| 500 | Server 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.