Sound Like Me AI · Documentation · Sign in

Use the API

Send drafts from n8n, Zapier, Make, an AI agent or your own code, and get them back in your voice.

Train your voice in the app, then let your own tools do the rest: whatever writes your first drafts (an automation, an AI agent, your CMS) sends them to Sound Like Me AI, and gets them back in your voice. You don't need to open the app again, except to top up credits.

Get a key

Open API keys in the account menu, name the key (for example "n8n blog flow"), and click Create key. Copy the key and its webhook signing secret right away: they're shown only once. You can have several keys, give one an expiry date, and revoke any of them at any time.

Send the key with every request:

Authorization: Bearer slm_live_…

The base URL is https://gkioolyythfolvwxtexu.supabase.co/functions/v1/api/v1.

Rewrite a draft

Send the draft and a webhook_url. You get an answer right away, and the rewrite is POSTed to your webhook when it's ready, usually within a minute.

curl -X POST https://gkioolyythfolvwxtexu.supabase.co/functions/v1/api/v1/rewrites \
  -H "Authorization: Bearer slm_live_…" \
  -H "Content-Type: application/json" \
  -d '{"text": "Your AI draft…", "webhook_url": "https://your-endpoint.example.com/hook"}'
Field
textThe draft (Markdown or plain text). Required.
webhook_urlWhere to send the result (HTTPS). Optional: without it, check the job yourself (below).
title, doc_typeOptional. Detected automatically when left out.
max_creditsOptional. If the draft would cost more, nothing is charged and you get an over_max_credits error.

The webhook receives JSON like this:

{
  "event": "rewrite.succeeded",
  "id": "…",
  "status": "succeeded",
  "text": "The draft, in your voice…",
  "title": "Launch moves to Friday",
  "edit_url": "https://…/app/d/…",
  "credits": { "charged": 2, "refunded": null, "balance": 98 }
}

If it fails, event is rewrite.failed and error says why (no credits are used). Every rewrite is also saved in your documents with an API tag, so you can open edit_url to fine-tune it by hand.

Check that a webhook is real

Each webhook has an SLM-Signature header: t=<time>,v1=<signature>. The signature is an HMAC-SHA256 of <time>.<raw body> using your key's webhook signing secret. Compute it, compare, and ignore anything older than a few minutes. In Node:

import crypto from 'node:crypto'

function isFromSoundLikeMe(header, rawBody, secret) {
  const { t, v1 } = Object.fromEntries(header.split(',').map((p) => p.split('=')))
  const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
  const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300
  return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1))
}

If your endpoint doesn't answer with a 2xx, the webhook is tried again a few more times over the next hour.

Other endpoints

EndpointWhat it does
GET /voiceYour voice guide as Markdown, for tools that write with their own AI. Costs 1 credit per read.
POST /documents/{id}/finalSend your final, edited text ({"text": "…"}) so it keeps learning. Free.
GET /meYour balance and limits, handy for checking that a key works.

Credits and limits

API rewrites cost the same as in the app: 1 credit per 150 words, refunded if a rewrite fails or comes back unchanged. Each key can start 30 rewrites an hour, and drafts can be up to 3,000 words. Errors come back as JSON with a code: unauthorized (missing, revoked or expired key), insufficient_credits, over_max_credits, doc_too_large, rate_limited, bad_webhook_url.