'No text provided.']); exit; } $api_key = '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'; // ← replace with your key // ── Prompt selection ────────────────────── if ($action === 'humanize') { $system = "You are an expert content rewriter. Your job is to rewrite AI-generated text so it reads like a real human wrote it — natural sentence rhythm, varied lengths, occasional colloquial phrases, first-person warmth where appropriate, and zero robotic patterns. Do NOT add disclaimers. Return ONLY the rewritten text."; $user = "Rewrite this content to sound fully human-written:\n\n{$text}"; } else { // detect: ask for JSON with score + reasoning $system = "You are an AI-content detection specialist. Analyse the text for signals of AI authorship: uniform sentence cadence, over-formal vocabulary, lack of personal voice, excessive hedging, perfect paragraph structure, filler transitions. Return ONLY valid JSON with these fields:\n{\"score\": <0-100 integer where 100 = certainly AI>, \"label\": \"\", \"signals\": [\"...\",\"...\",\"...\"]}"; $user = "Analyse this text for AI authorship:\n\n{$text}"; } // ── Anthropic API call ──────────────────── $payload = json_encode([ 'model' => 'claude-sonnet-4-20250514', 'max_tokens' => 2048, 'system' => $system, 'messages' => [['role' => 'user', 'content' => $user]], ]); $ch = curl_init('https://api.anthropic.com/v1/messages'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'x-api-key: ' . $api_key, 'anthropic-version: 2023-06-01', ], ]); $raw = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo json_encode(['error' => 'cURL error: ' . $err]); exit; } $response = json_decode($raw, true); $content = $response['content'][0]['text'] ?? ''; if ($action === 'detect') { // parse JSON from Claude $parsed = json_decode($content, true); if (!$parsed) { // fallback if Claude wrapped it preg_match('/\{.*\}/s', $content, $m); $parsed = json_decode($m[0] ?? '{}', true); } echo json_encode(['detection' => $parsed]); } else { echo json_encode(['humanized' => $content]); } exit; } ?> HumanIQ — AI Content Humanizer
Powered by Claude AI
📝 Original / AI Text 0 characters
0 words
✨ Humanized Output
AI Detection Score
Nothing here yet Paste content on the left and click Humanize
✓ Copied to clipboard!