Skip to main content

View on GitHub

tinfoilsh/tinfoil-python

Overview

The Tinfoil Python SDK is a wrapper around the OpenAI Python 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:
All method signatures and response formats remain the same.

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

Async Usage

Simply import AsyncTinfoilAI instead of TinfoilAI and use await with each API call:
Functionality between the synchronous and asynchronous clients is otherwise identical.

API Documentation

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