Developers
RewriteIQ API
REST · JSON · Authenticate with client_key in the request body. Humanize text from your backend with one endpoint.
Enterprises: for volume pricing, contact partners@rewriteiq.com.
Authentication
Include your API key as client_key in the JSON body. Create and rotate keys in Account → API. Never ship keys in frontend code.
Request body
{
"text": "Content to process",
"client_key": "riq_sk_your_key_here",
"style": "professional",
"context": "blog post"
}POST
/api/rewrite
Rewrite and humanize text. Credits are billed per input word (2× for enhanced depth).
| Parameter | Type | Description |
|---|---|---|
| text * | string | Input text. Max 100,000 chars / 5,000 words. |
| client_key * | string | Your API key. |
| style * | string | "general" · "academic" · "formal" · "professional" · "conversational" · "scholar" |
| context * | string | Use case, e.g. essay, thesis, report, email. |
| language | string | Output language. Default: english. |
| depth | string | standard (default) or enhanced (2× credits). |
| stream | boolean | Stream as newline-delimited JSON. Default: false. |
| restructure | boolean | Light sentence restructuring. Default: false. |
| voice_profile | string | 150-250 word description of target writing style. |
| preserve_markdown | boolean | Keep markdown formatting. Default: false. |
| ultra_mode | boolean | Advanced processing mode. Default: false. |
| settings | object | locked_phrases, preserve_citations, formality, variation, length_tolerance. |
Request
curl -X POST https://rewriteiq.com/api/rewrite \
-H "Content-Type: application/json" \
-d '{
"text": "The findings suggest a correlation between variables.",
"client_key": "riq_sk_your_key",
"style": "academic",
"context": "research paper",
"language": "english",
"depth": "standard"
}'Non-streaming response
200 OK
{
"result": "The results indicate a relationship between the variables.",
"config": {
"style": "academic",
"context": "research paper",
"language": "english",
"depth": "standard",
"stream": false,
"restructure": false,
"voice_profile": null,
"preserve_markdown": false,
"ultra_mode": false,
"settings": {
"locked_phrases": [],
"preserve_citations": true,
"formality": 50,
"variation": 50,
"length_tolerance": 20
}
}
}Streaming response
Content-Type: application/x-ndjson. One JSON object per line. Sort by index, join humanized.
{"index":0,"original":"First sentence.","humanized":"Rewritten sentence."}
{"index":1,"original":"Second sentence.","humanized":"Another rewrite."}POST
/api/usage
Check account credit balance and feature flags.
Request
curl -X POST https://rewriteiq.com/api/usage \
-H "Content-Type: application/json" \
-d '{ "client_key": "riq_sk_your_key" }'200 OK
{
"credits_remaining": 48200,
"credits_used": 1800,
"enhanced_enabled": true
}Errors
All errors return { "error": "...", "code": "..." }.
| Status | Code | Description |
|---|---|---|
| 403 | INVALID_KEY | API key missing or not recognised. |
| 403 | FORBIDDEN | Active Pro subscription required. |
| 403 | INSUFFICIENT_CREDITS | Account balance too low. |
| 403 | ENHANCED_NOT_ENABLED | Enhanced depth not enabled for this account. |
| 413 | PAYLOAD_TOO_LARGE | Text exceeds maximum size. |
| 422 | MISSING_FIELD | Required field missing or invalid. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests. Retry after a short delay. |
| 500 | SERVER_ERROR | Unexpected error. Safe to retry with backoff. |
Billing
- 1 credit per input word · enhanced depth = 2×
- Max text: 100,000 chars · 5,000 words
- Uses your RewriteIQ Pro subscription / pack word balance