Welcome to Tinfoil SDKs — Drop-in replacements for OpenAI clients with built-in security verification. Choose your language below and start building with confidential AI in minutes.
Quick Start
1. Install Your Preferred SDK
2. Get Your API Key
Visit the Tinfoil Dashboard to generate your API key. You can also read the guide on generating an API key [TODO: link to how-to-get-api key]Available SDKs
| Language | Package | Installation | Documentation |
|---|---|---|---|
| Python | tinfoil | pip install tinfoil | Python SDK |
| Node.js | tinfoil | npm install tinfoil | Node.js SDK |
| Swift | TinfoilAI | Swift Package Manager | Swift SDK |
| Go | tinfoil-go | go get github.com/tinfoilsh/tinfoil-go | Go SDK |
| CLI | tinfoil-cli | Various install methods | CLI Tool |
Don’t see an SDK for your language? Contact us at [email protected] and we’ll prioritize adding support for your preferred programming language.
What Are Tinfoil SDKs?
Tinfoil provides SDKs that make it easy to integrate confidential AI inference into your applications. Each SDK is designed to be a drop-in replacement for OpenAI clients while adding verifiable security guarantees.Key Benefits
Tinfoil SDKs provide automatic security verification - every request verifies you’re connecting to a genuine Tinfoil secure enclave and ensures your connection is end-to-end encrypted. They also offer drop-in compatibility with the same OpenAI API format, requiring only a different client setup.TL;DR: Tinfoil clients provide the strongest security guarantees through certificate pinning and in-band verification. For security, it is best to always use our SDKs unless you know what you’re doing.
How It Works
Getting started with Tinfoil is straightforward: install any Tinfoil SDK using your language’s package manager, then update your client setup to use Tinfoil (the API remains the same afterward). Currently using an OpenAI SDK? You can use the same API syntax, and you’ll get automatic security as attestation verification happens transparently behind the scenes.Direct API Access (Not Recommended)
Security Note: Direct API access requires manual attestation verification to ensure security. Without verification, you have no cryptographic proof that your data is processed in a secure enclave. However, we still maintain auditability through attestation transparency.
- Our SDKs perform automatic security verification that prevents man-in-the-middle attacks. When you access our API directly (without our SDKs), there is no guarantee of privacy.
- Our SDKs automatically choose the best secure router / enclave and perform load balancing. Performance can degrade if you do direct API access to our inference endpoints.
The security checks performed by our SDKs
When you use a Tinfoil client, here’s what happens behind the scenes:1. Initial Attestation Verification
The client performs cryptographic verification that the AI inference server is running in a genuine secure enclave, that the enclave is running the expected code published on GitHub and Sigstore, and that the TLS certificate for every request corresponds to this verified enclave.2. Certificate Pinning Protection
Once verified, the client “pins” the TLS certificate, which prevents certificate swapping so Tinfoil cannot issue a new certificate and redirect your traffic. This maintains connection integrity by ensuring all subsequent requests use the same verified connection and provides real-time security where every request benefits from the initial attestation verification. What Could Go Wrong Without Pinning With direct API access, a malicious actor (even Tinfoil itself) could theoretically issue a new TLS certificate, route your traffic to a different (non-enclave) inference server, and process your data without confidentiality guarantees.Auditability Through Certificate Transparency - Even without certificate pinning, you can still detect if Tinfoil has issued a new certificate for an endpoint by monitoring Certificate Transparency (CT) logs. All TLS certificates must be logged in public CT logs, making it possible to audit certificate issuance and detect potential certificate rotation that might indicate an attack. All production Tinfoil enclaves publish their attestation to CT for auditability. Learn more about audit-time verification in our verification comparison guide.

