Go SDK
Go SDK for Tinfoil’s secure AI inference API
GitHub: 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
New to Go? Start here - Project Setup
New to Go? Start here - Project Setup
If you don’t have a Go module set up yet, initialize a new one:
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
DeepSeek R1
DeepSeek R1
Qwen3-VL 30B
Qwen3-VL 30B
Llama 3.3 70B
Llama 3.3 70B
GPT-OSS 120B
GPT-OSS 120B
Kimi K2.5
Kimi K2.5
Audio Models
Embedding Models
Nomic Embed Text
Nomic Embed Text
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.Guides
Tool Calling
Learn how to use function calling capabilities with AI models.
Structured Outputs
Use JSON schema validation for reliable data extraction.
Image Processing
Process images with multimodal AI models.
Document Processing
Upload and process documents securely.

