← Image Slider Generator
Your token

Image Slider Generator API

Reading your photos, previewing the slider, checking it and writing the HTML, CSS, JavaScript 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 where the slider goes and how it should feel, with your photo list (names, sizes, descriptions, captions; never the photos), and get back, as JSON, the settings and any captions or descriptions your words supply. The page builds this input for you and re-checks every setting and word 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": "slider".

taskWhat it doesReply
sliderReads a description of a photo slider and the current photo list, and returns settings plus captions or descriptions only where the description supplies the words. An empty description fixes the current slider's flagged problems.One JSON object

Input fields

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

FieldMeaning
task"slider"
descriptionWhere the slider goes, how it should feel, and any captions or descriptions (at most 1,500 characters). May be empty.
currentOne line per photo: N. file: name | WxH | alt: text or (none) | caption: text or (none), at most 4,000 characters.
page_check{photos, transition, aspect, fit, autoplay, interval_ms, duration_ms, easing, arrows, dots, loop, captions, pause_on_hover, pause_button, missing_alt, captions_written, worst_crop_pct, verdict, notes} from the page.
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, slides ([{n, caption?, alt?}], only the photos whose words change) and notes, plus any settings it chose: transition (slide, fade or peek), aspect (16:9, 3:2, 4:3, 1:1, 4:5 or 21:9), fit (cover or contain), autoplay, interval_ms, duration_ms, easing (smooth, out, inout or linear), arrows, dots, loop, captions. A missing setting means keep the current one. Before publishing, check that every caption and description says what is in the photo; the model cannot see photos. 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 three-banner homepage slider for a cafe, asking for a calm pace and giving three captions:

{
  "task": "slider",
  "description": "Homepage banner for our cafe website. It should feel calm and slow, and give people time to read each one. Captions: Spring menu now on / Brunch every Sunday from 9 / Gift cards at the counter.",
  "current": "1. file: spring-menu.svg | 2100x900 | alt: Coral banner with a plate of fresh vegetables | caption: The spring menu is here\n2. file: book-a-table.svg | 2100x900 | alt: Green banner with a calendar card | caption: Book a table for Sunday brunch\n3. file: gift-cards.svg | 2100x900 | alt: Purple banner with a wrapped gift card | caption: Gift cards for every occasion",
  "page_check": "{\"photos\":3,\"transition\":\"fade\",\"aspect\":\"21:9\",\"fit\":\"cover\",\"autoplay\":true,\"interval_ms\":5000,\"duration_ms\":600,\"easing\":\"smooth\",\"arrows\":true,\"dots\":true,\"loop\":true,\"captions\":true,\"pause_on_hover\":true,\"pause_button\":true,\"missing_alt\":0,\"captions_written\":3,\"worst_crop_pct\":0,\"verdict\":\"good\",\"notes\":[]}",
  "clipped_note": ""
}

Reply:

{"summary":"A homepage banner that fades gently from one banner to the next and stays on each long enough to read, so it feels calm and slow. Your three captions are matched to the banners in order.","name":"Cafe Homepage Banner","transition":"fade","aspect":"21:9","fit":"cover","autoplay":true,"interval_ms":7000,"duration_ms":700,"easing":"smooth","arrows":true,"dots":true,"loop":true,"captions":true,"slides":[{"n":1,"caption":"Spring menu now on"},{"n":2,"caption":"Brunch every Sunday from 9"},{"n":3,"caption":"Gift cards at the counter"}],"notes":["Check each caption sits on the right banner","Watch the banner once to see if the pace feels slow enough"]}

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://image-slider-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":"image-slider-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": "slider", "description": "Product photos for my shop, people flick through them", "current": "1. file: mug.jpg | 1600x1200 | alt: Blue mug | caption: (none)\n2. file: tote.jpg | 1600x1200 | alt: Canvas tote | caption: (none)", "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="image-slider-generator:slider:$(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, transition, aspect, autoplay, interval_ms, duration_ms, slides, 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: image-slider-generator:slider:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json