API & SDK Reference

Most integrations only need the SDK (see Quickstart). This page summarizes the SDK surface and the Platform API for advanced / server-side use.

SDK — InferKit.init(config)

OptionTypeDefaultDescription
apiKeystringPublishable key (ik_pub_…). Required.
mode'auto'|'local'|'remote''auto'Force a mode, or let it choose by device/tier.
modelstring'auto'Local model size: nano/small/balanced/quality, or 'auto'. 'auto' picks by detected GPU tier.
gpuBenchmarkbooleantrueRun a brief WebGPU timing pass at init to refine the detected GPU tier (catches throttled/software GPUs).
groundingMinMatchesnumber1Min page-vocabulary overlap before a question reaches the model.
groundingbooleantrueDisable the on-page grounding gate.
autoOpenbooleanfalseOpen the widget on load.
refusalMessagestringCustom “I can only answer about this page” text.
onReady / onError / onMessagefunctionLifecycle callbacks.

The instance exposes ask(), open(), close(), on(evt, fn), and destroy().

Platform API (base: https://api.synapticortex.dev/v1)

EndpointAuthPurpose
GET /configpublishable keySDK init: tier, mode, model, limits, bot-challenge
POST /sessionpublishable keyExchange a Turnstile token for a short-lived session
POST /chatpublishable / secret keyRemote inference (SSE streaming)
POST /auth/signup · /auth/loginDeveloper accounts
GET /keys · POST /keys · …/rotate · DELETEJWTKey management (role-gated)
GET /usageJWTToken usage + breakdown
GET /org · members · POST /billing/checkoutJWTTeam & billing (role-gated)

Errors

Every error returns a stable shape:

{ "error": { "code": "rate_limited", "message": "…", "request_id": "9f3c…" } }

Branch on code; quote request_id to support. Full catalog: ERRORS.md.

Server-side use (Mode B)

Keep a secret key on your server and either call /v1/chat directly, or front InferKit with your own proxy and point the SDK at it via endpoint. Secret keys support an IP allowlist and are exempt from the browser bot challenge.