SDKs
The AnonRouter SDKs for verifying confidential routes, running E2EE inference, and generating images and speech across the two-origin privacy split. Install JavaScript packages from npm and Python packages from PyPI, with checksummed release artifacts available separately.
AnonRouter is OpenAI-compatible, so you can reach most of it with any HTTP client or OpenAI SDK. These packages are for the parts a stock client cannot do:
- check the provider evidence yourself, rather than taking our word for a confidentiality claim;
- encrypt requests in your own process, so AnonRouter only ever holds ciphertext; and
- run the two-origin ticket exchange for images and speech, which needs two hosts and two different credentials in one logical call.
Install from npm or PyPI
JavaScript packages are available on npm. Python packages are available on
PyPI: anonrouter-sdk==0.1.0 and anonrouter-confidential==0.1.3.post1.
Start with the Python SDK guide for installation and a
credential-free verification example. Source and checksummed artifacts are
available in the SDK repository.
Packages
| Package | Language | What it is |
|---|---|---|
@anonrouter/confidential | JavaScript / TypeScript | Verify both hops, run E2EE inference, and generate images and speech. Installs the anonrouter-verify command. |
anonrouter-confidential | Python | The twin of the above: same verification, same E2EE, same media surface, same shared test vectors. |
anonrouter-sdk | Python | Installs the confidential SDK with connection binding and exposes its main functions through import anonrouter. |
@anonrouter/client | JavaScript / TypeScript | A thin, dependency-free client for the public chat and models API over the ticketed flow. |
@anonrouter/ai-sdk-provider | JavaScript / TypeScript | Vercel AI SDK provider for chat, streaming, tool calls, and embeddings over the private ticket flow. |
Install
npm install @anonrouter/confidential@0.1.3
# Or the lightweight ticketed chat client:
npm install @anonrouter/client@0.1.3For Python:
python -m pip install "anonrouter-sdk==0.1.0"
# Or use the confidential package directly:
python -m pip install "anonrouter-confidential[connection-binding]==0.1.3.post1"from anonrouter import verify_content_node
result = verify_content_node()
print(result["verdict"].verification_level)This diagnostic needs no API key and sends no inference. It reports unverified
without the separate native verifier; a successful fetch alone is not hardware
verification. See the Python guide for strict client configuration.
The extra installs the reviewed HTTPX/HTTPCore versions for retained-socket binding. The native DCAP verifier is a separate installation; see verification setup.
Upgrade older confidential clients to 0.1.3 to verify the Intel TDX content
nodes behind api.anonrouter.ai. Earlier versions pin the previous deployment
and fail closed against it. Production verification requires native DCAP and
a retained TLS connection; see configuration.
Verification and E2EE
Verify both hops with one verdict you can gate on, and run end-to-end-encrypted inference.
Images and speech
client.images.generate and client.audio.speech.create over the two-origin ticket exchange.
anonrouter-verify
The command both packages install. Exits nonzero unless the assurance you asked for was established, so it can gate a deploy.
Why an installed SDK is a stronger trust boundary
For browser-encrypted chat, AnonRouter serves the JavaScript that does the encryption. That is convenient, but it means trusting code we deliver at request time. A package you install yourself, pin to a version, and audit is a stronger boundary: AnonRouter cannot swap it per request. If you are building a desktop app, a backend service, or anything where verification must not depend on us, use the SDK rather than the browser flow.
What the confidential SDKs verify
- They re-verify raw evidence themselves. The gateway's own verdict is returned for comparison and is never trusted in its place.
- They report an honest ceiling, per hop. AnonRouter's own confidential plane
(hop 1) can reach
hardware_verified, but only with a real DCAP engine that actually chained the quote to Intel's roots. The provider hop (hop 2) caps atpolicy_matchedorcryptographically_checked: several provider routes run GPU enclaves whose NVIDIA attestation chain is not available to verify, and chaining only the CPU quote would claim more than was checked. - They keep the TEE / E2EE distinction explicit. All content goes to the
confidential origin, where the relay runs in an attested TDX CVM and terminates
TLS in-enclave, so plaintext never reaches ordinary AnonRouter infrastructure.
What differs is the trust set: a TEE route has our attested relay handle
your plaintext inside the enclave, so you trust the reviewed build (and a
changed build fails your hop-1 check); an E2EE route encrypts to the
provider's key, so the relay holds ciphertext regardless of what it runs.
verifyRoute()reports which you got ascontentVisibleToAnonRouter. - They fail closed. Missing collateral, a debug-mode enclave, an unpinned measurement, a nonce mismatch, or a route that attested something other than what you asked for all produce a failing verdict, never a silent pass.