API Reference
API Documentation
Integrate paraphrasing, grammar checking, summarization, AI detection, and translation into your applications.
Base URL
https://api.writingbot.ai
Authentication
All API requests require an API key sent via the X-API-Key header.
Example Request Header
curl -X POST https://api.writingbot.ai/v1/paraphrase/ \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"text": "Your text here"}'
Rate Limits
| Plan | Requests / Hour | Word Limit / Request |
|---|---|---|
| Free | 100 | 500 words |
| Premium | 1,000 | Unlimited |
Rate limit headers are included in every response: X-RateLimit-Remaining, X-RateLimit-Reset.
Error Handling
Errors return JSON with an error field and an appropriate HTTP status code.
| Code | Meaning |
|---|---|
400 | Bad Request -- Missing or invalid parameters |
401 | Unauthorized -- Invalid or missing API key |
403 | Forbidden -- Limit exceeded (upgrade required) |
429 | Too Many Requests -- Rate limit exceeded |
500 | Internal Server Error -- Try again later |
Error Response Example
{
"error": "Free API users are limited to 500 words per request.",
"upgrade": true
}
POST
/v1/text/paraphrase/
Paraphrase text with customizable modes and synonym levels.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to paraphrase |
mode | string | No | standard, fluency, formal, academic, simple, creative, expand, shorten (default: standard) |
synonym_level | integer | No | 1-5, controls word replacement aggressiveness (default: 3) |
language | string | No | ISO language code for output (default: en) |
Request
{
"text": "The cat sat on the mat.",
"mode": "formal",
"synonym_level": 4
}
Response (200)
{
"output_text": "The feline was seated upon the mat.",
"input_word_count": 7,
"output_word_count": 8,
"mode": "formal"
}
POST
/v1/text/grammar/
Check text for grammar, spelling, and punctuation errors.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to check |
language | string | No | ISO language code (default: en) |
Request
{
"text": "She dont like apples."
}
Response (200)
{
"corrected_text": "She doesn't like apples.",
"corrections": [
{
"original": "dont",
"corrected": "doesn't",
"type": "grammar",
"message": "Use 'doesn't' with third person singular."
}
],
"score": 72
}
POST
/v1/text/summarize/
Summarize long text into key points or a concise paragraph.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to summarize |
mode | string | No | "paragraph" or "key_sentences" (default: paragraph) |
length | integer | No | Summary length percentage 10-100 (default: 50) |
language | string | No | ISO language code (default: en) |
Request
{
"text": "Long article text here...",
"mode": "key_sentences",
"length": 30
}
Response (200)
{
"summary": "Key point 1. Key point 2.",
"input_word_count": 450,
"mode": "key_sentences"
}
POST
/v1/text/ai-detect/
Detect whether text was written by AI or a human.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to analyze |
Request
{
"text": "Text to analyze..."
}
Response (200)
{
"ai_score": 0.85,
"label": "Likely AI-generated",
"sentences": [
{
"text": "First sentence.",
"ai_probability": 0.9
}
]
}
POST
/v1/text/translate/
Translate text between 50+ languages.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to translate |
source_lang | string | No | Source language ISO code or "auto" (default: auto) |
target_lang | string | Yes | Target language ISO code (e.g. "es", "fr", "de") |
Request
{
"text": "Hello, how are you?",
"target_lang": "es"
}
Response (200)
{
"translated_text": "Hola, como estas?",
"source_lang": "auto",
"target_lang": "es",
"character_count": 19
}
Code Examples
Python
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.writingbot.ai/v1/text"
response = requests.post(
f"{BASE_URL}/paraphrase/",
headers={
"Content-Type": "application/json",
"X-API-Key": API_KEY,
},
json={
"text": "The quick brown fox jumps over the lazy dog.",
"mode": "formal",
"synonym_level": 3,
}
)
data = response.json()
print(data["output_text"])
JavaScript (Node.js)
const response = await fetch("https://api.writingbot.ai/v1/paraphrase/", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
body: JSON.stringify({
text: "The quick brown fox jumps over the lazy dog.",
mode: "formal",
}),
});
const data = await response.json();
console.log(data.output_text);
cURL
curl -X POST https://api.writingbot.ai/v1/grammar/ \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"text": "She dont like apples."}'