← Time Block Planner
Your token

Time Block Planner API

Reading the list, building the time-blocked day and every export run free in the browser and need no API. The API is for the one metered step: send the list, get back an honest estimate for each task, which one thing comes first, which tasks can wait, and a two-minute first step for each. Your own code then lays out the day (or paste the reply into the page).

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

taskWhat it doesReply
planJudges every task that is not a fixed appointment: realistic minutes (5 to 480), a tier (one, nice, fire, rest, later) and a first step of 3 to 12 words. It never moves appointments and never adds tasks.One ```json block: {"items": [...], "note": "..."}

Input fields

FieldTypeMeaning
taskstring"plan"
tasksstringOne task per line: id | label | time info | flags. Ids are t1, t2, ... Time info is you wrote N min, no time given or fixed HH:MM-HH:MM; the flag marked important is optional. The page sends at most 60 flexible tasks, important ones first.
daystringDate, working hours, lunch, break between tasks and longest focus block, in words.
factsstringJSON text: tasks, fixed, sent, free_minutes, asked_minutes, no_time_given, page_multiplier, overflow_minutes. Send "{}" if you have nothing.
notestringOptional, up to 200 characters about today ("report due at 5pm", "low energy").
clipped_notestringEmpty, or a sentence saying not every task was sent.

The reply

job.output.output is text: one fenced ```json block holding {"items": [{"id", "minutes", "tier", "first_step"}], "note"}. Exactly one item has tier one; later appears only when the list does not fit the day. If the balance ran low, truncated is true and the block may stop early; the page then keeps every whole item it can read.

Worked example

Input (input.json):

{
  "task": "plan",
  "tasks": "t1 | Finish the grant report draft | you wrote 120 min | marked important\nt2 | team standup | fixed 10:00-10:30\nt3 | Reply to client emails | you wrote 20 min\nt4 | Call the bank about the card | no time given\nt5 | dentist | fixed 14:00-15:00\nt6 | Book flights for March | no time given\nt7 | Review Ana pull request | you wrote 30 min\nt8 | Groceries | no time given\nt9 | Read chapter 4 for book club | you wrote 45 min\nt10 | Tidy desk | no time given",
  "day": "Thu 3 Dec 2026, 09:00-17:30, lunch 12:30 for 45 min, 10 min between tasks, focus blocks up to 90 min",
  "facts": "{\"tasks\":8,\"fixed\":2,\"sent\":10,\"free_minutes\":325,\"asked_minutes\":505,\"no_time_given\":4,\"page_multiplier\":1.5,\"overflow_minutes\":250}",
  "note": "Report is due to the funder at 5pm today",
  "clipped_note": ""
}

Reply:

```json
{
  "items": [
    {"id": "t1", "minutes": 180, "tier": "one", "first_step": "Open the grant report draft and write the next sentence"},
    {"id": "t3", "minutes": 30, "tier": "nice", "first_step": "Open the inbox and read the newest client email"},
    {"id": "t4", "minutes": 40, "tier": "rest", "first_step": "Find the card and the bank's phone number"},
    {"id": "t6", "minutes": 45, "tier": "later", "first_step": "Open a flight search page and enter March"},
    {"id": "t7", "minutes": 45, "tier": "fire", "first_step": "Open the pull request and read the description"},
    {"id": "t8", "minutes": 60, "tier": "later", "first_step": "Write the grocery list on paper"},
    {"id": "t9", "minutes": 60, "tier": "later", "first_step": "Open the book to chapter 4"},
    {"id": "t10", "minutes": 15, "tier": "later", "first_step": "Clear one item off the desk"}
  ],
  "note": "The report is due at 5pm, so it gets the first long block; the list is well over the free time, so four smaller tasks move to another day."
}
```

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://time-block-planner.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":"time-block-planner"}' | 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": "plan", "tasks": "t1 | ... | you wrote 120 min", "day": "...", "facts": "{...}", "note": "", "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="time-block-planner:plan:$(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' | sed '/^```/d' > reply.json   # {items, note} without the ```json fence
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: time-block-planner:plan:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json