TL;DR — How to wire Cline to Tinfoil in 3 steps:
  1. Install the Cline VS Code extension.
  2. Set the Base URL to https://inference.tinfoil.sh/v1/ (recommended) or your chosen model’s enclave endpoint.
  3. Paste your TINFOIL_API_KEY and pick the model ID.
That’s it—Cline will now route all completions through a confidential computing enclave instead of a public endpoint.
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:
  1. Create a Python program for the Tinfoil Inference API.
  2. 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:
  1. Open VS Code.
  2. Click on the Extensions icon in the sidebar and search for ‘Cline’.
  3. Click Install next to the Cline extension.
  4. Reload VS Code when prompted.

Configure Cline to use the Tinfoil API

Next, configure Cline to use the Tinfoil Inference API:
  1. In the Activity Bar, click the Cline icon.
  2. Click the Settings (⚙) button.
  3. For API Provider, choose OpenAI Compatible.
Configure the following settings:
  • 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.
  1. 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
  1. 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):
    In one file, create a Python program based on the following command. The program should prompt for the values of <ENCLAVE-URL>, <API-KEY> and <MODEL>.
    
    curl -sS <ENCLAVE-URL>/v1/chat/completions \
    -H "Authorization: Bearer <API-KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "<MODEL>",
      "messages": [{"role": "user", "content": "Hello, world!"}],
      "temperature": 0
    }'
    
    In another file, create a README that explains how to use the program.
    
    Replace <ENCLAVE-URL> with https://inference.tinfoil.sh (recommended) or your chosen model’s specific URL, <API-KEY> with your Tinfoil API key, and <MODEL> with the model ID.
  2. 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.
  3. Cline outputs a message confirming that your task has been completed. The process should look something like this:
Cline usage