HyperAI
Back to Headlines

How to Build AI Text Humanizer Web Apps with Humbot API

3 days ago

AI text humanizer tools, like Humbot, have become essential in the era of large language models (LLMs). LLMs have advanced significantly, making it challenging to distinguish between human-written and AI-generated content. Tools like Humbot offer a reliable solution, helping users detect and humanize text. Getting Started with Humbot First, you need to sign up for Humbot or log in if you already have an account. Navigate to the Settings page, and under the API Overview tab, retrieve your API key. This key will be crucial for accessing Humbot's API. Humbot API Basics To test the API, go to the API documentation page and locate the POST section. A POST request is a standard HTTP method used to send data to a server, typically for creating new resources. The server link for Humbot is https://humbot.ai/api/humbot/v1. Click on the "Try it out" button, fill in the necessary information, and execute the request. Humbot offers different modes to process text, including "Quick," "Enhanced," and "Advanced." Let’s use a sample AI-generated text to see how it works: Sample Input Payload: json { "input": "Choosing the perfect gift for someone can be a delightful experience when you consider their preferences and interests. Here’s a guide on how to give a great gift that will be appreciated and cherished: 1. Know the Recipient: Take the time to understand the person you’re buying for. Consider their hobbies, interests, and personality. What makes them happy? 2. Listen and Observe: Pay attention to any hints or mentions of things they want or need. Sometimes, people drop subtle hints about what they’d like as a gift. 3. Consider Practicality: A useful gift can be just as thoughtful as a sentimental one. Think about what would make the recipient’s life easier or more enjoyable.", "model_type": "Quick" } After filling in the fields and hitting the Execute button, you might receive a result like this: Example Result: json { "err_code": 0, "err_msg": "Success", "data": { "input": "Your original text...", "input_words": 122, "task_id": "2c451bac-c5ea-4e77-a21a-23ebc14ba47f", "words_used": 97, "output": "Choosing the perfect present for another requires deep reflection on their passions and pursuits. A guide for bestowing a gift certain to be cherished: 1. Fathoming the recipient... 2. Heed hints and allusions... 3. Pondering usefulness alongside sentiment... ", "subtask_status": "completed", "task_status": true, "detection_result": "human", "detection_score": 100, "mode": "Advanced" } } Data Retrieval Process Each text humanization task has a unique task_id. To retrieve the results of a specific task, navigate to the Retrieve section of the API documentation and set the required parameters, then click Execute to fetch the results. Integrating Humbot API into Your Web Application For developers looking to integrate Humbot’s capabilities into their web applications, the process is straightforward. Below is a sample Next.js API route that acts as a proxy to Humbot's humanizer API: ```javascript export default async function handler(req, res) { if (req.method !== 'POST') { return res.status(405).json({ error: 'Method not allowed' }); } const { input, model_type } = req.body; if (!input || !model_type) { return res.status(400).json({ error: 'Missing input or model_type' }); } try { const HUMBOT_API_KEY = process.env.HUMBOT_API_KEY; const response = await fetch('https://humbot.ai/api/humbot/v1/create', { method: 'POST', headers: { 'Content-Type': 'application/json', 'accept': 'application/json', 'api-key': HUMBOT_API_KEY }, body: JSON.stringify({ input, model_type // Accepts "Quick", "Enhanced", or "Advanced" }) }); const data = await response.json(); if (response.ok && data?.data?.task_id) { res.status(200).json({ taskId: data.data.task_id }); } else { res.status(500).json({ error: data?.error_msg || 'Something went wrong' }); } } catch (err) { console.error('Error calling Humbot API:', err); res.status(500).json({ error: 'Internal server error' }); } } ``` This code only allows POST requests and validates the input. It then sends a POST request to Humbot’s API using the provided API key and returns the task_id to the client if successful. Frontend Integration Example If you’re working on a chat interface, here’s how you can call the above endpoint from your frontend React component: ```javascript const response = await fetch('/api/humanize', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ input: "Your AI-generated text here...", model_type: "Quick" // or "Enhanced", "Advanced" }) }); const data = await response.json(); console.log('Task ID:', data.taskId); ``` Secure API Key Storage Ensure your Humbot API key is stored securely using environment variables. Add the following line to your .env.local file: HUMBOT_API_KEY=your_actual_api_key_here Humbot API Pricing Humbot’s API pricing is based on the number of words processed each month. The entry-level tier costs $49 per month and includes 50,000 words with all features. An annual plan reduces this to $30 per month for the same quota, making it a cost-effective option for consistent usage. Higher tiers cater to larger companies or applications handling high volumes of content: - 1 million words/month: $399 or $249 (annual) - 5 million words/month: $999 or $599 (annual) - 10 million words/month: $1,999 or $1,299 (annual) These tiers offer the same features, ensuring scalability and flexibility. Final Thoughts Adding AI text detection or humanization to your app can significantly enhance user experience and content quality. While there are alternatives like Grammarly or Quillbot, Humbot stands out for its simplicity, speed, and effectiveness. Its API is easy to integrate, and the pricing model is straightforward and scalable. This guide should help developers and non-developers alike understand how to leverage third-party AI services. Remember, you don’t have to build everything from scratch. Tools like Humbot, Cursor, WindSurf, and GitHub Copilot can streamline the process with minimal effort. Integrating AI tools isn’t as daunting as it seems, and the steps outlined here are a solid starting point. Industry experts commend Humbot for its advanced detection algorithms and seamless integration capabilities. Its ability to preserve the original meaning while making text undetectable is particularly valuable for content creators and app developers. Humbot’s commitment to simple and scalable pricing models further solidifies its position as a leading solution in the AI text detection and humanization space. Whether you’re a small indie developer or part of a larger team, Humbot’s API can enhance your project’s efficiency and content quality. Humbot’s user-friendly interface and robust API make it an excellent choice for anyone looking to improve their text processing capabilities. With the growing importance of AI in content creation, tools like Humbot will continue to play a crucial role in maintaining authenticity and enhancing user engagement. Stay connected with Generative AI for the latest news and updates on AI technologies. Subscribe to our newsletter and follow us on LinkedIn and YouTube to join the conversation and shape the future of AI.

Related Links