API docs

One endpoint: POST /api/check. Send a file, get the report as JSON.

1. Get a token

Log in, open the dashboard and create an API token. It is shown once; store it like a password. You can revoke it at any time.

2. Send a file

curl -X POST https://okayker.com/api/check \
  -H "Authorization: Bearer okk_YOUR_TOKEN" \
  -F "file=@vi.json" \
  -F "source=@en.json"
Form fields (multipart/form-data)
FieldRequiredMeaning
fileyesThe file to check, up to 5 MB. The format comes from the extension.
sourcenoSource file for key / column comparison (same format).
aino0 to skip the AI review.

3. Read the report

Example: the source en.json and the file vi.json below. The rule findings in the report are the engine's real output for these two files (checked by a test); the AI text is shortened.

// en.json
{
  "greeting": "Hello {name}",
  "farewell": "Goodbye"
}
// vi.json
{
  "greeting": "Xin chào",
}
{
  "report_id": "6f0c...",
  "format": "json",
  "summary": { "errors": 3, "warnings": 0, "info": 0, "ai": 1 },
  "findings": [
    { "layer": "rule", "label": "rule", "severity": "error",
      "code": "json.trailing_comma", "line": 2, "column": 25, "fixed": true,
      "message": "Trailing comma before a closing bracket is not allowed in JSON; removed in the corrected copy." },
    { "layer": "rule", "label": "rule", "severity": "error",
      "code": "key.missing", "key": "farewell",
      "message": "Key \"farewell\" is in the source file but missing here." },
    { "layer": "rule", "label": "rule", "severity": "error",
      "code": "placeholder.mismatch", "line": 2, "key": "greeting",
      "message": "Placeholder(s) {name} from the source are missing in the translation." },
    { "layer": "ai", "label": "AI suggestion", "severity": "suggestion",
      "code": "ai.review", "where": "greeting", "message": "..." }
  ],
  "ai": { "status": "ok", "note": "..." },
  "corrected": { "available": true, "name": "vi.fixed.json",
                 "expires_at": "...", "fixes": ["removed 1 trailing comma(s)"],
                 "content": "..." }
}

Every finding has layer (rule or ai) and label (rule or AI suggestion). Rule findings have a severity of error, warning or info, a code and, where it applies, a line.

Errors

HTTP status codes
StatusMeaning
400No file, or the request is not multipart/form-data.
401Missing, wrong or revoked token.
413File larger than 5 MB.
415Unsupported file type.
422The file could not be read at all (a parse problem the checker could not turn into a report).
429Daily limit of 200 checks reached.