← Text Reveal Generator
Your token

Text Reveal Generator API

Reading your headline, the live preview, the check and writing the HTML, CSS, JS and React code all run free in the browser and need no API. The API is for the one metered step: send a headline, the settings you have and a description of the feel you want, and get back, as JSON, the settings of one reveal. The page builds this input for you and clamps and checks every value in the reply.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "reveal".

taskWhat it doesReply
revealReads a headline, the current settings (if any) and a description of the feel, and returns reveal settings. With a description that asks for a change, it edits the current settings; with an empty description, it fixes the current settings' flagged problems.One JSON object

Input fields

Every field is a string; current and page_check hold JSON text. Only task is required.

FieldMeaning
task"reveal"
descriptionThe feel you want, or what to change (at most 1,500 characters). May be empty to fix flagged problems.
textThe headline, one line per line break (at most 1,200 characters). Its words are never changed.
currentEmpty, or the current settings with the same keys as the reply's settings.
page_check{words, lines, units, total_ms, verdict, notes} about the current settings, from the page.
clipped_noteEmpty, or a sentence saying the description or headline was cut.

The reply

job.output.output is text holding one JSON object: summary, name, settings, lines and notes. settings has split (word, letter or line), stagger_ms (0-400), duration_ms (100-3000), rise_px (-120 to 120), blur_px (0-30), scale_pct (50-150), easing (expo, quint, back, inout, ease or linear), mask (true/false), trigger (inview or load), once (true/false) and delay_ms (0-5000). lines is empty or the same words re-broken into lines. Before using it, clamp each number to its range and check that lines uses exactly your words in your order, as the page does. If the balance ran low, truncated is true and the object may stop early; the page keeps every part that arrived whole.

Worked example

Input (input.json): a four-word hero headline on the default fade-up settings, asking for a slow, calm feel:

{
  "task": "reveal",
  "description": "Slow and calm, like a luxury fashion brand. Soft and elegant, nothing bouncy.",
  "text": "Design that moves people",
  "current": "{\"split\":\"word\",\"stagger_ms\":80,\"duration_ms\":700,\"rise_px\":24,\"blur_px\":0,\"scale_pct\":100,\"easing\":\"expo\",\"mask\":false,\"trigger\":\"inview\",\"once\":true,\"delay_ms\":0}",
  "page_check": "{\"words\":4,\"lines\":1,\"units\":4,\"total_ms\":940,\"verdict\":\"good\",\"notes\":[]}",
  "clipped_note": ""
}

Reply:

{
  "summary": "A slow, soft fade where each word drifts up a short way and settles gently, with no bounce. A long 1200 ms duration, wide 140 ms gaps, a 16 px rise and a light 6 px blur give the unhurried luxury feel.",
  "name": "Quiet Luxury Reveal",
  "settings": {
    "split": "word",
    "stagger_ms": 140,
    "duration_ms": 1200,
    "rise_px": 16,
    "blur_px": 6,
    "scale_pct": 100,
    "easing": "quint",
    "mask": false,
    "trigger": "inview",
    "once": true,
    "delay_ms": 0
  },
  "lines": [],
  "notes": [
    "Watch the last word: it should settle about 1.6 seconds after the first starts.",
    "Check the 6 px blur in your real font; thin letters can look too faint at the start."
  ]
}

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above, or task is missing.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://text-reveal-generator.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"text-reveal-generator"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "reveal", "description": "Slow and calm, like a luxury brand", "text": "Design that moves people", "current": "", "page_check": "{}", "clipped_note": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="text-reveal-generator:reveal:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.json   # one JSON object: summary, name, settings, lines, notes
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: text-reveal-generator:reveal:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json