Skip to content
Nexxtool AI

API reference

Base URL: https://nexxtool.ai

All requests authenticate with Authorization: Bearer wtk_<key>. JSON bodies up to 512KB.

POST /v1/validate

Checks a single AI reply against a rule set. Returns a verdict, score, issues, and optional repair.

Headers

HeaderRequiredDescription
AuthorizationYesBearer wtk_<key>
Content-TypeYesapplication/json
Idempotency-KeyNoAny string ≤200 chars. Replaying with the same key returns the original response. Replaying with a different body returns 409.

Body

{
  "output":   string | object,                      // your AI output
  "contract": { "type": "html"|"script"|"research"|"json"|"text", ... },
  "metadata": { "feature": "...", "model": "...", ... }   // optional, indexed
}

Response 200

{
  "validation_id": "v_01HX...",
  "pass":          boolean,
  "score":         number,        // 0.0 .. 1.0
  "issues":        string[],      // ["filler:lorem ipsum", "schema:.price required", ...]
  "repaired":      null | { output: ..., _repaired: true },
  "duration_ms":   number,
  "billed":        true,
  "cost_credits":  number,        // 1, or 2 if repair ran
  "usage": {
    "tier":      "free"|"starter"|"pro"|"scale",
    "used":      number,
    "cap":       number,
    "remaining": number,
    "period_start": "YYYY-MM-DD"
  }
}

Issue label prefixes

Every problem found is reported (not just the first), one entry per issue in issues. Prefixes:

Note: your own blocked phrases previously appeared as filler:<phrase>; they now appear as blocked:<phrase>. Built-in slop remains filler:. Matching is case-insensitive. The score drops 0.10 per issue of these kinds (floor 0).

Response 4xx / 5xx

StatusError codeWhen
400output_requiredMissing output field
400contract_requiredMissing or non-object contract
400invalid_contract_typeType not in allowed set
401missing_api_keyNo Authorization header
401malformed_api_keyHeader present but not in wtk_ format
401invalid_api_keyKey does not match any record
401revoked_api_keyKey was revoked
402quota_exceededMonthly cap hit; response includes upgrade URL
409idempotency_key_conflictSame key, different body
413output_too_largeOutput exceeds 256KB
429rate_limit_exceededPer-key rate limit (see Errors & rate limits)

GET /v1/usage

Current period usage snapshot.

curl -H "Authorization: Bearer wtk_..." \
  https://nexxtool.ai/v1/usage

GET /v1/validations

List recent checks. Supports filtering by pass, type, from, to, and limit (max 200).

curl -H "Authorization: Bearer wtk_..." \
  "https://nexxtool.ai/v1/validations?limit=20&pass=false"

GET /v1/validations/:id

Retrieve a single check by id.

GET /v1/health

Public, no authentication. Returns exactly {"ok":true} (HTTP 200) when a lightweight database query succeeds, or {"ok":false} (HTTP 503) when it does not. The result is cached for about 15 seconds. No other details are exposed.