Skip to main content

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, TLS certificate pinning, and attestation validation.

Installation

Migration from OpenAI

Migrating from OpenAI to Tinfoil is straightforward. The client is designed to be compatible with the OpenAI Go client:
All method signatures remain the same since 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

Audio Models

Transcription

Audio Q&A

Embedding Models

Advanced Functionality

For advanced use cases requiring manual verification or direct HTTP access, use the SecureClient from the verifier package:

API Documentation

This library is a drop-in replacement for the official OpenAI Go client that can be used with Tinfoil. All methods and types are identical. See the OpenAI Go client documentation for complete API usage and documentation.