API documentation
Rephrase API
Humanize your AI texts from your scripts, your products, your automations (n8n, Make, Zapier). Same credits as on the web, no extra subscription.
TL;DR
- 1. Create an account and buy a credit pack.
- 2. Generate an API key from
/dashboard/api-keys. - 3. Send your text with a POST to
/v1/api/humanizewith the headerAuthorization: Bearer rph_live_.... - 4. Get the humanized text back as JSON. Cost: 1 credit per 100 words.
1. Base URL
Every public request starts from:
https://api.rephrase.frAll API endpoints are prefixed with /v1/api/. The API is versioned: v1 is stable and comes with at least 12 months of support after any breaking change.
2. Authentication
The API uses Bearer API keys. Create one from your dashboard, copy it once (it is never shown again), then pass it on every request:
Authorization: Bearer rph_live_xxxxxxxxxxxxxxxxxxxxxxxxKey format: rph_live_ followed by 48 hex characters. Keys are unique and can be revoked at any time from your dashboard.
Never expose your key on the client side. Every request to the API must come from a backend you control. A key leaked in a JavaScript bundle must be revoked immediately.
3. Humanize a text
/v1/api/humanizeParameters (JSON body)
| Field | Type | Required | Description |
|---|---|---|---|
inputText | string | required | Text to humanize (3 to 8,000 words). |
presetSlug | string | optional | Slug of a preset. See GET /v1/public/presets. |
customVoiceId | number | optional | ID of a custom voice. Create it via POST /v1/api/voices. |
curl example
curl -X POST https://api.rephrase.fr/v1/api/humanize \
-H "Authorization: Bearer rph_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"inputText": "Il est important de noter que...",
"presetSlug": "web_article_seo"
}'Node.js example (fetch)
const res = await fetch('https://api.rephrase.fr/v1/api/humanize', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.REPHRASE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
inputText: 'Votre texte IA ici...',
presetSlug: 'web_article_seo'
})
});
if (!res.ok) {
const err = await res.json();
throw new Error(err.error);
}
const data = await res.json();
console.log(data.output);Python example (requests)
import os, requests
resp = requests.post(
'https://api.rephrase.fr/v1/api/humanize',
headers={
'Authorization': f'Bearer {os.environ["REPHRASE_API_KEY"]}',
'Content-Type': 'application/json'
},
json={
'inputText': 'Votre texte IA ici...',
'presetSlug': 'web_article_seo'
}
)
resp.raise_for_status()
print(resp.json()['output'])Response (200 OK)
{
"humanizationId": 12345,
"output": "Votre texte, humanisé et prêt à publier.",
"creditsUsed": 3,
"wordCount": 287,
"balance": 197,
"modelUsed": "rephrase-fr-balanced"
}502 provider_error with { refunded: 3 }.4. Managing voices
A voice (Custom Voice) is a stylistic signature extracted from 3 to 5 of your texts. Once created, reuse it in every humanization via customVoiceId.
Create a voice
/v1/api/voicescost: 1 analysis creditcurl -X POST https://api.rephrase.fr/v1/api/voices \
-H "Authorization: Bearer rph_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "moi-linkedin",
"samples": [
"Premier texte que j\'ai écrit, 100+ mots...",
"Deuxième texte...",
"Troisième texte..."
]
}'Constraints: 3 to 5 samples, 300 words minimum in total. Texts are encrypted at rest (AES-256-GCM) and are never sent to a subprocessor beyond the initial analysis.
List your voices
/v1/api/voices5. Check your credits
/v1/api/me/credits{
"balance": 197,
"lifetime_purchased": 500,
"lifetime_used": 303,
"lifetime_gifted": 3
}6. Error codes
| HTTP code | error | Meaning |
|---|---|---|
| 400 | invalid_body | Invalid or missing body. |
| 400 | text_too_short | Text shorter than 3 words. |
| 400 | text_too_long | Text longer than 8,000 words. |
| 401 | unauthorized | API key invalid, missing or revoked. |
| 402 | insufficient_credits | Balance too low for this request. |
| 422 | content_filter | Content rejected by the provider's moderation filter. No refund. |
| 429 | rate_limited | Too many requests on the key. Wait 60 seconds. |
| 502 | provider_error | AI provider failure. Credits are refunded automatically. |
| 500 | internal_error | Unexpected error on the Rephrase side. Let us know. |
7. Rate limits
30 requests per minute per API key, across all endpoints. If you go over, the API returns 429 rate_limited.
The standard response headers RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (IETF draft) are exposed. For high-volume usage, parallelize across several keys (1 per service/script).
8. Best practices
- Store the key in an environment variable, never in your source code or a git repo. Use
process.env.REPHRASE_API_KEYor the equivalent. - One key per service, not a shared key. If one service is compromised, you only revoke its own key.
- Always check the HTTP code before handling the response. On a
502 provider_error, retry after 2-3 seconds (the credits have already been refunded). - Batch your requests in series, not in a massive parallel burst. 30 req/min is 1 every 2 seconds. For 1,000 texts, plan for about 35 minutes.
- Watch your balance via
GET /v1/api/me/creditsin your long-running jobs, to get ahead of a402 insufficient_credits.
Ready to integrate Rephrase?
Create an account in 30 seconds, no credit card. Buy a pack whenever you are ready.