TL;DR — How to wire Cline to Tinfoil in 3 steps:
- Install the Cline VS Code extension.
- Set the Base URL to
https://inference.tinfoil.sh/v1/
(recommended) or your chosen model’s enclave endpoint. - Paste your
TINFOIL_API_KEY
and pick the model ID.
Verification Note: When using Cline or other OpenAI-compatible clients, connection-time attestation verification is not performed automatically. However, all Tinfoil enclaves support audit-time verification through attestation transparency, creating an immutable audit trail. For applications requiring connection-time verification, use our official SDK clients. Learn more about the verification approaches.
Introduction
The Tinfoil Private Inference API can be used with the Cline AI assistant and VS Code to obtain a fully-private coding assistant. Cline can be used for code completions, explanations, creating and editing files, running commands in the terminal, and more. Tinfoil makes all the AI inference requests private, so your code and files are never exposed to third parties. In this tutorial, you’ll first install Cline and configure Cline to use the Tinfoil API. Then, you’ll instruct Cline to perform two tasks using the private API:- Create a Python program for the Tinfoil Inference API.
- Create a README with instructions for using the program.
Prerequisites
For this tutorial, you’ll need:- Tinfoil API Key: Get an API key at tinfoil.sh
- VS Code: To install and use the Cline extension
You’re billed for all usage of the Tinfoil Inference API. See the Tinfoil
Inference for current pricing information.
Security Warning Never share your API key, be careful to not include it in
version control systems, and never bundle it in with front-end client code.
Install Cline in VS Code
First, install Cline in VS Code:- Open VS Code.
- Click on the Extensions icon in the sidebar and search for ‘Cline’.
- Click Install next to the Cline extension.
- Reload VS Code when prompted.
Configure Cline to use the Tinfoil API
Next, configure Cline to use the Tinfoil Inference API:- In the Activity Bar, click the Cline icon.
- Click the Settings (⚙) button.
- For API Provider, choose OpenAI Compatible.
- Base URL: Use
https://inference.tinfoil.sh/v1/
(recommended) or the specific enclave endpoint for your chosen model - API Key: Your Tinfoil API key
- Model ID: The model identifier (e.g.,
qwen2-5-72b
,llama3-3-70b
, etc.)
See our model catalog for the complete list of available models,
their enclave endpoints, and model IDs.
- Click Done.
Instruct Cline to perform tasks
Finally, instruct Cline to create a:- Python program for the Tinfoil Inference API
- README that explains how to use the program
-
In the “Type your task here” field, enter the following prompt (replace the placeholder values with your actual enclave URL, API key, and model ID):
Replace
<ENCLAVE-URL>
withhttps://inference.tinfoil.sh
(recommended) or your chosen model’s specific URL,<API-KEY>
with your Tinfoil API key, and<MODEL>
with the model ID. - Press Enter to run the task. Cline explains the specific steps it will take to complete the task, and then begins creating the requested Python program and the README.
- Cline outputs a message confirming that your task has been completed. The process should look something like this:
