REST API for programmatic contract analysis. Get a key from your API keys page.
All requests need a Bearer token in the Authorization header.
Authorization: Bearer cc_live_xxxxxxxxxxxxxxxxxxxx
60 requests per minute per API key. Exceeding returns HTTP 429.
{ "error": { "code": "insufficient_credits", "message": "..." } }/api/public/v1/analyzeAnalyze a contract. Costs 8 credits. Set save: true to persist to your reports history.
curl -X POST https://fortheclause.com/api/public/v1/analyze \
-H "Authorization: Bearer cc_live_..." \
-H "Content-Type: application/json" \
-d '{
"text": "...full contract text (min 50 chars, max 80000)...",
"fileName": "lease.pdf",
"save": true
}'Response:
{
"credits_spent": 8,
"balance": 42,
"report_id": "uuid-or-null",
"breakdown": { "contractType": "...", "summary": "...", "riskFlags": [...], ... }
}/api/public/v1/creditscurl https://fortheclause.com/api/public/v1/credits \
-H "Authorization: Bearer cc_live_..."
# → { "balance": 42 }/api/public/v1/credits/transactionsQuery params: limit (1-200, default 50), offset (default 0).
curl "https://fortheclause.com/api/public/v1/credits/transactions?limit=20" \ -H "Authorization: Bearer cc_live_..."
/api/public/v1/reportsList your saved reports. Query params: limit, offset.
curl https://fortheclause.com/api/public/v1/reports \ -H "Authorization: Bearer cc_live_..."
/api/public/v1/reports/{id}Fetch a single report. Locked reports return breakdown: null until unlocked.
curl https://fortheclause.com/api/public/v1/reports/REPORT_ID \ -H "Authorization: Bearer cc_live_..."
/api/public/v1/reports/{id}/unlockUnlock a saved report. Cost: 8 credits standard, 4 for user-private, 1 for sensitive (NDA/medical).
curl -X POST https://fortheclause.com/api/public/v1/reports/REPORT_ID/unlock \ -H "Authorization: Bearer cc_live_..."
Out of credits? Create a Stripe Checkout session and redirect the user. Once payment completes, credits are added to the account that owns the API key (via webhook — usually within a second). Then keep calling the API as normal.
/api/public/v1/credits/packsList available credit packs.
curl https://fortheclause.com/api/public/v1/credits/packs \
-H "Authorization: Bearer cc_live_..."
# → { "packs": [
# { "id": "credits_40_pack", "price_id": "credits_40",
# "credits": 40, "amount_cents": 2000, "currency": "USD",
# "label": "Standard", "tagline": "5 detailed breakdowns" },
# ...
# ] }/api/public/v1/credits/checkoutCreate a hosted Stripe Checkout session. Returns a checkout_url you redirect the user to. Credits land automatically when payment completes.
curl -X POST https://fortheclause.com/api/public/v1/credits/checkout \
-H "Authorization: Bearer cc_live_..." \
-H "Content-Type: application/json" \
-d '{
"price_id": "credits_40",
"success_url": "https://yourapp.com/credits/done",
"cancel_url": "https://yourapp.com/credits"
}'Response:
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_...",
"session_id": "cs_...",
"pack": { "id": "credits_40_pack", "credits": 40, "amount_cents": 2000, "currency": "USD" }
}