← Ripple Effect Generator
Your token

Ripple Effect Generator API

The button, the preview, the check against the timing rules and every copy and download run free in the browser and need no API. The API is for the one metered step: send the current button's settings and a description of where it sits, and get back, as JSON, advice for that place: keep or change, a summary, how the press should feel (depth, press time, release time, overshoot, pushed-in look), what the ripple does (on or off, time, start point, strength), the animation principles at work and what to avoid. The page builds this input for you, checks the reply against the rules and draws the button.

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": "advise".

taskWhat it doesReply
adviseReads one button's press and ripple settings, the page's check and your description of where the button sits, and returns keep or change, a summary, the press (depth, press and release times, overshoot, pushed-in look), the ripple (on, time, start, strength), principles and things to avoid.One JSON object

Input fields

Every field is a string; page_check holds JSON text. task, variant, label and description are required.

FieldMeaning
task"advise"
variantfilled, outline or text. The advice keeps it.
labelThe text on the button, e.g. "Add to cart".
color, background, text_colorHex colours, e.g. "#7c3aed". The advice keeps them.
radius_px, text_pxCorner radius and text size in px.
press_scaleHow far the button shrinks while pressed, e.g. "0.97" ("1" = no shrink).
press_ms, release_msHow long the press takes to show; how long the button takes to spring back.
overshoot, sink, ripple"yes" or "no": the release springs past rest and settles; the pressed button darkens and loses shadow; a ripple grows on press.
ripple_msHow long the ripple takes to spread and fade.
ripple_origintap (where you press) or center.
ripple_strengthThe ripple's starting opacity, 0 to 1, e.g. "0.35".
page_check{press_range_ms, depth_range, release_range_ms, ripple_range_ms, strength_range, height_px, text_contrast, verdict, notes}, from the page.
descriptionWhere the button sits, what it does, how often it is pressed and the brand's character (at most 1,200 characters).
clipped_noteEmpty, or a sentence saying the description was cut.

The reply

job.output.output is text holding one JSON object: verdict (keep or change), summary, press ({scale, press_ms, release_ms, overshoot, sink, why}), ripple ({on, ms, origin, strength, why}), principles ([{name, how}], names from the 12 principles of animation) and avoid. Before using it, check the values as the page does: a press within 0-50 ms, a shrink to 0.95-0.97, a release in 150-300 ms, a ripple in 400-600 ms from the tap at a strength of 0.15-0.5, and the pushed-in look kept on. 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), from the page's "Add to cart" example:

{
  "task": "advise",
  "variant": "filled",
  "label": "Add to cart",
  "color": "#7c3aed",
  "background": "#ffffff",
  "text_color": "#ffffff",
  "radius_px": "10",
  "text_px": "16",
  "press_scale": "0.96",
  "press_ms": "50",
  "release_ms": "250",
  "overshoot": "yes",
  "sink": "yes",
  "ripple": "yes",
  "ripple_ms": "500",
  "ripple_origin": "tap",
  "ripple_strength": "0.35",
  "page_check": "{\"press_range_ms\":[0,50],\"depth_range\":[0.95,0.97],\"release_range_ms\":[150,300],\"ripple_range_ms\":[400,600],\"strength_range\":[0.15,0.5],\"height_px\":44,\"text_contrast\":5.7,\"verdict\":\"good\",\"notes\":[]}",
  "description": "Add to cart button under each product photo in an online plant shop, mostly used on phones. People tap it several times per visit and adding a plant should feel rewarding. Playful, warm brand.",
  "clipped_note": ""
}

Reply:

{"verdict":"keep","summary":"The Add to cart button already presses the way a playful plant shop needs: a small squash that shows at once, a springy return, and a soft ripple from the thumb. Shoppers tap it several times per visit on phones, so the response stays quick and light while still making each add feel rewarding.","press":{"scale":0.96,"press_ms":50,"release_ms":250,"overshoot":true,"sink":true,"why":"A slightly deeper squash than a serious button would get suits a warm, playful brand, and the press shows instantly so every tap feels connected."},"ripple":{"on":true,"ms":500,"origin":"tap","strength":0.35,"why":"A mid-length ripple growing from the thumb gives a warm confirmation on a filled purple button without lingering when someone adds several plants in a row."},"principles":[{"name":"Squash & Stretch","how":"The button compresses a little under the thumb, so Add to cart feels like a soft physical button on a phone screen."},{"name":"Follow Through & Overlapping Action","how":"The springy release carries slightly past rest size and settles, which gives each plant added to the cart a small rewarding bounce."},{"name":"Staging","how":"The ripple spreads from exactly where the thumb lands under the product photo, so attention stays on the tap."},{"name":"Solid Drawing","how":"The darker, flatter pressed look makes the purple button seem pushed in, so shoppers trust the tap registered."}],"avoid":["Do not raise the press time above 50 ms, or tapping on a phone will feel laggy.","Do not make the ripple longer or stronger, because it would feel heavy after several quick adds.","Do not remove the bounce on release, since it carries the rewarding feeling of adding a plant."]}

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 a required field is missing or empty.
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://ripple-effect-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":"ripple-effect-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": "advise", "variant": "filled", "label": "Add to cart", "color": "#7c3aed", "background": "#ffffff", "text_color": "#ffffff", "radius_px": "10", "text_px": "16", "press_scale": "0.96", "press_ms": "50", "release_ms": "250", "overshoot": "yes", "sink": "yes", "ripple": "yes", "ripple_ms": "500", "ripple_origin": "tap", "ripple_strength": "0.35", "page_check": "{...}", "description": "Add to cart button under each product photo in an online plant shop, mostly tapped on phones", "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="ripple-effect-generator:advise:$(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: verdict, summary, press, ripple, principles, avoid
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: ripple-effect-generator:advise:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json