Get started with Pi and Berget AI

Install Pi and the Berget AI extension, connect it to Berget AI, and run your first AI-assisted coding session on European infrastructure

In this tutorial, you'll install Pi, add the Berget AI extension, and run your first prompt from the terminal. By the end, you'll have a working AI coding assistant running on Berget AI's European infrastructure.

Before you start

To complete this tutorial, you'll need:

Set up Pi

Install Pi

Install the Pi coding agent:

curl -fsSL https://pi.dev/install.sh | sh

Verify the installation by running:

pi --version

Create a Berget AI API key

  1. Go to API Keys in the Berget AI Console.
  2. Click + Create New Key.
  3. Enter a name in the Key Name field (e.g. Pi).
  4. Click + Create Key.
  5. Store it somewhere safe — it won't be shown again.
berget api-keys create --name "Pi"

The key is printed once in full (sk_ber_... format). Store it somewhere safe — it won't be shown again.

Install the Berget AI extension

pi install npm:@bergetai/pi-provider

Restart Pi or run /reload to load the extension. The extension registers Berget AI as a provider and loads the available models automatically.

Configure your API key

Choose one of the following methods to provide your API key.

Using environment variable:

export BERGET_API_KEY=sk_ber_...

Using ~/.pi/agent/auth.json:

Create or edit ~/.pi/agent/auth.json and add a berget entry:

{
  "berget": { "type": "api_key", "key": "sk_ber_..." }
}

Run Pi

In your project directory, start Pi:

pi

Select a model with /model, or cycle through available models with Ctrl+P. Models from Berget AI are prefixed with berget/.

List all available models from the command line:

pi --list-models

What you built

You now have Pi running as an AI coding assistant in your terminal, backed by Berget AI. Every prompt you send, your code, your questions, the responses, stays within the EU and is processed on Berget AI's European infrastructure.

For more information on how to use Pi, see the Pi docs.

Next steps

On this page