← How-To Steps Generator
Your token

How-To Steps Generator API

Reading the steps, checking them and writing the how-to HTML, the CSS, the tabs script and the HowTo JSON-LD all run free in the browser and need no API. The API is for the one metered step: send your steps with each one split into numbered parts, and get back, as JSON, a short action name per step, which parts are the instruction (action first) and which are tips, a "How to ..." heading when yours lacks one, and the tools and supplies the steps name. The model never writes instruction text; the page rebuilds each step from your own sentences and refuses any change it cannot check.

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

taskWhat it doesReply
tidyNames each step, puts the action first, moves side advice into tips, suggests a How to heading and lists the tools and supplies the steps use. It never writes instruction text.One JSON object

Input fields

All values are strings. task and steps are required.

FieldMeaning
task"tidy"
titleThe section heading you have now (may be empty). A new heading comes back only when this one does not start with “How to”.
introThe line under the heading (may be empty).
needJSON text {"tools": [...], "supplies": [...]}: what you already list.
stepsJSON text: the steps in order, each {id, words, parts} plus optional name, section and tips (a count), where parts is the step as [{id, text, list?, link?}], one sentence or list item each, ids like s3.2. At most 40 steps and 20 parts per step.
steps_noteEmpty, or a sentence saying what was cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence) with four keys: title (a heading or ""); steps, one {id, name, do, tips} per step in input order (do is the list of part ids that are the instruction, in order; tips the part ids that become a tip; together they hold every part once); tools and supplies, item names quoted from the steps. Before using it, check that every id is one you sent, that no sentence was dropped, that a name starts with an action and uses the step's own words, and that every tool and supply appears in your steps; the page does all of this and lists what it refused. If the balance ran low, truncated is true and the object may stop early; the page keeps every step that arrived whole.

Worked example

Input (input.json), the old how-to (HTML) sample on the page (6 steps):

{
  "task": "tidy",
  "title": "Repotting your houseplant",
  "intro": "Spring is the best time to move a root-bound plant into a bigger pot.",
  "need": "{\"tools\":[],\"supplies\":[]}",
  "steps": "[{\"id\":\"s1\",\"name\":\"Water the plant the day before\",\"words\":12,\"parts\":[{\"id\":\"s1.1\",\"text\":\"Moist roots slide out more easily and are less likely to tear.\"}]},{\"id\":\"s2\",\"name\":\"Pick a new pot\",\"words\":17,\"parts\":[{\"id\":\"s2.1\",\"text\":\"Choose one 2–5 cm wider than the old pot, with a drainage hole in the bottom.\"}]},{\"id\":\"s3\",\"words\":27,\"parts\":[{\"id\":\"s3.1\",\"text\":\"Tip the plant on its side, hold the stem at the base and ease the pot off.\"},{\"id\":\"s3.2\",\"text\":\"If it sticks, run a knife around the inside edge.\"}]},{\"id\":\"s4\",\"words\":19,\"parts\":[{\"id\":\"s4.1\",\"text\":\"Loosen the roots.\"},{\"id\":\"s4.2\",\"text\":\"Tease out circling roots with your fingers and cut off any that are black or mushy.\"}]},{\"id\":\"s5\",\"words\":30,\"parts\":[{\"id\":\"s5.1\",\"text\":\"Put a layer of fresh potting mix in the new pot, set the plant in so it sits at the same depth as before, and fill around it, pressing gently.\"}]},{\"id\":\"s6\",\"words\":11,\"parts\":[{\"id\":\"s6.1\",\"text\":\"Water it well and let it drain.\"},{\"id\":\"s6.2\",\"text\":\"Click here for aftercare.\",\"link\":true}]}]",
  "steps_note": ""
}

Reply:

{"title":"How to repot your houseplant","steps":[{"id":"s1","name":"Water the plant the day before","do":["s1.1"],"tips":[]},{"id":"s2","name":"Pick a new pot","do":["s2.1"],"tips":[]},{"id":"s3","name":"Remove the pot","do":["s3.1"],"tips":["s3.2"]},{"id":"s4","name":"Loosen the roots","do":["s4.1","s4.2"],"tips":[]},{"id":"s5","name":"Fill the new pot","do":["s5.1"],"tips":[]},{"id":"s6","name":"Water it well","do":["s6.1","s6.2"],"tips":[]}],"tools":["knife"],"supplies":["fresh potting mix"]}

On the page, the heading becomes “How to repot your houseplant”, steps 3 to 6 get short names such as “Remove the pot”, the knife sentence in step 3 becomes a tip, and Knife and Fresh potting mix join the “You will need” list.

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.
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://how-to-steps-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":"how-to-steps-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": "tidy", "title": "", "intro": "", "need": "{...}", "steps": "[...]", "steps_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="how-to-steps-generator:tidy:$(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: title, steps, tools, supplies
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: how-to-steps-generator:tidy:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json