Quickstart

The legacy deterministic endpoint returns polished text, a token-level diff, and a rationale per change. save: true is currently unavailable.

Keys are environment-scoped
Test keys (gp_test_…) never consume quota and always return the same fixture.

Polish a draft

The same call in three clients. Only text is required: tone defaults to neutral and return to diff.

cURL
curl https://api.genpolish.app/v1/polish \
  -H "Authorization: Bearer $GENPOLISH_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "In today’s fast-paced world…", "tone": "warm"}'
Node
import { GenPolish } from "genpolish";

const gp = new GenPolish(process.env.GENPOLISH_KEY);

const res = await gp.polish({
  text: draft,
  tone: "warm",
  return: "diff",
});

console.log(res.score.after); // 96
Python
from genpolish import GenPolish

gp = GenPolish(os.environ["GENPOLISH_KEY"])

res = gp.polish(text=draft, tone="warm", return_="diff")

print(res.score.after)  # 96

Response

textstring
The polished draft.
diff[]token[]
Ordered tokens with op: del | ins | chg.
changes[]change[]
One entry per edit, with kind and rationale.
scoreobject
before and after, 0–100.
revisioninteger
Present only when save is true.

Rate limits

The deterministic endpoint defaults to 60 requests a minute per live/session caller. Excess requests return 429 rate_limited with Retry-After in seconds. Test keys still obey transport limits; neither test fixtures nor /v1/polish consume words. Both /rewrite and /tools/ai-text-rewriter use the separate metered AI rewrite endpoints and share their quotas.

Next

Core concepts explains what a change, a diff and a revision are. Errors explains the response envelope, rewrite recovery and the corresponding error anchors.