KERNIT Documentation
cURL integration
This cURL workflow is useful for CI checks and integration debugging because it shows every multipart request in the scan, resolve, review, and apply chain.
Run the Workflow#
export KERNIT_API_KEY="sk_kernit_live_YOUR_KEY"
export SETTINGS='{ "refs": true, "figures": "number", "tables": "number", "equations": "number", "sections": "number", "doi": true, "crossref": true, "refTitleLink": false, "linkColor": "#0077BD", "xrefLinkColor": "#0077BD"}'
curl -sS -X POST https://api.kernit.org/hyperlink-scan \
-H "Authorization: Bearer $KERNIT_API_KEY" \
-F "[email protected]" \
-F "settings=$SETTINGS" > scan.json
SCAN_FINGERPRINT=$(node -e "console.log(require('./scan.json').scanFingerprint)")
SCAN_TOKEN=$(node -e "console.log(require('./scan.json').scanToken)")
curl -sS -X POST https://api.kernit.org/hyperlink-crossref \
-H "Authorization: Bearer $KERNIT_API_KEY" \
-F "[email protected]" \
-F "settings=$SETTINGS" \
-F "scanFingerprint=$SCAN_FINGERPRINT" > resolved.json
node -e "const scan=require('./scan.json'); const decisions=(scan.matches||[]).map(m=>({refId:m.refId,status:(m.confidence||0)>=0.9?'approved':'skipped',targetId:m.targetId})); require('fs').writeFileSync('decisions.json', JSON.stringify(decisions));"
curl -sS -X POST https://api.kernit.org/hyperlink-apply \
-H "Authorization: Bearer $KERNIT_API_KEY" \
-F "[email protected]" \
-F "settings=$SETTINGS" \
-F "scanFingerprint=$SCAN_FINGERPRINT" \
-F "scanToken=$SCAN_TOKEN" \
-F "[email protected];type=application/json" \
-F "[email protected];type=application/json" > applied.json
node -e "const out=require('./applied.json'); require('fs').writeFileSync('paper.linked.docx', Buffer.from(out.docx, 'base64')); console.log('Wrote paper.linked.docx with', out.linkCount, 'links');"What It Produces#
The commands create scan.json, resolved.json, decisions.json, applied.json, and paper.linked.docx. Keep those JSON files while debugging a review session.
Workflow Template Contract#
This template is maintained with the endpoint examples and the current OpenAPI contract. It is the canonical cURL workflow until an official KERNIT CLI or SDK package is published.
Was this page useful?Send a lightweight docs feedback event.