NAV
shell python javascript

Introduction

Welcome to the Undetectable.AI API! You can use our API to access humanization API endpoints, which can turn your flagged AI generated content into high quality text, indistinguishable from human writing. This can make your content more engaging and natural for readers.

We have example code in Shell, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

This API allows you to submit content, list your documents, and retrieve documents by their IDs.

Rate Limits

A rate limit of 3 requests per second, per IP address is enforced. If you need a higher limit, contact our team at [email protected].

Document Processing Time

On average, documents take 10 seconds to process. For best results, you should check if a document is processed every 30 seconds after submission.

Pricing

The cost of processing each document is the same as that found on the web platform. Your account's word credits are used directly and so if you receive a message warning you that you need more words to process a document, you will need to purchase additional words through the platform.

In effect, this API allows you to access the same functionality that you would find on the platform.

Authentication

To authorize, use this code:

import requests

url = "api_endpoint_here"
headers = {
  'api-key': 'YOUR API KEY GOES HERE',
  'Content-Type': 'application/json'
}
# With shell, you can just pass the correct header with each request
curl --location 'api_endpoint_here' \
--header 'api-key: YOUR API KEY GOES HERE'
var myHeaders = new Headers();
myHeaders.append("api-key", "YOUR API KEY GOES HERE");

Make sure to replace YOUR API KEY GOES HERE with your API key.

Undetectable.AI uses API keys to allow access to the API. You can register a new UD API key at our developer portal.

UD expects for the API key to be included in all API requests to the server in a header that looks like the following:

api-key: YOUR API KEY GOES HERE

Humanization

Submit Document

import requests
import json

url = "https://api.undetectable.ai/submit"

payload = json.dumps({
  "content": "YOUR TEXT GOES HERE. PLEASE MAKE SURE IT IS AT LEAST 50 CHARACTERS LONG.",
  "readability": "High School",
  "purpose": "General Writing",
  "strength": "More Human"
})
headers = {
  'api-key': 'YOUR API KEY GOES HERE',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://api.undetectable.ai/submit' \
--header 'api-key: YOUR API KEY GOES HERE' \
--header 'Content-Type: application/json' \
--data '{
    "content": "YOUR TEXT GOES HERE. PLEASE MAKE SURE IT IS AT LEAST 50 CHARACTERS LONG.",
    "readability": "High School",
    "purpose": "General Writing",
    "strength": "More Human"
}'
var myHeaders = new Headers();
myHeaders.append("api-key", "YOUR API KEY GOES HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "content": "YOUR TEXT GOES HERE. PLEASE MAKE SURE IT IS AT LEAST 50 CHARACTERS LONG.",
  "readability": "High School",
  "purpose": "General Writing",
  "strength": "More Human"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.undetectable.ai/submit", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Status 200 Success with document object returned:

{
    "id": "1679859279880x594414676479736700",
    "input": "Your document input text will go here.",
    "readability": "High School",
    "purpose": "General Writing",
    "strength": 2,
    "cost": 26,
    "status": "queued",
    "created": 1679859279885
}

Status 402 Payment Required when insufficient word credit balance:

{
    "status": "Insufficient Word Balance"
}

This endpoint allows you to submit text for humanization. We refer to all types of these text inputs as a "document".

HTTP Request

POST https://api.undetectable.ai/submit

Query Parameters

Parameter Required Description
content Yes The text you want to humanize Minimum 50 characters. Maximum 15,000 characters.
readability Yes One of the following values: "High School", "University", "Doctorate", "Journalist", "Marketing"
purpose Yes One of the following values: "General Writing", "Essay", "Article", "Marketing Material", "Story", "Cover Letter", "Report", "Business Material", "Legal Material"
strength No One of the following values: "Quality", "Balanced", "More Human". Increases aggressiveness of humanization algorithms. Default is "Balanced".

Retrieve Document

import requests
import json

url = "https://api.undetectable.ai/document"

payload = json.dumps({
  "id": "DOCUMENT ID GOES HERE"
})
headers = {
  'api-key': 'YOUR API KEY GOES HERE',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://api.undetectable.ai/document' \
--header 'api-key: YOUR API KEY GOES HERE' \
--header 'Content-Type: application/json' \
--data '{
    "id": "DOCUMENT ID GOES HERE"
}'
var myHeaders = new Headers();
myHeaders.append("api-key", "YOUR API KEY GOES HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "id": "DOCUMENT ID GOES HERE"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.undetectable.ai/document", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Status 200 Success with document object returned:

{
    "id": "1679859279880x594414676479736700",
    "input": "Your document input text will go here.",
    "output": "Humanized content will appear here.",
    "readability": "High School",
    "purpose": "General Writing",
    "strength": 2,
    "cost": 26,
    "status": "done",
    "created": 1679859279885
}

This endpoint allows you to retrieve the document object for a submitted piece of content. It is recommended you save locally the ID of the document you submitted to prevent unnecessary calls of the list endpoint.

HTTP Request

POST https://api.undetectable.ai/document

Query Parameters

Parameter Required Description
id Yes The ID of the document object submitted for humanization.

List Documents

import requests
import json

url = "https://api.undetectable.ai/list"

payload = json.dumps({
  "page": "0"
})
headers = {
  'api-key': 'YOUR API KEY GOES HERE',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
curl --location 'https://api.undetectable.ai/list' \
--header 'api-key: YOUR API KEY GOES HERE' \
--header 'Content-Type: application/json' \
--data '{
    "page": "0"
}'
var myHeaders = new Headers();
myHeaders.append("api-key", "YOUR API KEY GOES HERE");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "page": "0"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.undetectable.ai/list", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Status 200 Success with document ID list returned:

{
    "documents": [
        "1679442132612x421836391157156350",
        "1679615690389x604091256678311200",
        ...,
        "1679836748507x629222237725197300",
        "1679837098619x775076422364691600"
    ]
}

This endpoint allows you to retrieve the IDs of documents associated with your account. It is ordered by created time descending. Specifying the page allows you to navigate through lots of documents using pagination.

HTTP Request

POST https://api.undetectable.ai/list

Query Parameters

Parameter Required Description
page Yes The page number for pagination. Starts at 0. Each page contains upto 250 documents.

Errors

The generic error codes we use conform to the REST standard:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
402 Payment Required -- You're out of words.
403 Forbidden -- The API key doesn't have permission to access the requested resource.
404 Not Found -- The specified resource doesn't exist.
405 Method Not Allowed -- You tried to access a resource with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The resource at this end point has been removed.
429 Too Many Requests -- You're sending too many requests! Slow it down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.