Humanization API v2
Authentication
Undetectable.AI uses API keys to allow access to the API. You can get your 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:
apikey: YOUR API KEY GOES HERE
YOUR API KEY GOES HERE
with your personal API key.Testing
Go here to test out your API calls https://humanize.undetectable.ai/docs
Click on an endpoint and then click "try it out".
Humanization
Submit Document
This endpoint allows you to submit text for humanization. We refer to all types of these text inputs as a "document".
https://humanize.undetectable.ai/submit
Query Parameters
Parameter | Required | Description |
---|---|---|
content | Yes | The text you want to humanize Minimum 50 characters. Please keep in mind that the longer the text, the longer it will take to return a response. |
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". |
model | No | Default: v2. The version of AI model used to handle humanization. Valid values are: "v2" and "v11" |
Example Request
curl --location 'https://humanize.undetectable.ai/submit' \
--header 'apikey: 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",
"model": "v11"
}'
Example Response
{
"status": "Document submitted successfully",
"id": "68e4d7e3-5f04-416e-b0d1-9fcf059ea277"
}
Status 400 Payment Required when insufficient word credit balance:
{
"error": "Insufficient credits"
}
Retrieve Document
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.
https://humanize.undetectable.ai/document
Query Parameters
Parameter | Required | Description |
---|---|---|
id | Yes | The ID of the document object submitted for humanization. |
Example Request
curl --location 'https://humanize.undetectable.ai/document' \
--header 'apikey: YOUR API KEY GOES HERE' \
--header 'Content-Type: application/json' \
--data '{
"id": "DOCUMENT ID GOES HERE"
}'
Example Response
javascript{
"id": "aaada2c6-6c3c-40ec-930b-8dd97a2dfa93",
"output": "Ranked as the AI detector according to Forbes magazine! Utilize our AI detector to inspect whether your text will be identified as AI generated material by algorithms.. Afterwards select 'humanize' to erase any traces of AI detection and guarantee that your text sails through all AI detectors, without a hitch.. Our AI text humanizer achieves this by refining your content to align with the standards of human created writing. ",
"input": "Rated #1 Best AI Detector by Forbes! Use our AI detector to check if your text will be flagged as AI-written content. Then, click 'humanize' to remove AI detection and ensure your text will bypass all major AI detectors. Our AI text humanizer does this by enhancing your content to match the quality of human writing.",
"readability": "High School",
"createdDate": "2024-08-28T08:11:32.166000",
"purpose": "Essay"
}
Rehumanize Document
This endpoint allows you to rehumanize a document once.
https://humanize.undetectable.ai/rehumanize
Query Parameters
Parameter | Required | Description |
---|---|---|
id | Yes | The ID of the document object submitted for humanization. |
Example Request
curl --location 'https://humanize.undetectable.ai/rehumanize' \
--header 'apikey: YOUR API KEY GOES HERE' \
--header 'Content-Type: application/json' \
--data '{
"id": "DOCUMENT ID GOES HERE"
}'
Example Response
javascript{
"status": "Document submitted successfully",
"id": "5e1e4d7d-df9d-4756-81ad-63fc5e1e7a7d"
}
You can now query the /document
endpoint with the new id
.
List Documents
This endpoint allows you to query all your documents.
https://humanize.undetectable.ai/list
Query Parameters
Parameter | Required | Description |
---|---|---|
offset | Optional | By default the request returns 10 newest documents sorted by createdDate |
Example Request
curl --location 'https://humanize.undetectable.ai/list' \
--header 'apikey: YOUR API KEY GOES HERE' \
--header 'Content-Type: application/json' \
--data '{
// "offset": 20 <- optional
}'
Example Response
javascript{
"pagination": false,
"documents": [
{
"id": "22e6ac97-c79d-4a09-989d-ea091ab6ecf2",
"output": "One of the takeaways from the Scientific Method Tutorial is the importance placed on crafting a precise and testable hypothesis and grasping the difference between independent and dependent variables thoroughly. When setting up experiments accurately to explore relationships this clarity proves invaluable. On the side a significant hurdle in applying the scientific method lies in guarantee that all potential confounding variables are managed effectively. Even slight deviations, in conditions can influence outcomes significantly highlighting the need to carefully structure experiments to address these variables meticulously. Conducting research studies to verify dependability may require a significant investment of resources. ",
"input": "Most Useful Part: The most useful part of the Scientific Method Tutorial is the emphasis on forming a clear and testable hypothesis and understanding the distinction between independent and dependent variables. This clarity helps in structuring experiments effectively to focus on specific relationships. Most Challenging Aspect: One of the more challenging aspects of the scientific method is ensuring that all potential confounding variables are controlled. Even minor variations in external factors can impact results, making it critical to design experiments that meticulously account for these variables. Additionally, replicating studies to ensure reliability can be resource-intensive.",
"readability": "University",
"createdDate": "2024-08-17T07:44:15.688000",
"purpose": "General Writing"
},
{
"id": "aaada2c6-6c3c-40ec-930b-8dd97a2dfa93",
"output": "Ranked as the AI detector according to Forbes magazine! Utilize our AI detector to inspect whether your text will be identified as AI generated material by algorithms.. Afterwards select 'humanize' to erase any traces of AI detection and guarantee that your text sails through all AI detectors, without a hitch.. Our AI text humanizer achieves this by refining your content to align with the standards of human created writing. ",
"input": "Rated #1 Best AI Detector by Forbes! Use our AI detector to check if your text will be flagged as AI-written content. Then, click 'humanize' to remove AI detection and ensure your text will bypass all major AI detectors. Our AI text humanizer does this by enhancing your content to match the quality of human writing.",
"readability": "High School",
"createdDate": "2024-08-28T08:11:32.166000",
"purpose": "Essay"
},
{
"id": "65b148fa-4396-49fe-9462-4f6a7ce520f8",
"output": "Ranked as the number one AI detection tool according to Forbes! Utilize our AI detector to verify if your text is at risk of being identified as machine generated content by algorithms. Afterward simply select 'transform into human text' to eliminate any traces of AI detection and guarantee that your writing will go undetected, by all leading AI detectors. Our tool enhances your content to reflect the authenticity and quality of human authored writing. ",
"input": "Rated #1 Best AI Detector by Forbes! Use our AI detector to check if your text will be flagged as AI-written content. Then, click 'humanize' to remove AI detection and ensure your text will bypass all major AI detectors. Our AI text humanizer does this by enhancing your content to match the quality of human writing.",
"readability": "High School",
"createdDate": "2024-08-28T08:11:29.928000",
"purpose": "Essay"
},
{
"id": "5e1e4d7d-df9d-4756-81ad-63fc5e1e7a7d",
"output": "Ranked as the AI detection tool according to Forbes magazine! Utilize our AI detector to assess whether your text might be identified as AI generated material by algorithms in use today. Tap on 'humanize’ to eliminate any AI flags and ensure that your content sails, through AI detectors seamlessly. Our AI text enhancer will refine your content to emulate the quality of human authored writing. ",
"input": "Rated #1 Best AI Detector by Forbes! Use our AI detector to check if your text will be flagged as AI-written content. Then, click 'humanize' to remove AI detection and ensure your text will bypass all major AI detectors. Our AI text humanizer does this by enhancing your content to match the quality of human writing.",
"readability": "High School",
"createdDate": "2024-08-23T08:00:16.157000",
"purpose": "Essay"
}
]
}
If pagination returns with True
, it means the user has more than 10 documents, and you can get those by changing the offset
parameter.
A simple loop logic could be
pulling all documents without an offset parameter,
if pagination is True, send requests like
i+10
until pagination is False
to get all documents
Hand-over
Hand-over Document
This endpoint allows you to submit text for hand-over to the Undetectable UI
https://humanize.undetectable.ai/handover
Query Parameters
Parameter | Required | Description |
---|---|---|
content | Yes | The text you want to humanize Minimum 50 characters. Please keep in mind that the longer the text, the longer it will take to return a response. |
Example Request
curl --location 'https://humanize.undetectable.ai/submit' \
--header 'apikey: 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.",
}'
Example Response
{
"content": "YOUR TEXT GOES HERE. PLEASE MAKE SURE IT IS AT LEAST 50 CHARACTERS LONG.",
"id": "68e4d7e3-5f04-416e-b0d1-9fcf059ea277"
}
Remember: The returned document object will contain an id. You should send this id as a parameter to the url at https://undetectable.ai/detector-humanizer?handoverId=$DOCUMENT_ID
Check User Credits
This endpoint accepts the users apikey via the header. And returns users credit details.
https://humanize.undetectable.ai/check-user-credits
Example Request
curl -X 'GET' \
'https://humanize.undetectable.ai/check-user-credits' \
-H 'apikey: YOUR API KEY GOES HERE' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
Example Response
{
"baseCredits": 10000,
"boostCredits": 1000,
"credits": 11000
}
Streaming Support for Humanization
Streaming support for Humanizer runs on top of a WebSocket-based protocol.
Here are the necessary steps needed to stream Humanization results for your text.
- Connect to the WebSocket
- Listen for all events received from the WebSocket
- Send a document_watch request
- Receive a document_id event
- Take the id generated by the document_id response and submit a document for Humanization
- Start receiving document_chunk events. document_chunk events will return each Humanized chunk
- When the document finishes processing, you will receive a document_done event.
This section will describe the necessary steps to connect, send a document for processing, and listen to the Humanization stream until it finishes.
Connect to the WebSocket
This endpoint allows you to establish the WebSocket connection
https://humanize.undetectable.ai/ws/$USER_ID
Example code:
ws = new WebSocket("wss://humanize.undetectable.ai/ws/1722238709737x2194626580942121212");
Listen for all events received from the WebSocket
Once the WebSocket connection is established, listen to events sent through the WebSocket connection.
Example code:
ws.addEventListener("message", (event) => {
console.log("Message from server ", event.data);
});
Send a document_watch request
Send interest in sending a document by sending a document_watch request on the WebSocket
Example code:
ws.send(JSON.stringify({
"event_type": "document_watch",
"api_key": "$API_KEY",
}))
Receive a document_id event
After sending a document_watch event, the server returns a document_id event.
Example response:
{
"event_type": "document_id",
"success": true,
"document_id": "512da191-166926922-44cb-81c6-191ae3a807aa"
}
Submit document Humanization Request
Take the id generated by the document_id response and submit a document for Humanization
https://humanize.undetectable.ai/submit
Example Request
curl -X 'POST' \
'https://humanize.undetectable.ai/submit' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"content": "YOUR TEXT GOES HERE. PLEASE MAKE SURE IT IS AT LEAST 50 CHARACTERS LONG.",
"readability": "High School",
"purpose": "General Writing",
"strength": "More Human",
"model": "v11"
"id": "512da191-166926922-44cb-81c6-191ae3a807aa"
}'
Example Response
{
"status": "Document submitted successfully",
"id": "68e4d7e3-5f04-416e-b0d1-9fcf059ea277"
}
Receive sentence level results
Start receiving document_chunk events. document_chunk events will return each sentence together with the sentence level result
Example responses:
{
"event_type":"document_chunk",
"document_id":"9605dc9f-85e7-4a2a-9691-62a9ad264592",
"model":"v11",
"chunk":"The evolution of design education requires an interdisciplinary approach which maintains its foundation in human-centered design and sustainability "
}
When the document finishes processing, you will receive a document_done event.
Example responses:
{
"event_type":"document_done",
"document_id":"9605dc9f-85e7-4a2a-9691-62a9ad264592",
"model":"v11",
"chunk":"of tomorrow.\n"
Below is an example sequence as returned by the WS stream.
Handling exceptional circumstances
If for some reason the server encounters an error while doing the humanization, a document_error event will be sent to the websocket client. The client should act as appropriate, for example a UI will show an error message.
For example, the server will send a REQUEST_TIMEOUT error code when it takes more than 20 seconds across chunk events.
{
"event_type": "document_error",
"document_id": "512da191-166926922-44cb-81c6-191ae3a807aa"
"error_code": "REQUEST_TIMEOUT",
"message": "Request timeout. Took 20 seconds.",
}
Cancellations
There will be instances when the UI would want to cancel the operation. The user decides to close the window, or cancels the event explicitly
When this happens you should sent a document_halt event
Example responses:
{
"event_type": "document_halt",
"document_id": "512da191-166926922-44cb-81c6-191ae3a807aa"
}
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. |
Updated on: 02/07/2025
Thank you!