API Reference

Integrate Code Humanizer into your workflow. Available on Pro and Enterprise plans.

Authentication

All API requests require a Bearer token. Get your token by logging in through the API or the web dashboard.

Authorization: Bearer your_api_token_here

Base URL

https://api.codehumanizer.com/api

Endpoints

Humanize code

POST /api/humanize

Transform AI-generated code into human-looking code.

Request body:

ParameterTypeDescription
codestring requiredThe source code to humanize
languagestring optionalProgramming language: "python", "javascript", "java", "c". Auto-detected if omitted.
sliderinteger optionalIntensity level: 20, 40, 60, 80, or 100. Default: 60
personastring optionalDeveloper persona: "junior_dev", "senior_dev", "messy_coder", "night_owl". Default: "junior_dev"

Example request (Python):

import requests

response = requests.post(
    "https://api.codehumanizer.com/api/humanize",
    headers={"Authorization": "Bearer your_token_here"},
    json={
        "code": "def add(a, b):\n    result = a + b\n    return result",
        "language": "python",
        "slider": 60,
        "persona": "junior_dev"
    }
)

data = response.json()
print(data["code"])

Example request (JavaScript):

const response = await fetch("https://api.codehumanizer.com/api/humanize", {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer your_token_here"
    },
    body: JSON.stringify({
        code: "const sum = (a, b) => a + b;",
        language: "javascript",
        slider: 40,
        persona: "senior_dev"
    })
});

const data = await response.json();
console.log(data.code);

Example request (cURL):

curl -X POST https://api.codehumanizer.com/api/humanize \
  -H "Authorization: Bearer your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"code": "x = 1\ny = 2\nz = x + y", "slider": 60}'

Example response:

{
    "code": "def add(a, b):\n    resukt = a + b\n    return resukt",
    "original": "def add(a, b):\n    result = a + b\n    return result",
    "rename_map": {"result": "resukt"},
    "slider": 60,
    "persona": "junior_dev"
}

Get usage

GET /api/usage

Check your remaining API calls for today.

{
    "used": 12,
    "limit": 1000,
    "remaining": 988,
    "plan": "pro"
}

Sign up

POST /api/auth/signup

Create a new account and get an API token.

{
    "email": "dev@example.com",
    "username": "devuser",
    "password": "securepassword123"
}

Log in

POST /api/auth/login

Authenticate and receive a JWT token.

Rate limits

PlanRequests/dayRate limit
Free155 req/min
Pro1,00060 req/min
EnterpriseUnlimited300 req/min

Error codes

CodeStatusDescription
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid API token
429Too Many RequestsDaily limit or rate limit exceeded
500Server ErrorInternal processing error