KeySmith API Docs

Generate and validate license keys for your apps.

1. Validate a License Key

Public endpoint — no auth required.

POST /api/validate
Content-Type: application/json

{
  "key": "KS-A1B2C3D4..."
}

Response:

{
  "valid": true,
  "label": "Acme App Pro",
  "used": 2,
  "maxActivations": 5
}

2. Generate a Key (Authenticated)

Requires a logged-in session (cookie auth). Call from your dashboard or server-side.

POST /api/protected/licenses
Content-Type: application/json
Cookie: token=<jwt>

{
  "label": "Acme App Pro",
  "product": "AcmeApp v2",
  "maxActivations": 5
}

3. Error Codes

  • 400 plan_limit — Your current plan does not allow more keys.
  • 400 invalid_key — The validation key format is wrong.
  • 401 Unauthorized — Missing or expired session.
  • 429 — Rate limited. Max 10 requests per 15 min on auth endpoints.

4. Plans & Limits

  • Free: 1 key
  • Starter ($9/mo): 5 keys
  • Pro ($29/mo): 50 keys