← Affiliate Disclosure Generator
Your token

Affiliate Disclosure Generator API

Writing the disclosure page, the lines to paste, the checks and every export run free in the browser and need no API. The API is for the one metered step: send a creator's About page, media kit or notes and get back, as JSON, which platforms, ways of earning, regions, settings and extra sections fit it, each backed by a quote from the text. The page checks each quote, applies the ones it finds and rewrites the disclosure.

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

taskWhat it doesReply
tailorReads the description and picks the platforms (blog, youtube, instagram, tiktok, podcast, newsletter, pinterest, x), the ways of earning (affiliate, amazon, sponsored, gifted, referral, ads, own_products, ambassador), the regions (us, uk, eu, ca, au), the settings it settles (voice, tested, independent), extra sections (financial, health, results, ai_assist) and the affiliate programs it names, each with a verbatim quote; adds a short topic and up to three open questions. It never writes disclosure or legal text.One JSON object

Input fields

FieldTypeMeaning
taskstring"tailor"
descriptionstringAn About page, a media kit, a channel description or notes. The page sends at most 6,000 characters: longer text keeps its first and last lines and loses the middle, with a marker line.
currentstringJSON text of the current settings: name, platforms, earnings, regions, extras, voice, tested, independent, programs, topic. Send "{}" if you have none.
clipped_notestringEmpty, or a sentence saying the middle of the description was cut.

The reply

job.output.output is text holding one JSON object (sometimes inside a ```json fence): platforms, earnings, regions and extras (lists of {id, quote}), settings (a list of {key, value, quote}), programs (a list of {name, quote}), topic ({text, quote} or null) and questions (0 to 3 strings). Before applying a suggestion, check that its quote is in your description: the page ignores any it cannot find, and only ever adds options. 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": "tailor",
  "description": "About Wander Cheap\n\nWe are Maya and Leo, two former teachers from Manchester, UK, who quit to travel on a shoestring. Since 2019 we have been writing budget travel guides on wandercheap.com and posting a new video every Sunday on our YouTube channel.\n\nHow we keep the lights on: many links on the blog are affiliate links through Booking.com and Skimlinks, and our packing lists use Amazon affiliate links. A few videos each year are sponsored by travel brands, always ones we already use. Tourism boards sometimes cover a press trip, and we say so in that guide.\n\nWe test every backpack, power bank and app we recommend on real trips. No brand ever sees a video or post before it goes live.",
  "current": "{\"name\":\"Wander Cheap\",\"platforms\":[\"blog\"],\"earnings\":[\"affiliate\"],\"regions\":[\"us\"],\"extras\":[],\"voice\":\"i\",\"tested\":true,\"independent\":true,\"programs\":\"\",\"topic\":\"\"}",
  "clipped_note": ""
}

Reply:

```json
{
  "platforms": [
    {"id": "blog", "quote": "writing budget travel guides on wandercheap.com"},
    {"id": "youtube", "quote": "posting a new video every Sunday on our YouTube channel"}
  ],
  "earnings": [
    {"id": "affiliate", "quote": "many links on the blog are affiliate links through Booking.com and Skimlinks"},
    {"id": "amazon", "quote": "our packing lists use Amazon affiliate links"},
    {"id": "sponsored", "quote": "A few videos each year are sponsored by travel brands"},
    {"id": "gifted", "quote": "Tourism boards sometimes cover a press trip"}
  ],
  "regions": [{"id": "uk", "quote": "two former teachers from Manchester, UK"}],
  "settings": [
    {"key": "voice", "value": "we", "quote": "We are Maya and Leo"},
    {"key": "tested", "value": true, "quote": "We test every backpack, power bank and app we recommend"},
    {"key": "independent", "value": true, "quote": "No brand ever sees a video or post before it goes live"}
  ],
  "extras": [],
  "programs": [
    {"name": "Booking.com", "quote": "affiliate links through Booking.com and Skimlinks"},
    {"name": "Skimlinks", "quote": "affiliate links through Booking.com and Skimlinks"}
  ],
  "topic": {"text": "budget travel", "quote": "writing budget travel guides on wandercheap.com"},
  "questions": []
}
```

On the page, this reply turns a single blog's affiliate disclosure into a two-person blog and YouTube disclosure with Amazon Associates, sponsored videos, press trips, UK rules and Booking.com and Skimlinks named as programs.

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://affiliate-disclosure-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":"affiliate-disclosure-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": "tailor", "description": "...", "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="affiliate-disclosure-generator:tailor:$(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: platforms, earnings, regions, ...
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: affiliate-disclosure-generator:tailor:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json