## Watch the setup video

Poolside with Pi

## Prerequisites

- You have Pi installed. Run `pi --version` to confirm the installation. For other installation options, including `npm` and Windows, see the [Pi Quickstart](https://pi.dev/docs/latest/quickstart).
- You have one of the following:
  - A Poolside Platform API key. To create one, go to [platform.poolside.ai](https://platform.poolside.ai/).
  - An API key for your organization’s Poolside deployment.
  - An OpenRouter API key with access to Poolside models. To create one, go to [OpenRouter API keys](https://openrouter.ai/keys).

## Steps

- Poolside Platform

- Poolside deployment

- OpenRouter

Pi finds custom providers in `~/.pi/agent/models.json`.

1. Make your Poolside Platform API key available as an environment variable. Add it to your shell profile.
   
   ```
   export POOLSIDE_API_KEY="<api-key>"
   ```

2. Create or open `~/.pi/agent/models.json` and add Poolside as a provider.
   To find model IDs for your access method, see [List available models](https://docs.poolside.ai/api/openai-api-examples#list-available-models).

`~/.pi/agent/models.json`
   
   ```
   {
        "providers": {
          "poolside": {
            "baseUrl": "https://inference.poolside.ai/v1",
            "api": "openai-completions",
            "apiKey": "$POOLSIDE_API_KEY",
            "models": [
              {
                "id": "<poolside-model-id>",
                "name": "Poolside model",
                "reasoning": true,
                "contextWindow": 256000,
                "maxTokens": 32768
              }
            ]
          }
        }
   }
   ```

3. In your terminal, run `pi`.
   
   ```
   pi
   ```

4. Run `/model`.
   
   ```
   /model
   ```

5. Select the Poolside model you added.
6. Send a codebase question to confirm Pi responds with the selected Poolside model.

If you run Poolside on your own infrastructure, set the base URL to your deployment’s OpenAI-compatible endpoint instead. Replace `<api-domain>` with your deployment’s host. The path is `/openai/v1`.

Pi finds custom providers in `~/.pi/agent/models.json`.

1. Make the API key for your Poolside deployment available as an environment variable. Add it to your shell profile.
   
   ```
   export POOLSIDE_API_KEY="<api-key>"
   ```

`~/.pi/agent/models.json`
   
   ```
   {
        "providers": {
          "poolside": {
            "baseUrl": "https://poolside.example.com/openai/v1",
            "api": "openai-completions",
            "apiKey": "$POOLSIDE_API_KEY",
            "models": [
              {
                "id": "<poolside-model-id>",
                "name": "Poolside model",
                "reasoning": true,
                "contextWindow": 256000,
                "maxTokens": 32768
              }
            ]
          }
        }
   }
   ```

3. In your terminal, run `pi`.
   
   ```
   pi
   ```

4. Run `/model`.
   
   ```
   /model
   ```

5. Select the Poolside model you added.
6. Send a codebase question to confirm Pi responds with the selected Poolside model.

1. In your terminal, run `pi`.
   
   ```
   pi
   ```

2. Run `/login`.
   
   ```
   /login
   ```

3. Select **OpenRouter** and paste your OpenRouter API key.
4. Run `/model`.
   
   ```
   /model
   ```

5. Search for a Poolside model served through OpenRouter.
   OpenRouter may offer free and paid Poolside models. To see current availability, see [Poolside models on OpenRouter](https://openrouter.ai/poolside).
6. Select the model you want to use. Pi ships with a generated model snapshot, so recently released models may not appear in `/model` on older Pi versions. To add a model yourself, see [Custom Models](https://pi.dev/docs/latest/models) in the Pi documentation.
7. Send a codebase question to confirm Pi responds with the selected Poolside model.
