← Showcase Page Generator
Your token

Showcase Page Generator API

Reading your list, checking it and writing the gallery HTML with its category filter, the CSS, the head tags with CollectionPage JSON-LD, Markdown and the project list all run free in the browser and need no API. The API is for the one metered step: send your projects, numbered, with their title, creator, category, caption, date, link and whether they have a picture, and get back, as JSON, a category for each project that has none, up to three projects to feature when you featured none, and a one-line caption for projects that have none or whose caption is filler. The page checks every id, category and pick, and refuses any category or caption that adds a number, a name or a claim your list does not contain.

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

taskWhat it doesReply
refineGives each project with no category a category, picks up to three projects with a picture to feature (complete_entry, clear_example, shows_range) when none is featured, and writes a one-line caption for projects with none or with filler.One JSON object

Input fields

All values are strings. task and projects are required.

FieldMeaning
task"refine"
productThe product the work was made with, or "".
headingYour page heading, or "".
categoriesThe categories your list already uses, separated by ; , or "".
projectsJSON text: [{id, title, creator, category, desc, desc_issue, date, link, has_image, featured}] in list order, ids like p4. desc_issue is filler, claim or ""; link is the address without https://; has_image and featured are booleans. At most 60.
items_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 three keys: sort, a list of {id, category} for projects that had no category; featured, a list of {id, why}; and blurbs, a list of {id, text} captions. Before using it, check every id, that no categorised project is moved, that a new category uses only words from your list, that a featured project has a picture and a link, and that a caption adds no number, name or claim; 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 choice that arrived whole.

Worked example

Input (input.json), the spreadsheet sample on the page:

{
  "task": "refine",
  "product": "Pixelpine",
  "heading": "",
  "categories": "Portfolio; Online store; Booking; Blog",
  "projects": "[{\"id\":\"p1\",\"title\":\"Fern House\",\"creator\":\"Mara Lind\",\"category\":\"Portfolio\",\"desc\":\"A florist's portfolio with seasonal bouquets and a booking form.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"fernhouse.example.com\",\"has_image\":true,\"featured\":true},{\"id\":\"p2\",\"title\":\"Northline Coffee\",\"creator\":\"Northline Roasters\",\"category\":\"Online store\",\"desc\":\"Beans by origin, a subscription page and local pickup.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"northline.example.com\",\"has_image\":true,\"featured\":false},{\"id\":\"p3\",\"title\":\"Tidewater Yoga\",\"creator\":\"Ana Ruiz\",\"category\":\"Booking\",\"desc\":\"Class times and drop-in booking for a studio with 3 teachers.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"tidewateryoga.example.com\",\"has_image\":true,\"featured\":true},{\"id\":\"p4\",\"title\":\"Paper Trail\",\"creator\":\"Sam Okafor\",\"category\":\"Blog\",\"desc\":\"A stunning, powerful blog that will amaze you.\",\"desc_issue\":\"filler\",\"date\":\"\",\"link\":\"papertrail.example.com\",\"has_image\":true,\"featured\":false},{\"id\":\"p5\",\"title\":\"Hollow Oak Cabins\",\"creator\":\"Hollow Oak\",\"category\":\"\",\"desc\":\"Two cabins by a lake, with a calendar of free nights.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"hollowoak.example.com\",\"has_image\":true,\"featured\":false},{\"id\":\"p6\",\"title\":\"Kiln and Clay\",\"creator\":\"Priya Nair\",\"category\":\"Online store\",\"desc\":\"\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"kilnandclay.example.com\",\"has_image\":true,\"featured\":false},{\"id\":\"p7\",\"title\":\"Brightside Tutoring\",\"creator\":\"Leo Park\",\"category\":\"Booking\",\"desc\":\"Book a maths or physics lesson after school.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"brightside.example.com\",\"has_image\":false,\"featured\":false},{\"id\":\"p8\",\"title\":\"Atlas Run Club\",\"creator\":\"Atlas Run Club\",\"category\":\"\",\"desc\":\"Weekly routes, a race calendar and member sign-up.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"atlasrun.example.com\",\"has_image\":true,\"featured\":true},{\"id\":\"p9\",\"title\":\"Juniper Studio\",\"creator\":\"Juniper Studio\",\"category\":\"Portfolio\",\"desc\":\"Brand and packaging work for small food makers.\",\"desc_issue\":\"\",\"date\":\"\",\"link\":\"juniper.example.com/work\",\"has_image\":true,\"featured\":false}]",
  "items_note": ""
}

Reply:

{"sort":[{"id":"p5","category":"Booking"},{"id":"p8","category":"Run club"}],"featured":[],"blurbs":[{"id":"p4","text":"A blog called Paper Trail by Sam Okafor, made with Pixelpine"},{"id":"p6","text":"An online store called Kiln and Clay by Priya Nair, made with Pixelpine"}]}

On the page, the cabins go under Booking and the run club under a new Run club category, the pottery store gets a caption, and the blog’s filler caption is rewritten. Nothing is featured by AI because the list already marks three projects.

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://showcase-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":"showcase-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": "refine", "product": "Pixelpine", "heading": "", "categories": "Portfolio; Online store; Booking; Blog", "projects": "[...]", "items_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="showcase-page-generator:refine:$(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: sort, featured, blurbs
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: showcase-page-generator:refine:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json