API Reference

v1 — Audit and rewrite AI writing patterns programmatically.

Authentication

All API requests require a Bearer token in the Authorization header. Get your API key from the developer dashboard.

Authorization: Bearer avd_live_YOUR_API_KEY

API keys start with avd_live_. Each key has its own credit balance and usage tracking. You can create up to 5 keys per account (e.g. for different environments).


POST /api/v1/audit

Audit and rewrite text, removing AI writing patterns. Costs 1 credit per request.

Request body

text required
The text to audit and rewrite. String, max 5,000 words.
context optional
Content type context. Adjusts detection rules and rewrite style. One of: blog, technical, investor, social, docs, casual. Defaults to blog.

Response

200 OK
{
  "result": "## Rewritten Text\n\n...rewritten content...\n\n## Diff Summary\n\n...",
  "credits": 49,
  "usage": {
    "words": 342,
    "context": "blog"
  }
}

Error responses

401
Missing or invalid API key.
402
No credits remaining. Purchase more to continue.
400
Invalid request (missing text, exceeds word limit).
429
Rate limit exceeded. Max 60 requests per minute per key.
500
Internal error. Credit auto-refunded on failure.
503
Service temporarily disabled.

All errors follow this format:

{
  "error": {
    "message": "Human-readable error message",
    "code": "machine_readable_code"
  }
}

Rate limits

Each API key is limited to 60 requests per minute and 100 requests per day. Rate limit info is included in response headers:

X-RateLimit-Limit
Max requests per window (60).
X-RateLimit-Remaining
Requests remaining in current window.
X-RateLimit-Reset
Seconds until the rate limit window resets.

Context types

The context parameter adjusts how aggressively patterns are flagged and what rewrite style is used:

blog
Default. Balanced detection for blog posts and articles.
technical
Technical writing. More tolerant of formal structure, stricter on filler words.
investor
Investor updates and pitch decks. Flags hype language hard.
social
Social media posts. Lighter touch, focuses on obvious AI patterns.
docs
Documentation and README files. Preserves technical accuracy.
casual
Casual writing, emails, Slack messages. Minimal intervention.

Code examples

Node.js
async function auditText(text, context = "blog") {
  const res = await fetch("https://www.avoidaiwriting.com/api/v1/audit", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.AVOID_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ text, context }),
  });

  if (!res.ok) {
    const err = await res.json();
    throw new Error(err.error?.message || "Audit failed");
  }

  return res.json();
}
Python
import os, requests

def audit_text(text: str, context: str = "blog") -> dict:
    response = requests.post(
        "https://www.avoidaiwriting.com/api/v1/audit",
        headers={"Authorization": f"Bearer {os.environ['AVOID_API_KEY']}"},
        json={"text": text, "context": context},
    )
    response.raise_for_status()
    return response.json()
cURL
curl -X POST https://www.avoidaiwriting.com/api/v1/audit \
  -H "Authorization: Bearer $AVOID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This comprehensive guide delves into the landscape of...",
    "context": "blog"
  }'

Credits

Each successful audit request costs 1 credit. If a request fails due to a server error, the credit is automatically refunded. Credits never expire.

Purchase credits from the developer dashboard. Packs range from $10 (50 requests) to $100 (500 requests). After Stripe fees and API costs, remaining revenue buys and burns $avoid tokens.