ExpressAI
ExpressAI is the SDK module for encrypted AI chat completions. It lets a host application send OpenAI-shaped chat conversations to the ExpressAI service and consume the answer as a live token stream, without the application having to deal with authentication, encryption, or transport details.
What the SDK does for you
- End-to-end encryption to an attested enclave. Prompts are encrypted on-device and only decrypted inside ExpressAI's secure enclave; response chunks arrive encrypted and are decrypted by the SDK. Before anything is sent, the SDK verifies the enclave's attestation against a root CA pinned in the SDK configuration. Intermediaries (including the API edge) never see plaintext conversations.
- Authentication. Requests are authenticated with short-lived signed request tokens derived from the user's subscription. The SDK creates and refreshes these automatically; the host only passes a
subscriptionId. - Censorship-resistant transport (native targets). ExpressAI calls ride the SDK's regular API stack, including Geo Unblocking (DSS & NT) — chat completions keep working in blocked regions with no extra handling. The wasm/browser build uses plain browser
fetchinstead (see Requirements below). - Streaming ergonomics.
startChatCompletionreturns a pull-basedExpressAiChatStream: the host callsnext()at its own pace, can drain everything in one call, and owns cancellation.
The first completion of a session performs the one-time enclave attestation and session setup, so it is a little slower; the session is cached and reused for subsequent completions.
Requirements
- License — the SDK license must include the ExpressAI category.
sdkManager.expressAi()throws if the feature is not licensed. - Entitlement — every call takes a
subscriptionIdthat must hold the AI entitlement (see Chat Completions). - Configuration — the
express_aiconfiguration block must be set, see Enabling & Configuring. - Platform — ExpressAI is available on all targets. On native it rides the censorship-resistant DSS/NT transport; in the wasm/browser build it uses the browser's
fetchtransport instead — fully functional and end-to-end encrypted, but with no censorship resistance (calls fail in blocked regions rather than falling back to DSS/NT).
Pages
| Page | Content |
|---|---|
| Enabling & Configuring | The express_ai config block, domain override, programmatic setup |
| Chat Completions | Starting and consuming completions, chat credits, error handling |
Built on ExpressAI
Some SDK features use ExpressAI internally and expose a finished object rather than a token stream — they need the same license and the same AI entitlement, but no chat handling on your side:
| Feature | What it returns |
|---|---|
explain_ranking_with_ai | A plain-language explanation of a speed-test ranking — read against the user's own line when the ranking was scored against one — or, for a single un-tunnelled measurement, of that connection alone |