CDDT.nz

a small
personal blog

Using Z.ai's Coding Plan with the Pi Harness


A quick how-to guide.


You want to use the coding plan from Z.ai with the pi agent harness. The default option given by pi uses the default Z.ai API, but the Z.ai documentation mentions that you need to change the URL used by your coding harness to 'https://api.z.ai/api/coding/paas/v4'.


Edit your models.json file (if you are just setting pi up for the first time, you will not yet have a models.json file in the ~/.pi/agent/ directory, so go ahead and create it).


Add the following JSON:

              
    {
        "providers": {
            "zai": {
                "baseUrl": "https://api.z.ai/api/coding/paas/v4"
                }
            }
        }
            
            

This will override the URL for the Z.ai provider, and hence for all model calls.