← README Generator
Your token

README Generator API

Reading the package file, writing the README, the checks and every export run free in the browser and need no API. The API is for the one metered step: send a package file plus anything that shows how the project works (a --help output, a source file, notes) and get back, as JSON, a drafted one-line summary, description, features, requirements and usage examples, each backed by a quote from what you sent. The page checks each quote and every command, flag and function the examples use, keeps what it can back and rebuilds the README.

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

taskWhat it doesReply
draftReads the material and drafts the README's words: the kind of project (cli, library, app), a one-line summary, a description of at most 70 words, up to 6 features, up to 4 requirements and up to 3 usage examples, each with a verbatim quote from the material, plus up to three open questions. It never writes headings, badges or install commands.One JSON object

Input fields

FieldTypeMeaning
taskstring"draft"
materialstringThe package file under a === Package file === line and anything else under === Pasted by the visitor ===. The page sends at most 9,000 characters: longer text keeps its first and last lines and loses the middle, with a marker line.
currentstringJSON text of what the README has now: name, kind, ecosystem, package, command, tagline, description, features, requirements, usage. Send "{}" if you have none.
clipped_notestringEmpty, or a sentence saying the middle of the material was cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence): kind ({id, quote} or null), tagline ({text, quote} or null), description (a string), features and requirements (lists of {text, quote}), usage (a list of {title, code, quote}) and questions (0 to 3 strings). Before using a suggestion, check that its quote is in your material: the page drops any it cannot find, and any usage example that calls a command, flag, function or method the material never mentions. 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": "draft",
  "material": "=== Package file ===\n{\n  \"name\": \"mdlinkcheck\",\n  \"version\": \"1.4.2\",\n  \"description\": \"Check the links in your Markdown files: relative paths, heading anchors and web addresses.\",\n  \"bin\": {\n    \"mdlinkcheck\": \"./bin/cli.js\"\n  },\n  \"files\": [\"bin\", \"lib\"],\n  \"scripts\": {\n    \"test\": \"node --test\",\n    \"lint\": \"eslint .\"\n  },\n  \"keywords\": [\"markdown\", \"links\", \"cli\", \"docs\"],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/inkwell-tools/mdlinkcheck.git\"\n  },\n  \"license\": \"MIT\",\n  \"engines\": {\n    \"node\": \">=18\"\n  },\n  \"dependencies\": {\n    \"remark-parse\": \"^11.0.0\",\n    \"unified\": \"^11.0.4\"\n  }\n}\n\n=== Pasted by the visitor ===\n$ mdlinkcheck --help\nUsage: mdlinkcheck [options] <paths...>\n\nCheck every link in Markdown files: relative paths, #anchors and http(s) URLs.\n\nArguments:\n  paths                 files or folders to scan (folders are searched for *.md and *.mdx)\n\nOptions:\n  --offline             skip http(s) links, check only local files and anchors\n  --ignore <pattern>    glob of links to skip, can be repeated\n  --timeout <ms>        per-request timeout for web links (default: 8000)\n  --json                print results as JSON instead of a table\n  -q, --quiet           only print broken links\n  -V, --version         output the version number\n  -h, --help            display help for command\n\nExit status is 1 when at least one link is broken, 0 otherwise.\n\nExamples:\n  mdlinkcheck docs/\n  mdlinkcheck README.md CHANGELOG.md --offline\n  mdlinkcheck . --ignore \"https://localhost*\" --json > links.json",
  "current": "{\"name\":\"mdlinkcheck\",\"kind\":\"cli\",\"ecosystem\":\"npm\",\"package\":\"mdlinkcheck\",\"command\":\"mdlinkcheck\",\"tagline\":\"Check the links in your Markdown files: relative paths, heading anchors and web addresses.\",\"description\":\"\",\"features\":[],\"requirements\":[\"Node.js 18 or later\"],\"usage\":\"\"}",
  "clipped_note": ""
}

Reply:

{"kind":{"id":"cli","quote":"\"bin\": {"},"tagline":{"text":"Check every relative path, heading anchor and web link in your Markdown files from the terminal.","quote":"Check every link in Markdown files"},"description":"mdlinkcheck scans Markdown files or folders and checks every link in them: relative paths, heading anchors and http(s) URLs. It prints the results as a table, or as JSON, and exits with status 1 when at least one link is broken, so scripts can detect failures.","features":[{"text":"Checks relative paths, anchors and http(s) URLs","quote":"relative paths, #anchors and http(s) URLs"},{"text":"Searches folders for .md and .mdx files","quote":"*.md and *.mdx"},{"text":"Skips web links with --offline","quote":"skip http(s) links"},{"text":"Skips links matching a glob with --ignore, which can be repeated","quote":"can be repeated"},{"text":"Sets a per-request timeout for web links, default 8000 ms","quote":"per-request timeout for web links"},{"text":"Prints results as JSON instead of a table with --json","quote":"print results as JSON instead of a table"}],"requirements":[{"text":"Node.js 18 or later","quote":"\"node\": \">=18\""}],"usage":[{"title":"Check a folder","code":"mdlinkcheck docs/","quote":"mdlinkcheck docs/"},{"title":"Check local links only","code":"mdlinkcheck README.md CHANGELOG.md --offline","quote":"--offline"},{"title":"Save JSON, skipping localhost","code":"mdlinkcheck . --ignore \"https://localhost*\" --json > links.json","quote":"--ignore <pattern>"}],"questions":["Does it follow redirects when it checks a web link?","What columns does the table output show for each broken link?","Does --ignore match the link address or the link text?"]}

On the page, this reply fills the summary, description, six features and three usage examples of the mdlinkcheck README, every one backed by the package file or the --help output.

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://readme-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":"readme-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": "draft", "material": "...", "current": "{...}", "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="readme-generator:draft:$(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: kind, tagline, description, ...
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: readme-generator:draft:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json