Available SDKs
| Language | Package | Installation | Documentation |
|---|---|---|---|
| Python | tinfoil | pip install tinfoil | Python SDK |
| JavaScript | tinfoil | npm install tinfoil | JavaScript 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 |
If you’d like to see an SDK for a different language or runtime, please reach out at [email protected] and we’ll prioritize adding support for it.
Why you should use the SDKs
The SDKs make it easy to integrate Tinfoil into your applications without having to worry about encryption, attestation verification, or other security pitfalls. All the privacy and integrity features offered by Tinfoil are automatically verified for you and all connections are blocked in case of verification failure. Each SDK is designed to be a drop-in replacement for OpenAI clients. This means you can continue to use the chat completions or responses API formats with Tinfoil models. However, not all backend features are supported or enabled for all models. If you experience issues, please don’t hesitate to contact us.Quick start
Step 1: Install the client SDK
Start by installing one of the Tinfoil SDKs:Step 2: Get a Tinfoil API key
Go to the Tinfoil Dashboard to generate an API key. You can also read our documentation on generating an API key.Step 3: Make an inference request
If you are currently using the OpenAI SDK in your codebase, all you need is to swap out the package import and model name.
Our SDKs preserve the same code syntax and parameters.
Direct API Access (Not Recommended)
You can access the Tinfoil inference endpoint directly via HTTPS. However, this approach is not recommended in production for two reasons:- 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.

