AI Humanizer

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

1. Authentication

2. Request parameters

3. Prompt mode (generate + humanize)

4. Request examples

5. Response structure

6. Error responses

7. HTML behaviour

8. Code examples

9. Setup checklist

---

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

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)