← Checkmark Animation Generator
Your token

Checkmark Animation Generator API

The animation, 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 animation's settings, its message and a description of what the person just did, and get back, as JSON, advice for that moment: keep or change, the kind (success, error, warning or info), one style from the page's list of five, the draw time, delay, easing, auto-hide, pop, shake, the message, where it goes, 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 animation.

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 feedback animation's settings, its message, the page's check and your description of what the person just did, and returns keep or change, the kind (success, error, warning, info), one style id (circle, filled, glyph, burst, inline), timing, pop, shake, the message, placement, principles and things to avoid.One JSON object

Input fields

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

FieldMeaning
task"advise"
kindsuccess, error, warning or info.
stylecircle (drawn circle), filled (filled pop), glyph (mark only), burst (ring burst) or inline (inline field).
color, backgroundHex colours, e.g. "#16a34a". The advice keeps them.
size_px, stroke_pxIcon size and stroke in px.
duration_msHow long the icon takes to draw (or pop in, for inline).
delay_msThe gather before it moves.
easingease-out, overshoot, ease-in-out, ease or linear.
pop, shake"yes" or "no".
dismiss_msWhen it hides after it appears; "0" means it stays.
messageThe words shown beside the icon now.
page_check{rule, usual_range_ms, delay_max_ms, dismiss_rule, contrast, total_ms, verdict, notes}, from the page.
descriptionWhat the person just did, what happens next, where the feedback appears 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), kind, style, summary, timing ({duration_ms, delay_ms, easing, dismiss_ms, why}), pop and shake (booleans), message, placement, principles ([{name, how}], names from the 12 principles of animation) and avoid. Before using it, check the values as the page does: draw time 300-500 ms (100-200 ms for inline), delay at most 100 ms, a success hides after 2000-4000 ms, errors and inline checks stay (dismiss_ms 0), errors never pop and successes never shake, and the message reads as the kind. 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 "Payment sent" example:

{
  "task": "advise",
  "kind": "success",
  "style": "filled",
  "color": "#16a34a",
  "background": "#ffffff",
  "size_px": "64",
  "stroke_px": "4",
  "duration_ms": "450",
  "delay_ms": "50",
  "easing": "overshoot",
  "pop": "yes",
  "shake": "no",
  "dismiss_ms": "3000",
  "message": "Payment sent",
  "page_check": "{\"rule\":\"Confirmation draw\",\"usual_range_ms\":[300,500],\"delay_max_ms\":100,\"dismiss_rule\":\"2000-4000\",\"contrast\":3.3,\"total_ms\":500,\"verdict\":\"good\",\"notes\":[]}",
  "description": "Checkout in an online bike shop. After the card payment goes through we replace the Pay button area with a confirmation, then show the order summary. Payment usually takes 1 to 3 seconds. The brand is friendly and upbeat.",
  "clipped_note": ""
}

Reply:

{"verdict":"keep","kind":"success","style":"filled","summary":"Show a green filled badge with a tick in place of the Pay button once the card payment goes through. A payment is a big moment, and a friendly, upbeat brand suits a rewarding pop. Keep it brief so the order summary follows quickly.","timing":{"duration_ms":450,"delay_ms":50,"easing":"overshoot","dismiss_ms":3000,"why":"A 450 ms draw with a 50 ms gather feels confident, and hiding after 3 seconds celebrates briefly before the order summary shows."},"pop":true,"shake":false,"message":"Payment sent","placement":"It appears exactly where the Pay button was, so the shopper sees the result where they clicked. After it hides, the order summary is shown.","principles":[{"name":"Staging","how":"The badge replaces the Pay button, so the confirmation sits exactly where the shopper just acted."},{"name":"Exaggeration","how":"The badge springs to 1.2 and settles, giving the checkout a small celebration that fits the upbeat brand."},{"name":"Timing","how":"A 450 ms draw is quick enough to read as instant yet long enough to feel like a real confirmation."},{"name":"Anticipation","how":"A 50 ms gather before the tick draws prepares the eye without delaying the result."}],"avoid":["Do not shake the badge, since the payment worked.","Do not leave it on screen so long that it holds back the order summary.","Do not swap the tick for a plain glyph, which would undersell a payment."]}

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.
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://checkmark-animation-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":"checkmark-animation-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", "kind": "success", "style": "filled", "color": "#16a34a", "background": "#ffffff", "size_px": "64", "stroke_px": "4", "duration_ms": "450", "delay_ms": "50", "easing": "overshoot", "pop": "yes", "shake": "no", "dismiss_ms": "3000", "message": "Payment sent", "page_check": "{...}", "description": "Checkout in a shop app; the confirmation replaces the Pay button", "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="checkmark-animation-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, kind, style, summary, timing, pop, shake, message, ...
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: checkmark-animation-generator:advise:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json