Authentication & Headers

All API requests to 4tyn B2B endpoints require a valid API key passed via standard HTTP Bearer Authentication headers.

Authorization: Bearer tyn_live_402222e949dcbcb266b97e79985ec5579231bd0217e207f1
Content-Type: application/json

1. Single Text Humanization

POST /api/humanize.php (or /v1/humanize)

Humanizes a single block of AI text, converting passive voice to active, increasing burstiness, and replacing AI-typical keywords.

Request Body Schema

FieldTypeRequiredDescription
textstringYesThe AI-generated text to humanize.
tonestringNoTone preset: natural, academic, seo, executive, creative. (Default: natural)
modestringNoProcessing mode: standard or aggressive.

Code Example (Python)

import requests

url = "https://4tyn.com/api/humanize.php"
headers = {
    "Authorization": "Bearer tyn_live_YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "text": "Furthermore, it is crucial to understand the importance of utilizing comprehensive methodologies.",
    "tone": "natural"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())

2. Bulk Batch Humanization

POST /api/batch.php (or /v1/humanize/batch)

Processes an array of up to 50 text documents in a single HTTP request.

Request Body Schema

{
  "tone": "executive",
  "items": [
    { "id": "doc-1", "text": "Furthermore, it is crucial to leverage robust methodologies." },
    { "id": "doc-2", "text": "It is important to note that the utilization of comprehensive strategies fosters growth." }
  ]
}

3. Usage & Account Balance

GET /api/usage.php (or /v1/usage)

Fetches current tier subscription details, remaining credit balance, rate limits, and audit logs of recent requests.

curl -H "Authorization: Bearer tyn_live_YOUR_API_KEY" https://4tyn.com/api/usage.php

Error Code Reference

HTTP StatusError CodeCause / Resolution
400 Bad RequestMissing parametersInvalid JSON payload or missing required text field.
401 UnauthorizedInvalid API keyMissing or invalid Authorization: Bearer tyn_live_... header.
402 Payment RequiredInsufficient creditsAccount credit balance exhausted. Upgrade tier in developer portal.
429 Too Many RequestsRate limit exceededExceeded minute sliding window limit. Retry after reset_at timestamp.