View on GitHub
tinfoilsh/tinfoil-go
Overview
The Tinfoil Go SDK is a wrapper around the OpenAI Go client that provides secure communication with Tinfoil enclaves. It has the same API as the OpenAI SDK with additional security features including automatic verification that the endpoint is running in a secure Tinfoil enclave and encryption of request bodies to the verified enclave with EHBP.V3 attestation verification in the Go SDK, including the installation below, is beta while deployment is ongoing.
Installation
Migration from OpenAI
Migrating from OpenAI to Tinfoil is straightforward. The client is designed to be compatible with the OpenAI Go client:tinfoil.NewClient() returns a standard OpenAI client with built-in security features.
Usage
Model Examples
Below are specific examples for each supported model. Click on any model to see its configuration and usage example.Chat Models
GLM-5.3
GLM-5.3
Gemma 4 31B
Gemma 4 31B
Llama 3.3 70B
Llama 3.3 70B
GPT-OSS 120B
GPT-OSS 120B
Audio Models
Embedding Models
Nomic Embed Text
Nomic Embed Text
Advanced Functionality
For advanced use cases requiring manual verification or direct HTTP access, pin an enclave withNewClientWithOptions and use the client’s verification and HTTP methods:
HTTPClient() only sends requests to the verified enclave and encrypts request bodies to it. To pin the enclave’s TLS certificate instead, add tinfoil.WithTransport(tinfoil.TransportTLS).