LOGO

API Documentation

Introduction

Getting Started

Welcome to the Humanize-AI-Text API! This tool converts AI-generated text into Humanized text passing AI Detectors. You’ll learn how to make it work with your projects, use different features, and get results fast.

Authentication

The Humanize-AI API uses API keys to authenticate requests. You can view and manage your API keys in the Account Dashboard.

To authenticate an API request, you should provide your API key in your environemnt configuration.

For Example:


HUMANIZED_AI_API_KEY: YOUR_API_KEY

Rate Limits

To ensure fair usage and maintain system stability, the Humanize-AI-Text API has rate limits in place. These limits prevent excessive requests from a single user or application, helping us deliver consistent and reliable service to all our users.

Each user is allowed a certain 100 requests per minute. If you exceed this limit, your additional requests will be temporarily blocked until the limit resets. It's important to manage your requests wisely and consider these limits when integrating the API into your application.

If you need higher limits for your project, please contact our support team to discuss upgrade options.

Usage Metrics

Our usage metrics allow you to easily track how many requests you've made to the Humanize-AI-Text API and see the current cost associated with your usage. This helps you manage your usage effectively and keep an eye on expenses. You can access these metrics anytime through your user dashboard.

API Usage

Request

To send text to the Humanize-AI-Text API and receive humanized text in response, use the following examples.

Replace YOUR_API_KEY with your actual API key and YOUR_TEXT_HERE with the text you want to humanize.

JavaScript

fetch('https://api.humanize-ai-text.com/v1/humanize', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    text: 'YOUR_TEXT_HERE'
  })
})
.then(response => response.json())
.then(data => console.log('Humanized Text:', data))
.catch(error => console.error('Error:', error));

Python

import requests

url = 'https://api.humanize-ai-text.com/v1/humanize'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
data = {
'text': 'YOUR_TEXT_HERE'
}

response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
print('Humanized Text:', response.json())
else:
print('Error:', response.status_code, response.text)

Java v11+

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper; // JSON library

public class Main {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.humanize-ai-text.com/v1/humanize"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_API_KEY")
            .POST(HttpRequest.BodyPublishers.ofString(new ObjectMapper().writeValueAsString(Map.of("text", "YOUR_TEXT_HERE"))))
            .build();

        client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
            .thenApply(HttpResponse::body)
            .thenAccept(System.out::println)
            .join();
    }
}

Response

Below is an example of a response object received from the Humanize-AI-Text API after submitting text for humanization.

The response object includes the original text sent, the humanized text returned, and a success status indicator.

{
  "success": true,
  "input_words": 10000,
  "output_words": 94857,
  "humanizedText": "Here is the humanized version of your input text."
}

SDKs

Python SDK

Our Python SDK provides an easy way to integrate Humanize AI Text into your Python projects.

Installation

Install the SDK using pip:

pip install humanize-ai-text

Usage

from humanize_ai_text import HumanizedAI

humanizer = HumanizedAI(api_key='your-api-key-here')

try:
    result = humanizer.run('Your text to humanize goes here.')
    print(result['humanizedText'])
except Exception as e:
    print(f"An error occurred: {str(e)}")

For more details, including error handling and API reference, please visit our Python SDK GitHub Repository or the PyPI package page.

Node.js SDK

Our Node.js SDK allows you to easily integrate Humanize AI Text into your JavaScript and TypeScript projects. Installation Install the SDK using npm, yarn, pnpm, or bun:

npm install humanize-ai-text
# or
yarn add humanize-ai-text
# or
pnpm add humanize-ai-text
# or
bun add humanize-ai-text

Usage

Here's a simple example of how to use the Node.js SDK:

import HumanizedAI from "humanize-ai-text";
// The SDK will automatically use the HUMANIZED_AI_API_KEY environment variable
const humanizer = new HumanizedAI();

// Alternatively, you can pass the API key directly:
// const humanizer = new HumanizedAI({ apiKey: "your-api-key-here" });

async function humanizeText() {
  try {
    const result = await humanizer.run("Your text to humanize goes here.");
    console.log(result.humanizedText);
  } catch (error) {
    console.error(error);
  }
}

humanizeText();

The SDK automatically uses the HUMANIZED_AI_API_KEY environment variable if set. For more details, including TypeScript support, error handling, and API reference, please visit our Node.js SDK GitHub Repository or the npm package page.

Errors

HTTP Status Code Summary

200OK - Everything worked as expected.
400Bad Request - The request was unacceptable, often due to missing a required parameter.
401Unauthorized - No valid API key provided.
403Forbidden - The API key doesn’t have permissions to perform the request.
404Not Found - The requested resource doesn’t exist.
409Conflict - The request conflicts with another request (perhaps due to using the same idempotent key).
429Too Many Requests - Too many requests hit the API too quickly. An exponential backoff of your requests is recommended.
500, 502, 503, 504Server Errors - Something went wrong on the server's end. These are rare.

Error Types

API uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success, 4xx range indicate client errors, and 5xx range indicate server errors.

Some 4xx errors that could be handled programmatically (e.g., a request is declined) include an error code that briefly explains the reported issue.