← Download Page Generator
Your token

Download Page Generator API

Reading the release, sorting files by system and chip, the download section's HTML, CSS, device-detect script, SoftwareApplication JSON-LD and the check all run free in the browser and need no API. The API is for the one metered step: send the app's name, what the page found (systems, stores, price) and the visitor's own description split into numbered sentences, and get back, as JSON, a heading, a line under it, up to five features that each cite the sentences they come from, the word on the button, and a search title and description. The page checks every line against the visitor's words and refuses numbers and claims they did not make.

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

taskWhat it doesReply
copyWrites the heading, the line under it, 0 to 5 features citing your sentences, the button word, and the search title and description, only from what you sent.One JSON object

Input fields

All values are strings. task, name and about are required.

FieldMeaning
task"copy"
nameThe app's name.
factsJSON text: {name, version, systems, stores, files, price, checksums}, where systems lists names such as "macOS", price is "free", "paid" or "unknown" and checksums is true when SHA-256 values are shown.
aboutJSON text: your description as [{id, text}], one sentence each, ids s1, s2 and so on; at most 30. May be [].
about_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 six keys: headline (8-70 characters, at most 12 words), subhead (20-180), features (a list of {text, from}, 12-110 characters each, from the sentence ids it is drawn from; [] when about is empty), cta (2-24 characters, no system name: the page adds "for macOS" and the like), meta_title (10-60, contains the name) and meta_description (50-160). Before using it, check the lengths, that every cited id is one you sent, and that no number or claim word (best, secure, free, offline, rated and so on) appears that your own text does not contain; 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 line that arrived whole.

Worked example

Input (input.json), the desktop app (GitHub release) sample on the page:

{
  "task": "copy",
  "name": "Inkpad",
  "facts": "{\"name\":\"Inkpad\",\"version\":\"2.4.1\",\"systems\":[\"macOS\",\"Windows\",\"Linux\"],\"stores\":[],\"files\":5,\"price\":\"unknown\",\"checksums\":true}",
  "about": "[{\"id\":\"s1\",\"text\":\"Inkpad is a plain-text notebook that keeps every note as a Markdown file in a folder you choose.\"},{\"id\":\"s2\",\"text\":\"Search now finds words inside attached PDFs.\"},{\"id\":\"s3\",\"text\":\"Notes open twice as fast on large folders.\"},{\"id\":\"s4\",\"text\":\"Fixed a crash when a note title contained an emoji.\"}]",
  "about_note": ""
}

Reply:

{"headline":"Every note a Markdown file in a folder you choose","subhead":"A plain-text notebook that keeps every note as a Markdown file in a folder you choose.","features":[{"text":"Every note is a Markdown file in a folder you choose","from":["s1"]},{"text":"Search finds words inside attached PDFs","from":["s2"]},{"text":"Notes open twice as fast on large folders","from":["s3"]}],"cta":"Download","meta_title":"Download Inkpad for macOS, Windows and Linux","meta_description":"Inkpad is a plain-text notebook that keeps every note as a Markdown file in a folder you choose. Search finds words inside PDFs."}

On the page, every line checks out: the heading and line under it replace "Download Inkpad", the three features appear under the button, the button reads "Download for macOS" (or Windows, or Linux), and the search title and description go into the test page's head.

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://download-page-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":"download-page-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": "copy", "name": "Inkpad", "facts": "{...}", "about": "[...]", "about_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="download-page-generator:copy:$(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: headline, subhead, features, cta, meta_title, meta_description
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: download-page-generator:copy:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json