# SupWriter Developer API

A REST API for SupWriter's four tools — humanize, paraphrase, grammar-check, and AI detection — authenticated with a personal API key. For developers building integrations, scripts, and headless agents.

Docs: [supwriter.com/developers](https://supwriter.com/developers).

## Endpoints

- `POST https://supwriter.com/api/v1/humanize`
- `POST https://supwriter.com/api/v1/paraphrase`
- `POST https://supwriter.com/api/v1/grammar`
- `POST https://supwriter.com/api/v1/detect`

All accept JSON and return a `{ success, data | error }` envelope. Input is capped at 100,000 characters per request.

## Authentication

- Create a key under Settings → API & MCP (requires a Pro or Ultra plan). Keys are shown once.
- Send it on every request as `Authorization: Bearer sw_live_…` (or `x-api-key: sw_live_…`).

## Example

```bash
curl https://supwriter.com/api/v1/humanize \
  -H "Authorization: Bearer sw_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"text":"Your AI-generated text here","tone":"casual"}'
```

## Rate limits

- Per-key limits (Pro 60/min, Ultra 120/min) with `X-RateLimit-*` and `Retry-After` headers.

## Errors

- `401` unauthorized (missing/invalid key), `400` validation, `403` `plan_limit` (over the per-request word cap) or `insufficient_credits`, `429` rate limited.

## Billing

- Calls draw on your plan's word credits (one credit per word). AI detection is metered on the API (one credit per word analyzed); it's free only in the web app.

## Related

- One-doc agent skill: [supwriter.com/skill.md](https://supwriter.com/skill.md) — teaches an AI coding agent to use this API end to end.
- MCP server (same tools, in your AI client): [supwriter.com/mcp](https://supwriter.com/mcp.md)
- OpenAPI specs: `https://supwriter.com/.well-known/openapi/*.yaml`
