API Documentation
Integrate voice-preserving grammar correction into your application.
POST
/v1/checkCheck Grammar
Submit text for grammar correction. Returns corrected text with voice drift score, diff, and issues found.
Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| X-API-Key | hg_your_api_key | Yes |
Request Body
{
"text": "Their going to the store becuz they needs more supplys.",
"aggressiveness": 1,
"tenant_id": "your-tenant-id"
}Example Request
curl -X POST https://human-grammar-api.fly.dev/v1/check \
-H "Content-Type: application/json" \
-H "X-API-Key: hg_your_api_key" \
-d '{
"text": "Their going to the store becuz they needs more supplys.",
"aggressiveness": 1
}'Response
{
"original_text": "Their going to the store becuz they needs more supplys.",
"corrected_text": "They're going to the store because they need more supplies.",
"voice_drift_score": 0.08,
"issues": [
{
"category": "grammar",
"severity": "error",
"message": "Use 'They're' instead of 'Their'",
"offset": 0,
"length": 5
},
{
"category": "spelling",
"severity": "error",
"message": "Correct spelling: 'because'",
"offset": 27,
"length": 5
}
],
"diff": [
{
"type": "replace",
"original": "Their",
"corrected": "They're",
"start": 0,
"end": 5
}
],
"processing_ms": 342,
"request_id": "req_abc123",
"provider_trace": {
"stages_executed": [
"rule_based",
"model_gec",
"voice_lock",
"drift_scoring",
"selection"
]
}
}Status Codes
| Code | Description |
|---|---|
| 200 | Success — returns corrected text and metadata |
| 400 | Invalid request body |
| 401 | Missing or invalid API key |
| 413 | Text exceeds maximum length (10,000 characters) |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Try It Live
Authentication
All API requests (except health and readiness checks) require an API key sent via the X-API-Key header.
You can generate API keys from your dashboard. Keys start with hg_.
Rate Limits
Rate limits depend on your plan tier. The API returns rate limit information in response headers:
X-RateLimit-Limit— Maximum requests per windowX-RateLimit-Remaining— Remaining requestsX-RateLimit-Reset— Window reset time (Unix timestamp)