API documentation
Integrate AI Humanizer into your application.
AI Humanizer — API Documentation
Complete reference for calling the humanization API with parameters for intensity, input type, and output type.
Base URL example: http://192.168.1.76/ai_humanizer
Endpoint: POST /api/v1/humanize.php
---
Table of contents
3. Prompt mode (generate + humanize)
---
1. Authentication
Every request requires a valid API key.
| Method | Header / field | Example |
|--------|----------------|---------|
| Recommended | Authorization | Bearer ah_your_api_key_here |
| Alternative | X-API-Key | ah_your_api_key_here |
| Not recommended | JSON body api_key | "api_key": "ah_..." |
Get an API key
1. Sign up at /signup.php
2. Admin enables your account in MySQL:
``sql
UPDATE users SET can_create_api_keys = 1 WHERE email = 'you@example.com';
`
3. Log in → Dashboard → Create API key
4. Copy the key immediately (shown only once)
---
2. Request parameters
Method: POST
Content-Type: application/json
Mode A — Humanize existing content
| Parameter | Type | Values | Description |
|-----------|------|--------|-------------|
| content | string | any | The text or HTML to humanize (min. 10 words) |
| input_type | string | text, html | Format of the content field |
Legacy (still supported): send text or html instead of content + input_type.
Mode B — Generate from prompt (blogging)
| Parameter | Type | Values | Description |
|-----------|------|--------|-------------|
| prompt | string | any | Your blogging brief / topic (min. 10 characters) |
| input_type | string | prompt | Tells the API to generate content from the prompt |
You may send the brief in content instead of prompt when input_type is prompt.
Optional (all modes)
| Parameter | Type | Values | Default | Description |
|-----------|------|--------|---------|-------------|
| output_type | string | text, html | same as input_type (or html for prompt) | Format of the primary result in result.content |
| intensity | string | light, medium, aggressive | aggressive | How strongly to humanize |
| word_count | integer | 100–2500 | 600 | Target article length (prompt mode only) |
Parameter details
intensity
| Value | Behaviour |
|-------|-----------|
| light | Minimal edits — fixes obvious AI patterns only |
| medium | Balanced natural rewrite, professional tone |
| aggressive | Maximum humanization + detector optimization (best for ZeroGPT-style tools) |
input_type
| Value | What you send | What happens |
|-------|---------------|--------------|
| text | Plain text in content | Humanizes existing text |
| html | HTML in content | Humanizes existing HTML |
| prompt | Brief in prompt or content | Generates blog content from your prompt, then humanizes it |
output_type
| Value | result.content contains |
|-------|---------------------------|
| text | Plain humanized text |
| html | Humanized HTML markup |
Common combinations:
| input_type | output_type | Use case |
|------------|-------------|----------|
| html | html | CMS / blog — HTML in, HTML out |
| html | text | HTML in, plain text out |
| text | text | Simple text pipeline |
| text | html | Text in, wrapped in <p> HTML out |
| prompt | html | Blog prompt → generated HTML → humanized HTML |
| prompt | text | Blog prompt → generated text → humanized text |
---
3. Prompt mode (generate + humanize)
Use this when you want the API to write and humanize blogging content from a topic brief — not just rewrite existing text.
How it works
1. You send a prompt (topic, angle, keywords, audience, etc.)
2. The API generates a structured blog article using humanization-aware writing rules
3. The generated draft is run through the full humanization pipeline (same as text/html mode)
4. You receive humanized output in your chosen output_type
Prompt mode request
`json
{
"prompt": "Write a blog post about the benefits of cloud computing for small businesses. Include sections on cost savings, scalability, and security. Tone: friendly and practical.",
"input_type": "prompt",
"output_type": "html",
"word_count": 800,
"intensity": "aggressive"
}
`
Prompt mode parameters
| Parameter | Required | Description |
|-----------|----------|-------------|
| prompt | Yes* | Your blogging brief — topic, audience, tone, sections to cover |
| input_type | Yes | Must be prompt |
| output_type | No | html (default) or text |
| word_count | No | Target length in words (100–2500, default 600) |
| intensity | No | light, medium, or aggressive |
\* Or use content instead of prompt when input_type is prompt.
Prompt tips for better blog output
- Be specific: topic, audience, tone, and sections you want
- Example: *"Write for startup founders about remote team productivity. Cover async communication, time zones, and tooling. Conversational tone, ~600 words."*
- Use output_type: html
for CMS/blog publishing (headings, paragraphs, lists) - Use intensity: aggressive
for best detector bypass on generated content - Headings (h2
–h6) are preservedexactly as sent - Body content (paragraphs, lists) is humanized to stay relevant under each heading
- Inline formatting (<strong>
,<em>, etc.) is preserved where possible - h1
tagsare converted to h2automatically - Output HTML is suitable for direct use inside a <body>
tag
---
4. Request examples
A. HTML in → HTML out (aggressive) — recommended
`json
{
"content": "<h2>Cloud Benefits</h2><p>Furthermore, cloud computing provides <strong>scalable</strong> infrastructure for businesses.</p>",
"input_type": "html",
"output_type": "html",
"intensity": "aggressive"
}
`
B. Plain text in → plain text out (medium)
`json
{
"content": "Furthermore, it is crucial to note that artificial intelligence has transformed how teams write and publish content across industries.",
"input_type": "text",
"output_type": "text",
"intensity": "medium"
}
`
C. HTML in → text out (light)
`json
{
"content": "<h2>Introduction</h2><p>AI tools are widely used in content marketing today.</p>",
"input_type": "html",
"output_type": "text",
"intensity": "light"
}
`
D. Legacy format (still works)
`json
{
"html": "<p>Your HTML content with at least ten words goes here for humanization.</p>",
"intensity": "aggressive"
}
`
E. Prompt → HTML blog post (generate + humanize)
`json
{
"prompt": "Write a blog about sustainable gardening for beginners. Cover soil prep, water conservation, and easy vegetables to grow. Friendly tone.",
"input_type": "prompt",
"output_type": "html",
"word_count": 700,
"intensity": "aggressive"
}
`
F. Prompt → plain text
`json
{
"prompt": "Explain why regular exercise improves mental health. Target office workers. Include 3 practical tips.",
"input_type": "prompt",
"output_type": "text",
"word_count": 500,
"intensity": "medium"
}
`
---
5. Response structure
Success response — prompt mode (HTTP 200)
`json
{
"success": true,
"parameters": {
"input_type": "prompt",
"output_type": "html",
"intensity": "aggressive",
"word_count": 700,
"prompt": "Write a blog about sustainable gardening for beginners..."
},
"result": {
"content": "<h2>Getting Started with Sustainable Gardening</h2><p>Starting a garden doesn't have to be complicated...</p>",
"content_format": "html"
},
"scores": {
"original_ai_score": 72,
"original_human_score": 28,
"original_verdict": "Mostly AI",
"new_ai_score": 15,
"new_human_score": 85,
"new_verdict": "Likely Human",
"improvement": 57
},
"meta": {
"method": "ai",
"pass_count": 2,
"detector_pass_used": true,
"target_human_score": 70,
"target_hit": true,
"word_count": 685,
"generation_mode": "prompt",
"generated_content": "<h2>Getting Started with Sustainable Gardening</h2><p>Furthermore, sustainable gardening is...</p>",
"api_error": null,
"detector_metrics": { "burst_ratio": 0.48, "length_cv": 0.58 },
"changes_made": { "change_percentage": 42 }
},
"humanized_text": "Getting Started with Sustainable Gardening Starting a garden doesn't have to be complicated...",
"humanized_html": "<h2>Getting Started with Sustainable Gardening</h2><p>Starting a garden doesn't have to be complicated...</p>"
}
`
> Note: meta.generated_content is the AI draft before humanization. result.content is the final humanized output to publish.
Success response — humanize mode (HTTP 200)
`json
{
"success": true,
"parameters": {
"input_type": "html",
"output_type": "html",
"intensity": "aggressive"
},
"result": {
"content": "<h2>Cloud Benefits</h2><p>Cloud gives you <strong>scalable</strong> infrastructure...</p>",
"content_format": "html"
},
"scores": {
"original_ai_score": 78,
"original_human_score": 22,
"original_verdict": "Mostly AI",
"new_ai_score": 18,
"new_human_score": 82,
"new_verdict": "Likely Human",
"improvement": 60
},
"meta": {
"method": "ai",
"pass_count": 2,
"detector_pass_used": true,
"target_human_score": 70,
"target_hit": true,
"word_count": 45,
"api_error": null,
"detector_metrics": {
"burst_ratio": 0.52,
"length_cv": 0.61,
"sentence_count": 6,
"avg_sentence_length": 12.5
},
"changes_made": {
"words_original": 42,
"words_modified": 44,
"sentences_original": 3,
"sentences_modified": 4,
"change_percentage": 38
}
},
"humanized_text": "Cloud Benefits Cloud gives you scalable infrastructure...",
"humanized_html": "<h2>Cloud Benefits</h2><p>Cloud gives you <strong>scalable</strong> infrastructure...</p>"
}
`
Field reference
Root
| Field | Type | Description |
|-------|------|-------------|
| success | boolean | true on success |
| parameters | object | Echo of request parameters used |
| result | object | Primary output (use result.content) |
| scores | object | AI/human detection scores before and after |
| meta | object | Processing metadata |
| humanized_text | string | Always included — plain text version |
| humanized_html | string | Included when HTML input or HTML output |
parameters
| Field | Type | Description |
|-------|------|-------------|
| input_type | string | text, html, or prompt |
| output_type | string | text or html |
| intensity | string | light, medium, or aggressive |
| prompt | string\|null | Echo of prompt (prompt mode only) |
| word_count | number\|null | Target length used (prompt mode only) |
result
| Field | Type | Description |
|-------|------|-------------|
| content | string | Main output — format matches output_type |
| content_format | string | text or html |
scores
| Field | Type | Description |
|-------|------|-------------|
| original_ai_score | number | AI likelihood before (0–100, higher = more AI) |
| original_human_score | number | Human score before (100 − AI score) |
| original_verdict | string | e.g. Likely AI, Mostly Human |
| new_ai_score | number | AI likelihood after humanization |
| new_human_score | number | Human score after humanization |
| new_verdict | string | Verdict after humanization |
| improvement | number | Points reduced from AI score |
meta
| Field | Type | Description |
|-------|------|-------------|
| method | string | ai (DeepSeek) or rules (fallback) |
| pass_count | number | Rewrite passes run (1–3) |
| detector_pass_used | boolean | Whether detector-aware pass ran |
| target_human_score | number | Internal target (default 70) |
| target_hit | boolean | Whether target was reached |
| word_count | number | Words in humanized output |
| api_error | string\|null | Error if AI failed but rules fallback used |
| detector_metrics | object | Burstiness / sentence variance metrics |
| changes_made | object | Word/sentence change statistics |
| generation_mode | string | prompt when content was generated from a prompt |
| generated_content | string | Draft before humanization (prompt mode only) |
---
6. Error responses
`json
{
"success": false,
"error": "Invalid intensity. Use: light, medium, or aggressive."
}
`
| HTTP code | Meaning |
|-----------|---------|
| 200 | Success |
| 400 | Bad request (validation, too few words, invalid parameters) |
| 401 | Missing or invalid API key |
| 405 | Wrong HTTP method (use POST) |
| 503 | Database not configured |
Common errors
| Error | Fix |
|-------|-----|
| Missing API key | Add Authorization: Bearer ah_... header |
| Invalid or revoked API key | Create new key in dashboard |
| Content must be at least 10 words | Send longer content |
| When using "content", you must set input_type | Add "input_type": "text" or "html" |
| Invalid intensity | Use light, medium, or aggressive |
| Prompt mode requires... | Add prompt or content with input_type: prompt |
| Content generation failed | Check DeepSeek API key in config.php |
| word_count must be between 100 and 2500 | Adjust word_count parameter |
---
7. HTML behaviour
When input_type is html:
Prompt mode with output_type: html: generated articles include <h2> section headings, <p> paragraphs, and optional <ul> lists — then headings are preserved and body content is humanized.
---
8. Code examples
cURL — Prompt to humanized HTML blog
`bash
curl -X POST "http://192.168.1.76/ai_humanizer/api/v1/humanize.php" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ah_YOUR_API_KEY" \
-d '{
"prompt": "Write a blog about remote work productivity tips for software developers. Cover focus time, async communication, and work-life balance. Professional but approachable tone.",
"input_type": "prompt",
"output_type": "html",
"word_count": 800,
"intensity": "aggressive"
}'
`
cURL — HTML in, HTML out, aggressive
`bash
curl -X POST "http://192.168.1.76/ai_humanizer/api/v1/humanize.php" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ah_YOUR_API_KEY" \
-d '{
"content": "<h2>Benefits</h2><p>Furthermore, AI tools help teams work <strong>faster</strong> every single day.</p>",
"input_type": "html",
"output_type": "html",
"intensity": "aggressive"
}'
`
PHP
`php
<?php
$apiKey = 'ah_YOUR_API_KEY';
$url = 'http://192.168.1.76/ai_humanizer/api/v1/humanize.php';
$payload = [
'content' => '<h2>Title</h2><p>Your AI-generated paragraph with at least ten words goes here.</p>',
'input_type' => 'html',
'output_type' => 'html',
'intensity' => 'aggressive',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_TIMEOUT => 120,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if (!empty($data['success'])) {
echo $data['result']['content']; // HTML output
echo $data['scores']['new_human_score']; // e.g. 82
} else {
echo 'Error: ' . ($data['error'] ?? 'Unknown');
}
`
JavaScript (fetch)
`javascript
const response = await fetch('http://192.168.1.76/ai_humanizer/api/v1/humanize.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ah_YOUR_API_KEY',
},
body: JSON.stringify({
content: 'Furthermore, it is crucial to note that this paragraph needs humanization and has enough words.',
input_type: 'text',
output_type: 'text',
intensity: 'medium',
}),
});
const data = await response.json();
if (data.success) {
console.log(data.result.content);
console.log('Human score:', data.scores.new_human_score);
} else {
console.error(data.error);
}
`
Python
`python
import requests
API_KEY = "ah_YOUR_API_KEY"
URL = "http://192.168.1.76/ai_humanizer/api/v1/humanize.php"
response = requests.post(
URL,
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}",
},
json={
"content": "<h2>Overview</h2><p>Furthermore, it is important to note that this content requires humanization.</p>",
"input_type": "html",
"output_type": "html",
"intensity": "aggressive",
},
timeout=120,
)
data = response.json()
if data.get("success"):
print(data["result"]["content"])
print("Human score:", data["scores"]["new_human_score"])
else:
print("Error:", data.get("error"))
`
---
9. Setup checklist
| Step | Action |
|------|--------|
| 1 | Import sql/schema.sql into MySQL |
| 2 | Set config.php → db credentials |
| 3 | Set config.php → deepseek_api_key |
| 4 | Sign up and get API key enabled by admin |
| 5 | Test: GET /api/test_deepseek.php |
| 6 | Call POST /api/v1/humanize.php with parameters above |
---
Quick reference
Humanize existing content
`
POST /api/v1/humanize.php
Authorization: Bearer ah_xxxxx
Content-Type: application/json
{
"content": "...",
"input_type": "html|text",
"output_type": "html|text",
"intensity": "light|medium|aggressive"
}
`
Generate + humanize from prompt (blogging)
`
POST /api/v1/humanize.php
Authorization: Bearer ah_xxxxx
Content-Type: application/json
{
"prompt": "Your blog topic and instructions...",
"input_type": "prompt",
"output_type": "html|text",
"word_count": 600,
"intensity": "aggressive"
}
`
→ Use response.result.content for your final output
→ Use response.scores.new_human_score for human %
→ Use response.meta.generated_content to see the pre-humanization draft (prompt mode)
---
Related files: documentation.md (general docs) · docs.php (web view) · dashboard.php` (API keys & usage)