Prompty API

Sharpen prompts from your own code

The same engine as the desktop app, over HTTPS. Send a rough prompt, get back a sharper one and a short list of what changed. You don't need any of this to use Prompty itself: the desktop app signs in with your account.

1. Get a key

Create one in Dashboard → Developers. It's shown once. Keep it on your server or in an environment variable, never in browser code, and revoke it there if it leaks.

2. Sharpen a prompt

POST /api/v1/rewrite with your key as a Bearer token.

curl https://useprompty.com/api/v1/rewrite \
  -H "Authorization: Bearer $PROMPTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "my react list is slow", "mode": "code", "target": "Cursor"}'
// Node.js 18+ or any server-side JavaScript
const res = await fetch("https://useprompty.com/api/v1/rewrite", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PROMPTY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ text: "explain kubernetes", mode: "improve", target: "ChatGPT" }),
});
const { rewritten, changes } = await res.json();
text

string, required

The prompt to sharpen, 1 to 20,000 characters.

mode

improve | concise | detailed | code | image | grammar

How to sharpen it. Defaults to improve.

target

string

The tool the prompt is for, like “ChatGPT” or “Midjourney”, so the rewrite suits it. Up to 100 characters.

quality

fast | balanced | deep

How hard Claude thinks. Defaults to balanced.

The response:

{
  "rewritten": "My React list of ~5,000 rows re-renders on every keystroke…",
  "changes": ["Added context", "Expected behaviour", "How to verify"],
  "category": "coding",
  "mode": "code",
  "usage": { "plan": "free", "used": 3, "limit": 25 }
}

Other endpoints

GET /api/v1/me

account

Your plan, this month's usage and when it resets.

GET /api/v1/library

your prompts

Everything in your library, newest first: id, title, content, mode, category, createdAt.

POST /api/v1/library

save a prompt

Saves content (with optional title, mode, category) to your library.

Limits and errors

API rewrites share your plan's monthly allowance (25 on Free, 600 on Pro) and are limited to 20 requests a minute per key. Errors come back as JSON with an error code and a readable message.

400 invalid_request

your input

The body is missing `text` or a field is out of range.

401 invalid_key

authentication

The key is missing, wrong or revoked.

402 quota_exceeded

plan

This month's rewrites are used up; includes an `upgradeUrl`.

429 rate_limited

slow down

Too many requests this minute.

502 rewrite_failed

try again

The rewrite didn't work this time; it isn't counted.

Prompty never stores the text you send; only counts and categories are kept for your stats.