RLB Whisk Docs

HTTP API reference

Base URL: https://reglegbrief.com/whisk/api/v1

Interactive docs

Endpoints

POST /spellcheck — check text (manual mode)

Request body:
{
  "text": "Ths is a smple sentnce.",
  "language": "en",
  "ignore": []          // optional; lowercased words to skip
}

Response 200:
{
  "language": "en",
  "total_words": 5,
  "misspellings": [
    {
      "word": "ths",
      "offset": 0,
      "length": 3,
      "suggestions": ["this", "the", "thus", "tho", "thy"],
      "kind": "spell"
    },
    ...
  ]
}

POST /spellcheck/apply — auto-fix (auto mode)

Request body: (same as /spellcheck)

Response 200:
{
  "language": "en",
  "total_words": 5,
  "corrected_text": "This is a simple sentence.",
  "changes": [
    {"offset": 0, "before": "Ths", "after": "This", "kind": "spell"},
    {"offset": 9, "before": "smple", "after": "simple", "kind": "spell"},
    {"offset": 15, "before": "sentnce", "after": "sentence", "kind": "spell"}
  ],
  "unresolved": []      // findings with no suggestion
}

GET /spellcheck/languages

Response 200:
{
  "supported": ["af", "ar", "be", ..., "vi"],
  "count": 49,
  "engine": "hunspell"
}

GET /health

Response 200:
{
  "status": "ok",
  "version": "0.3.0",
  "uptime_seconds": 12345,
  "languages": {"available": 49, "loaded_in_memory": 8},
  "bigrams_en_loaded": 258437
}

POST /keys — generate API key (self-serve)

See /whisk/keys/ for the friendly form.

Headers

Request

Response

Errors

Every non-2xx returns the same shape:

{
  "error": {
    "code": "invalid_language",
    "message": "Language 'xx' not available on this server.",
    "request_id": "req_abc123..."
  }
}
StatusCodeMeaning
400bad_requestMalformed input
401invalid_api_keyMissing/invalid/revoked key
422validation_errorRequest body fails schema
429rate_limit_exceededSlow down; check Retry-After
500internal_errorReport the request_id
503service_unavailableTry again in a moment

CORS

Permissive by default — any origin can call the API. Suitable for browser code with the caveat that a client-side API key is publicly visible; use the anonymous tier or a lightweight backend proxy for prod.

Versioning

The /api/v1/* namespace is stable. Breaking changes ship as /api/v2/* with at least 6 months' overlap. Legacy /api/* (unversioned) still works during the v0.3 transition but is undocumented and slated for removal.