← Bold Text Formatter
Your token

Bold Text Formatter API

Bold and italic letters, the preview, the checks and every export run free in the browser and need no API. The API is for the one metered step: send rough notes, a draft or an article, and get back a structured post as JSON. Its text carries **bold** and *italic* marks, which the page turns into Unicode bold and italic letters.

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

taskWhat it doesReply
formatArranges the text as a post: an opening line of at most 200 characters, 2 to 14 sections (paragraphs, headings, bullets, numbered points, dividers), a closing line and 3 to 6 hashtags, in the text's language. Facts, figures and names come only from the text; no links, no emoji.One JSON object

Input fields

FieldTypeMeaning
taskstring"format"
textstringThe notes or draft. The page sends at most 9,000 characters: longer text keeps its first and last lines and loses the middle, with a marker line. Styled letters are sent as ** and * marks.
patternstring"auto", "hook" (opening, points, takeaway), "list" (numbered lessons), "story" (story and lesson) or "resource" (share a guide or tool).
goalstringOptional, up to 200 characters: who the post is for or what it should do.
factsstringJSON text of what the page measured: chars, words, lines, hashtags, links, styled, has_marks. Send "{}" if you have nothing.
clipped_notestringEmpty, or a sentence saying the middle of the text was cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence): pattern (hook, list, story or resource), hook, blocks (a list of {"kind", "text"}, kind one of para, heading, bullet, number, divider), cta and hashtags. To build the post: the hook, a blank line, the blocks (headings as bold lines, bullets and numbers on consecutive lines, dividers as a line), a blank line, the closing line, a blank line and the hashtags. 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):

{
  "task": "format",
  "text": "notes for post - our first year running the repair cafe in Leeds\n\n- started March with 6 volunteers, now 23\n- fixed 412 items this year, mostly lamps, toasters, kids bikes\n- the sewing table is always the busiest, people bring jeans and coats\n- biggest lesson: people come for the fix but stay for the tea and the chat\n- we turned away electronics with mains damage at first, now Tom (qualified electrician) checks them\n- next year: a monthly session in Armley library, starting 14 February\n- we need more volunteers who can do bikes",
  "pattern": "auto",
  "goal": "",
  "facts": "{\"chars\":533,\"words\":90,\"lines\":8,\"hashtags\":0,\"links\":0,\"styled\":0,\"has_marks\":true}",
  "clipped_note": ""
}

Reply:

```json
{
  "pattern": "hook",
  "hook": "We fixed **412 items** in our first year running the repair cafe in Leeds.",
  "blocks": [
    {"kind": "para", "text": "We started in March with 6 volunteers. Now we are 23."},
    {"kind": "divider", "text": ""},
    {"kind": "heading", "text": "What we fixed"},
    {"kind": "bullet", "text": "412 items this year, mostly lamps, toasters and kids bikes."},
    {"kind": "bullet", "text": "The sewing table is always the busiest: people bring jeans and coats."},
    {"kind": "bullet", "text": "We turned away electronics with mains damage at first. Now Tom, a qualified electrician, checks them."},
    {"kind": "heading", "text": "The biggest lesson"},
    {"kind": "para", "text": "People come for the fix but stay for the *tea and the chat*."},
    {"kind": "heading", "text": "Next year"},
    {"kind": "bullet", "text": "A monthly session in Armley library, starting 14 February."},
    {"kind": "divider", "text": ""},
    {"kind": "para", "text": "We need more volunteers who can do **bikes**."}
  ],
  "cta": "Do you run or visit a repair cafe? Tell me what it taught you.",
  "hashtags": ["#RepairCafe", "#Leeds", "#Volunteering"]
}
```

On the page, the AI step turns this reply into styled text and checks it against the notes.

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://bold-text-formatter.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":"bold-text-formatter"}' | 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": "format", "text": "...", "pattern": "auto", "goal": "", "facts": "{...}", "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="bold-text-formatter:format:$(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: pattern, hook, blocks, cta, hashtags
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: bold-text-formatter:format:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json