Skip to main content

Set up Pi to connect to FriendliAI. Once you complete these steps, your agent will send requests to FriendliAI.

To get started, complete the following steps:

1

Install Pi

If you haven't already, install Pi.

2

Get a FriendliAI API Key

If you need a new API key, create one.

3

Set Up Pi

Set Up FriendliLink and connect your agent to FriendliAI with one command.
  1. Open your ~/.pi/agent/models.json file.
  2. Add the following to the file:
    Replace the following placeholders:
    • <FRIENDLIAI_API_KEY>: Your FriendliAI API key.
    • <FRIENDLIAI_MODEL_ID>: The FriendliAI model ID. For example, zai-org/GLM-5.3.
    • <FRIENDLIAI_MODEL_REASONING>: Whether the model is a reasoning model. For example, true for zai-org/GLM-5.3.
  3. Save your file.
To learn more, see Pi Docs > Custom Models.
4

Send a Prompt to Pi

Open your agent and send a prompt. For example, use the following prompt:

Explore your codebase.

To learn more, see Pi Docs > Using Pi.

Help

Find answers to common agent setup questions.
Last modified on September 16, 2026