Skip to content

API reference

The Unslop API runs the same engine as the app: send a draft, get it back without the AI smell. It's available on the Pro plan. API calls draw from the same monthly rewrite quota as the app, so there's one pool and no separate metering.

Authentication

Create a key in the app under API. Keys start with usk_ and are shown once at creation. Send the key on every request:

Authorization: Bearer usk_...

Keys stop working if the subscription lapses and start working again when it resumes. Revoking a key is immediate.

POST /api/v1/rewrite

Rewrites a draft. The body takes text (required, up to 20,000 characters on Pro) and preserve_markdown (optional). When preserve_markdown is omitted, your account setting applies. With it on, markup survives untouched and only prose is edited.

curl https://unslopai.com/api/v1/rewrite \
  -H "Authorization: Bearer usk_..." \
  -H "Content-Type: application/json" \
  -d '{"text": "Your draft goes here.", "preserve_markdown": true}'

The response carries the rewritten text and your quota state:

{
  "id": "5f0c2e1a-...",
  "output": "Your draft, without the AI smell.",
  "no_op": false,
  "usage": { "used": 42, "quota": 600, "period_ends_at": "2026-08-01T00:00:00.000Z" }
}

no_op: true means the engine found nothing to change. No-ops don't count against your quota. The id is the same rewrite id you see in the app's History, where the content stays openable for 48 hours.

GET /api/v1/usage

A read-only snapshot of your quota. It never counts as usage itself.

curl https://unslopai.com/api/v1/usage \
  -H "Authorization: Bearer usk_..."

Every response, on both endpoints, also carries X-Quota-Used, X-Quota-Limit and X-Quota-Reset headers.

Errors

Errors are JSON with a stable error code and a message:

StatusCodeMeaning
400invalid_requestThe body isn't valid JSON with a text field.
401invalid_keyThe key is missing, revoked, expired, or unknown.
402quota_exhaustedThe monthly quota is spent. Resets at period_ends_at.
403plan_requiredThe key's owner isn't on the Pro plan right now.
403bannedThe account is suspended.
413input_too_longThe draft exceeds the per-request character cap.
429rate_limitedToo many requests in a minute for this key.
500engine_failedThe rewrite failed. You were not charged. Retry.

Rate limits

Each key allows 20 requests per minute. The monthly quota is the real ceiling; the per-key limit only exists to stop runaway loops. A limited request returns 429 and costs nothing.

Client libraries

For JavaScript and TypeScript there's an official client with zero dependencies. It works in Node 18+, edge runtimes and the browser:

npm install @unslopai/client
import { Unslop } from "@unslopai/client";

const unslop = new Unslop({ apiKey: process.env.UNSLOP_API_KEY });

const result = await unslop.rewrite("Your draft goes here.");
console.log(result.output);

From Python, the raw HTTP call is small enough to inline:

import requests

res = requests.post(
    "https://unslopai.com/api/v1/rewrite",
    headers={"Authorization": "Bearer usk_..."},
    json={"text": "Your draft goes here."},
)
res.raise_for_status()
print(res.json()["output"])

Questions or a use case the API doesn't cover yet? Write to [email protected].