← Marquee Generator
Your token

Marquee Generator API

Reading your items, previewing the loop, checking it and writing the HTML, CSS, Tailwind and React code all run free in the browser and need no API. The API is for the one metered step: send a description of a marquee, and optionally the items you have now, and get back, as JSON, the items and the settings. The page builds this input for you and re-reads and checks every item 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": "marquee".

taskWhat it doesReply
marqueeReads a description of a marquee and the current items (if any), and returns items and settings. A description that asks for a different look or speed keeps the current items (an empty items list); an empty description fixes the current marquee's flagged problems.One JSON object

Input fields

Every field is a string; page_check holds JSON text. Only task is required.

FieldMeaning
task"marquee"
descriptionWhat the marquee is for, or what to change in the current one (at most 1,500 characters). May be empty when current is set.
currentEmpty, or the current items, one per line (a quote card is "Quote." -- Name; a logo is its name), at most 3,000 characters.
page_check{style, speed_px_s, direction, rows, separator, pause_on_hover, items, logos, longest_words, verdict, notes} about current, from the page; style is text, pill, card or logo.
clipped_noteEmpty, or a sentence saying the description or the list was cut.

The reply

job.output.output is text holding one JSON object: summary, name, items (2 to 24 strings, or [] to keep your current items), style (text, pill, card or logo), speed_px_s (pixels a second), direction (left, right, up or down), rows (1 or 2), separator (none, dot, star or slash), pause_on_hover (true or false) and notes. Before publishing, check that every number and every name in items is one you gave, 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 two-row strip of ten tag pills, asking for a calmer single row that pauses on hover:

{
  "task": "marquee",
  "description": "Make it calmer, keep it to one row, and let it pause when someone hovers over it.",
  "current": "Branding\nWeb design\nMotion\nIllustration\nUX research\nCopywriting\n3D\nPhotography\nPackaging\nType design",
  "page_check": "{\"style\":\"pill\",\"speed_px_s\":35,\"direction\":\"left\",\"rows\":2,\"separator\":\"none\",\"pause_on_hover\":false,\"items\":10,\"logos\":0,\"longest_words\":2,\"verdict\":\"good\",\"notes\":[]}",
  "clipped_note": ""
}

Reply:

{"summary":"Your ten service tags stay exactly as they are. The strip now runs in one row, a little slower, and stops when someone hovers over it.","name":"Calm single-row tags","items":[],"style":"pill","speed_px_s":30,"direction":"left","rows":1,"separator":"none","pause_on_hover":true,"notes":["Watch it for a minute on the real page to see if the slower pace feels calm enough","Hover over the strip to confirm it stops and starts again"]}

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://marquee-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":"marquee-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": "marquee", "description": "A calm logo strip for our partners", "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="marquee-generator:marquee:$(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, items, style, speed_px_s, direction, rows, separator, pause_on_hover, 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: marquee-generator:marquee:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json