Developers
The Accent API
Everything the app does, over HTTP. Send a draft and get it back reading like a person wrote it, or send a prompt and get a finished piece. Same model, same checks, same words.
1. Overview
Base URL: https://accent-pipeline.fly.dev/v1. Every request and response is JSON. A call runs the same pipeline as the app, takes about as long as the app does (a few minutes for a long piece), and shows up in your Recents when it finishes. Keep the connection open, or use streaming to watch progress.
2. Authentication
Make a key on your API keys page and send it as a bearer token on every request. A key is shown once when you make it. Revoke it there at any time.
Authorization: Bearer ak_live_...
Keep keys server-side. A key can spend every word on your account.
3. Plans and words
The API is included on every plan, the free one too. Calls spend the same words as the app: a humanize call costs the words you send, a write call costs the length you ask for, and a call that does not land is refunded. One run at a time per account.
| Plan | Words a month | Most words in one call |
|---|---|---|
| Free | 300, once | 300 |
| Starter | 20,000 | 1,500 |
| Pro | 60,000 | 3,000 |
| Max | 150,000 | 5,000 |
4. POST /humanize
Rewrite a draft so it reads as human. Send at least 40 words and at most your plan's cap.
| Field | Type | Notes |
|---|---|---|
| text | string | The draft. Paragraphs separated by blank lines are kept as paragraphs. |
| stream | boolean | Optional. true for a progress stream instead of one JSON reply. |
curl https://accent-pipeline.fly.dev/v1/humanize \
-H "Authorization: Bearer $ACCENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Remote work has fundamentally transformed the modern workplace... (at least 40 words)"}'The reply:
{
"id": "0f5a2c1e-6d0b-4a3e-9d2f-2c7d5a0b1e44",
"tool": "humanize",
"text": "Working from home has changed how most offices run...",
"reads_human": true,
"paragraphs": { "total": 3, "rewritten": 3 },
"words": { "charged": 137, "refunded": false },
"elapsed": 96
}| Field | Meaning |
|---|---|
| id | The run. It is also the draft's id in your dashboard. |
| text | The rewritten piece, paragraphs separated by blank lines. |
| reads_human | true when the finished piece reads as human. false means it did not land; your words were returned and the text is still yours to use. |
| paragraphs | How many paragraphs were in play and how many were rewritten. |
| words | What the call cost, and whether it was refunded. |
| elapsed | Seconds the run took. |
5. POST /write
Write a piece from a prompt, then run it through the same rewrite. The length you ask for is the charge.
| Field | Type | Notes |
|---|---|---|
| prompt | string | What to write, up to 4,000 characters. Name a format if you want one. |
| words | integer | How long, 50 and up, within your plan's cap. Default 300. |
| stream | boolean | Optional, as above. |
curl https://accent-pipeline.fly.dev/v1/write \
-H "Authorization: Bearer $ACCENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "A blog post on why small teams ship faster", "words": 400}'The reply has the same shape as a humanize reply, with "tool": "write".
6. GET /me
The account behind a key: its plan, the words left, and the most a single call may touch.
{ "plan": "pro", "words_left": 41200, "max_words_per_call": 3000 }7. Streaming
Pass "stream": true and the reply is a server-sent event stream: anaccepted frame with the run id, a progress frame each time a paragraph settles, then one result frame with the same body a plain call returns, or an error frame. A comment line arrives every ten seconds while the run is quiet, so idle proxies keep the socket open.
curl -N https://accent-pipeline.fly.dev/v1/humanize \
-H "Authorization: Bearer $ACCENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "...", "stream": true}'
data: {"t": "accepted", "id": "0f5a2c1e-..."}
data: {"t": "progress", "paragraphs": 3, "settled": 0}
data: {"t": "progress", "paragraphs": 3, "settled": 1}
data: {"t": "progress", "paragraphs": 3, "settled": 3}
data: {"t": "result", "id": "0f5a2c1e-...", "text": "...", "reads_human": true, ...}8. Errors
Errors come back as { "error": { "code", "message" } } with an HTTP status to match.
| Code | Status | When |
|---|---|---|
| unauthorized | 401 | No key, a malformed key, or a revoked one. |
| plan_required | 403 | The account's plan does not include the API. |
| out_of_words | 402 | Not enough words left for this call. |
| over_cap | 413 | More words than the plan handles in one call. |
| too_short | 400 | Fewer than 40 words sent to /humanize. |
| busy | 429 | A run is already in progress on this account. |
| failed | 502 | The run could not finish. Nothing was charged. |
9. Examples
JavaScript:
const response = await fetch("https://accent-pipeline.fly.dev/v1/humanize", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ACCENT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text }),
});
const run = await response.json();
if (!response.ok) throw new Error(run.error.message);
console.log(run.reads_human, run.text);Python:
import os, requests
r = requests.post(
"https://accent-pipeline.fly.dev/v1/humanize",
headers={"Authorization": f"Bearer {os.environ['ACCENT_API_KEY']}"},
json={"text": text},
timeout=900,
)
run = r.json()
if not r.ok:
raise RuntimeError(run["error"]["message"])
print(run["reads_human"], run["text"])Questions? Write to info@tryaccent.ai.