← Progressive Blur Generator
Your token

Progressive Blur Generator API

Building the blur, previewing it, measuring the picture under it and writing the HTML + CSS, Tailwind and React code all run free in the browser and need no API; the code is generated from the settings with the same recipe on every call. The API is for the one metered step: send the blur's settings, the page's measurements and a description of where the blur goes, and get back, as JSON, settings fitted to that page with a reason for each change, placement steps and things to check. The page builds this input for you, measures the text contrast again under the suggested settings, and turns them into code.

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

taskWhat it doesReply
fitReads the blur's settings, the page's measurements of the picture under it and your description of where it goes, and returns fitted settings (edge, size, layers, strongest blur, position, z-index, colour fade), the text colour to use on it, a reason for each change, placement steps and things to check on a real device.One JSON object

Input fields

Every field is a string; settings and page_facts hold JSON text.

FieldMeaning
task"fit"
settings{edge, size, unit, layers, max_blur, position, z_index, fade_color, fade_strength}: edge top/bottom/left/right; unit px or %; layers 3-12 (each twice the blur of the one before); max_blur 1-128 px; position fixed or absolute; fade_color "" or #rrggbb; fade_strength 0-1.
page_facts{picture, plain_under_blur, white_text_contrast, dark_text_contrast, better_text, fade_needed, phone_screen_share, blur_steps_px, verdict, notes}, measured by the page from the picture under the blur. Send "picture": "example" and null contrasts when you have no picture.
descriptionOptional: where the blur goes, what sits on it (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: summary, settings (the same nine keys as the input, as JSON numbers and strings), text_color (light, dark or none), reasons (one {setting, why} per changed setting), placement (steps) and checks. Before using the settings, check each value is in range and every change has a reason, as the page does; the page also measures the text contrast again under the suggested settings. 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 "Top bar over a photo feed" example:

{
  "task": "fit",
  "settings": "{\"edge\":\"top\",\"size\":110,\"unit\":\"px\",\"layers\":8,\"max_blur\":64,\"position\":\"fixed\",\"z_index\":5,\"fade_color\":\"\",\"fade_strength\":0}",
  "page_facts": "{\"picture\":\"example\",\"plain_under_blur\":false,\"white_text_contrast\":1.08,\"dark_text_contrast\":14.4,\"better_text\":\"dark\",\"fade_needed\":null,\"phone_screen_share\":0.138,\"blur_steps_px\":[0.5,1,2,4,8,16,32,64],\"verdict\":\"good\",\"notes\":[]}",
  "description": "Sticky top navigation bar of a travel photo-feed web app, 64px tall. The logo \"Wander\" is on the left and three text links on the right; photo cards scroll under the bar. Light theme.",
  "clipped_note": ""
}

Reply:

{"summary":"Your blur already fits, so I kept every setting. At 110px it reaches about 1.7 times a 64px bar, so the fade finishes below the bar instead of ending in a hard line. The measurements came from an example page, so treat dark text and no fade as a starting point (dark text measured 14.4 to 1, white only 1.08 to 1) and check them on your own page.","settings":{"edge":"top","size":110,"unit":"px","layers":8,"max_blur":64,"position":"fixed","z_index":5,"fade_color":"","fade_strength":0},"text_color":"dark","reasons":[],"placement":["Put the blur element near the top of the page markup, before the photo feed, so the cards scroll under it.","Keep the navigation bar itself above the blur, and keep the blur above the photo cards.","Keep the blur under any menus, dropdowns or dialogs, which often use z-index 50 to 1000; 5 stays below those.","Keep pointer-events none on the blur so the logo and links still take clicks."],"checks":["Scroll a photo card under the bar on a real phone and confirm the logo Wander and the three links stay easy to read in dark text.","On a low-end phone, watch for scroll lag; if it stutters, try 6 layers or fewer.","Open any menu or dialog and confirm it appears above the blur."]}

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://progressive-blur-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":"progressive-blur-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": "fit", "settings": "{\"edge\": \"top\", \"size\": 110, ...}", "page_facts": "{...}", "description": "Sticky 64px header over a photo feed", "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="progressive-blur-generator:fit:$(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, settings, text_color, reasons, placement, checks
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: progressive-blur-generator:fit:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json