Integrate RewriteAI's humanization and analysis endpoints into your own application.
This page is the single reference for the RewriteAI API: quick start, endpoints,
examples, errors, rate limits and API keys.
API keys are live. Create one from the
dashboard API section - it is shown once at
creation. The versioned /v1 endpoints require the key; the
original /humanize and
/detect endpoints stay open without one. Rate limits are
enforced (60 requests/minute); paid plans are
live but API usage billing is not enforced yet - see
pricing for API access plans.
Quick Start
The API is a single base URL. Send a POST
request with a JSON body and read the JSON response. The original endpoints
(/humanize,
/detect) need no authorization header; the
versioned /v1 endpoints require
an API key.
Base URL
https://api.rewriteai.site
Your first call can be as simple as the cURL example below. Responses are plain
JSON - see Humanize and
Detect for every field.
With a key, call the versioned /v1 API - same
request body, standard response envelope:
cURL - authenticated /v1
curl -X POST https://api.rewriteai.site/v1/humanize \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Text to humanize"}'
Request examples
Humanize
cURL
curl -X POST https://api.rewriteai.site/humanize \
-H "Content-Type: application/json" \
-d '{"text":"Your text here","mode":"standard","tone":"professional","language":"english"}'
Detect
cURL
curl -X POST https://api.rewriteai.site/detect \
-H "Content-Type: application/json" \
-d '{"text":"Text to analyze"}'
Humanize
JavaScript
const response = await fetch("https://api.rewriteai.site/humanize", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
text: "Your text here",
mode: "standard",
tone: "professional",
language: "english"
})
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || "Request failed");
console.log(data.result, data.time); // time is in milliseconds
Detect
JavaScript
const response = await fetch("https://api.rewriteai.site/detect", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "Text to analyze" })
});
const data = await response.json();
if (!response.ok) throw new Error(data.error || "Request failed");
console.log(data.ai_percentage, data.human_percentage, data.verdict);
Humanize
Python
import requests
response = requests.post(
"https://api.rewriteai.site/humanize",
json={
"text": "Your text here",
"mode": "standard",
"tone": "professional",
"language": "english",
},
timeout=60,
)
data = response.json()
print(data["result"], data["time"]) # time is in milliseconds
Detect
Python
import requests
response = requests.post(
"https://api.rewriteai.site/detect",
json={"text": "Text to analyze"},
timeout=60,
)
data = response.json()
print(data["ai_percentage"], data["human_percentage"], data["verdict"])
Every /v1 request authenticates with a personal
API key sent as a bearer token:
HTTP header
Authorization: Bearer YOUR_API_KEY
Which endpoints require a key
POST /v1/humanize,
POST /v1/detect,
GET /v1/usage - key required. A missing,
invalid, or revoked key answers
401 UNAUTHORIZED.
POST /humanize,
POST /detect - no key required (the original
endpoints the RewriteAI app itself calls).
A valid key also needs a plan with API access (Pro or Business - see
pricing); otherwise the API answers
403 FORBIDDEN with
Your plan does not include API access. Create keys from the
dashboard -> API -> Create API Key -
each key is shown exactly once at creation, see
API Keys.
Authenticated requests count against your plan's usage - see
Usage. Every response carries a
request_id for support.
POST
/humanize
Rewrites submitted text and returns a revised version along with processing metadata.
{
"result": "The rewritten text.",
"model": "llama-3.1-8b-instruct-fp8",
"time": 1903
}
time is the processing duration in milliseconds.
model is the identifier of the model that handled
the request - the value shown is a current example and may change as models are
updated.
Versioned endpoint - POST /v1/humanize
Key required
Same path body and parameters as above, plus the
bearer key. Success answers the
standard /v1 envelope:
usage.words is the canonical word count that was
billed to your plan; model.version is the pinned
humanizer version - pin against it instead of the model id.
Request examples in cURL, JavaScript, Python, and PHP are in
Quick Start.
POST
/detect
Model preview
Analyzes submitted text and returns AI, human, and mixed percentages with an
overall verdict. When no detection model is connected, the endpoint reports that
with a status code rather than inventing a score.
time is the analysis duration in milliseconds.
verdict is the overall label returned by the model
(for example "AI" or
"Human").
The detection model is in preview. If no model is connected, the request
fails with 404 or
501 instead of returning a score - handle
those statuses as "analysis unavailable", not as an error in your input.
Versioned endpoint - POST /v1/detect
Key required
Same path body and parameters as above, plus the
bearer key. Success answers the
standard /v1 envelope with the model's real
signal - never fabricated metrics:
score mirrors
ai_percentage and
label is its stable machine-readable form - the
API never returns confidence or sentence-level values the model did not produce.
Request examples in cURL, JavaScript, Python, and PHP are in
Quick Start.
GET
/v1/usage
Key required
Reports your current period's API usage: requests made, API words consumed, and
the plan pools they count against. Requires an
API key - without one the API
answers 401, because usage is per-key
attribution. The same numbers appear in the
dashboard under API -> Usage.
requests is your key-attributed request count for
period_start...period_end.
api is the API-word pool that
/v1 calls are charged against;
words is your plan's overall word pool (app +
API). requests may be
null if the count could not be read - treat null
as unknown, not as zero.
Errors
Failed requests answer with a status code. The original endpoints
(/humanize,
/detect) return a plain string message;
the /v1 endpoints return the standard
envelope with a stable error code:
400 - legacy endpoint
{
"error": "Text too short"
}
401 - /v1 endpoint
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "A valid API key is required."
},
"request_id": "rw_01M3PM9AM2TZETEFW9YHK5JZ3A"
}
Status
Meaning
400
Missing, invalid, or too-short input.
401
Missing, invalid, or revoked API key on a
/v1 request
(UNAUTHORIZED).
402
Usage limit reached for the current period
(USAGE_LIMIT_REACHED).
403
Your plan does not include API access
(FORBIDDEN).
404 / 501
Unknown endpoint, or the model is not available yet.
429
Rate limited (RATE_LIMITED) -
retry after Retry-After seconds,
see Rate Limits.
500
Server error - retry with backoff.
Unknown paths return a 404 -
{"error": "Not found."} on the original
endpoints, the envelope with NOT_FOUND on
/v1. Treat any response without the
documented fields as a failure; include
request_id when contacting support.
Rate Limits
Live
The API allows 60 requests per minute per endpoint - counted
per API key on /v1 requests and per client IP on
the anonymous /humanize and
/detect endpoints. That is a single safe
baseline for every plan; plan-specific quotas are not in effect yet.
Requests over the limit return 429 with a
Retry-After header telling you how many seconds
remain in the window - wait that long, then retry with backoff.
/v1 responses use the standard error envelope
with error.code = "RATE_LIMITED"; the legacy
endpoints return a plain {"error": "..."} string.
Build with polite defaults: retry with backoff on
429 and
500, and reuse responses instead of re-sending
identical text.
API Keys
Live
Keys are created from the dashboard's API section. Each key is
shown once at creation - copy it immediately; afterwards only
a masked prefix (rw_live_xxxx...) is ever
displayed. The server stores only a SHA-256 hash of the key, so a lost key
cannot be recovered: revoke it and create a replacement.
Enter a name for the key (for example Production app) and choose Create API Key.
Copy the full key from the dialog - it will not be shown again.
Send it as Authorization: Bearer YOUR_API_KEY on every /v1 request.
Revoke keys you no longer use - revocation takes effect immediately.
Up to 5 active keys per account. Each key's row shows its masked prefix,
created date, last used date, and status. Never embed a raw key in client-side
code or commit it to source control.
Yes. The POST /humanize and POST /detect endpoints respond without a key,
and the versioned /v1 endpoints (POST /v1/humanize, POST /v1/detect,
GET /v1/usage) work with an API key. Rate limits are enforced at 60 requests
per minute; paid plans are live, but API usage billing is not enforced yet. This
documentation lists exactly what each endpoint accepts and returns.
Do I need an API key?
For the /v1 endpoints, yes - send Authorization: Bearer YOUR_API_KEY on
every /v1 request. Keys are created from the dashboard's API section and shown
once at creation. The original /humanize and /detect endpoints need no key.
What are the limits?
API access is available on the Pro and Business plans, and each /v1 request
counts against the plan's monthly API-word allowance - an exhausted allowance
answers 402. Rate limits allow 60 requests per minute per endpoint and answer
429 with a Retry-After header. API access is listed on the
pricing page.