ProPhrase API v1

Clearer communication.
Built into your product.

Bring ProPhrase rewriting, protected details, semantic safeguards and Outcome Assistant into the tools your team already uses.

POST/api/v1/rephrase
{
  "text": "send me update today",
  "tone": "Professional"
}
200 OK

Please send me the update today.

Get connected

Authentication

Every v1 endpoint requires the signed-in user's Supabase access token. Send it as Authorization: Bearer TOKEN. Never use or expose the Supabase service-role key.

const { data } = await supabase.auth.getSession();
const token = data.session?.access_token;

fetch("https://prophrase.in/api/v1/rephrase", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${token}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID()
  },
  body: JSON.stringify({ text: "send update today", tone: "Professional" })
});

Access tokens expire. Use the Supabase client's session refresh support. API requests consume the authenticated user's credits and follow their plan permissions.

POST/api/v1/rephrase
Core rewrite

Rephrase a message

Correct spelling and grammar, then rewrite the message using the selected communication style while preserving meaning and protected facts.

textstring · required

3–5,000 characters.

toneenum · required

Professional, Polite, Shorter, Short & Crisp, Human, Email, Slack, Teams, Jira Comment, WhatsApp, Client-safe, Manager-friendly, or Firmer.

instructionstring

Optional custom instruction, 3–240 characters.

threadIduuid

Continue an existing ProPhrase conversation. Omit it to create a new thread.

Example request

curl https://prophrase.in/api/v1/rephrase \
  -H "Authorization: Bearer $PROPHRASE_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: rewrite-2026-001" \
  -d '{
    "text": "send me update today",
    "tone": "Professional"
  }'

Successful response

{
  "requestId": "uuid",
  "result": "Please send me the update today.",
  "warnings": [],
  "promptVersion": "prophrase-prompt-v2.1",
  "repaired": false,
  "threadId": "uuid",
  "usage": { "rewriteRemaining": 24 },
  "credits": { "charged": 1, "remaining": 299 }
}
POST/api/v1/outcome-assistant
Outcome control

Prepare an outcome-focused message

Returns Safe, Balanced, and Firm alternatives with reader interpretation, risks, protected-detail verification, and commitment warnings.

originalTextstring · required

3–5,000 characters.

recipientenum · required

manager, senior_leader, client, customer, colleague, direct_report, recruiter, vendor, friend, family, or other.

intentenum · required

request, follow_up, approval, status_update, escalation, disagreement, rejection, boundary, payment_request, apology, clarification, negotiation, extension_request, feedback, criticism_response, or other.

customRecipientstring

Required when recipient is other.

customIntentstring

Required when intent is other.

relationshipLevelenum

new, formal, regular, comfortable, or difficult.

urgencyenum

none, today, few_days, urgent, or critical.

desiredResponsestring

The response or action you want from the recipient.

channelenum

whatsapp, email, slack_teams, sms, linkedin, or other. Defaults to email.

lockedFactsstring[]

Up to 30 values that must remain exact.

languageModeenum

standard or indian_workplace.

Example request

curl https://prophrase.in/api/v1/outcome-assistant \
  -H "Authorization: Bearer $PROPHRASE_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: outcome-2026-001" \
  -d '{
    "originalText": "I need two more days to finish this safely.",
    "recipient": "manager",
    "intent": "extension_request",
    "relationshipLevel": "regular",
    "urgency": "today",
    "desiredResponse": "Approve the extension",
    "channel": "email",
    "lockedFacts": ["two more days"],
    "languageMode": "standard"
  }'

Successful response

{
  "requestId": "uuid",
  "understoodIntent": "Request two additional days.",
  "variants": [
    { "id": "safe", "message": "...", "risks": [], "factVerification": [] },
    { "id": "balanced", "message": "...", "risks": [], "factVerification": [] },
    { "id": "firm", "message": "...", "risks": [], "factVerification": [] }
  ],
  "globalWarnings": [],
  "missingInformation": [],
  "credits": { "charged": 1, "remaining": 298 },
  "metadata": { "repaired": false, "fallback": false }
}
GET/api/v1/credits
Shared usage

Credit balance

Returns whether credit billing is enabled and the authenticated user's allowance, available balance, reservations, billing period, and next refresh time.

curl https://prophrase.in/api/v1/credits \
  -H "Authorization: Bearer $PROPHRASE_TOKEN"

Rephrase and Outcome Assistant cost 1 credit up to 500 characters, 2 up to 1,200, 4 up to 2,500, and 8 up to 5,000. Failed generation is not charged.

Predictable handling

Errors and limits

Errors use a consistent JSON body: { "code": "ERROR_CODE", "message": "Human-readable message" }.

400

Invalid request body

401

Missing, expired, or invalid token

402

Insufficient credits or plan limit

403

Feature or input unavailable on the plan

409

Duplicate request still processing

422

AI output could not be safely validated

429

Rate or fair-use limit reached

502

AI provider unavailable

Rate limits: 20 rephrase requests per minute and 12 Outcome Assistant requests per minute per user. Send a unique Idempotency-Key for safe retries. Maximum input length is 5,000 characters.

API version: v1 · Updated July 2026 · Terms and privacy