← Terms of Service Generator
Your token

Terms of Service Generator API

Writing the terms, the checks and every export run free in the browser and need no API. The API is for the one metered step: send a description of a product and get back, as JSON, which product type, settings and extra sections fit it, each backed by a quote from the description. The page checks each quote, applies the ones it finds and rewrites the terms.

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 product type (website, account, saas, store, mobile, api, marketplace, ai_tool), the settings it settles (accounts, paid, user_content, public_content, ai, min_age, eu), extra sections (not_advice_health, not_advice_financial, not_advice_legal, beta, free_trial, integrations, ai_images) and the AI providers it names, each with a verbatim quote; writes a short description of the product and up to three open questions. It never writes legal text.One JSON object

Input fields

FieldTypeMeaning
taskstring"tailor"
descriptionstringHomepage text, an app store listing or notes about the product. 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: category, accounts, paid, user_content, public_content, ai, min_age, eu, extras, ai_providers, name. 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): category {id, quote}, settings (a list of {key, value, quote}), clauses (a list of {id, quote}), ai_providers (a list of {name, quote}), summary (at most 45 words), quota ({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. 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": "Inboxly - shared inbox for small support teams\n\nInboxly pulls your team's support email into one shared inbox, tags each message by topic and drafts a reply that an agent can edit before sending. Drafts are written by GPT-4o from OpenAI, using only the conversation and your saved help articles.\n\nConnect Gmail or Outlook in two clicks. Invite your teammates and assign conversations to each other.\n\nPlans from $12 per user a month, billed monthly or yearly. Every plan starts with a 14-day free trial, no card needed.\n\nBuilt in Lisbon for teams across Europe.",
  "current": "{\"category\":\"website\",\"accounts\":false,\"paid\":\"free\",\"user_content\":false,\"public_content\":false,\"ai\":false,\"min_age\":13,\"eu\":true,\"extras\":[],\"ai_providers\":\"\",\"name\":\"Inboxly\"}",
  "clipped_note": ""
}

Reply:

```json
{
  "category": {"id": "saas", "quote": "billed monthly or yearly"},
  "settings": [
    {"key": "paid", "value": "subscription", "quote": "billed monthly or yearly"},
    {"key": "accounts", "value": true, "quote": "Invite your teammates and assign conversations to each other"},
    {"key": "ai", "value": true, "quote": "Drafts are written by GPT-4o from OpenAI"},
    {"key": "eu", "value": true, "quote": "Built in Lisbon for teams across Europe"}
  ],
  "clauses": [
    {"id": "free_trial", "quote": "14-day free trial"},
    {"id": "integrations", "quote": "Connect Gmail or Outlook in two clicks"}
  ],
  "ai_providers": [
    {"name": "OpenAI", "quote": "GPT-4o from OpenAI"},
    {"name": "GPT-4o", "quote": "Drafts are written by GPT-4o"}
  ],
  "summary": "Inboxly gathers a support team's email into one shared inbox, tags each message by topic and drafts replies that an agent can edit before sending.",
  "quota": null,
  "questions": [
    "Can a customer get a refund for a partly used month or after the trial ends?",
    "Is there a minimum age for people who sign up?",
    "Who owns the customer emails and saved help articles that teams bring into Inboxly?"
  ]
}
```

On the page, this reply turns a plain website's terms into a subscription service's, with free-trial, connected-accounts and AI sections and OpenAI named as a provider.

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://terms-of-service-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":"terms-of-service-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="terms-of-service-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: category, settings, clauses, ...
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: terms-of-service-generator:tailor:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json