Skip to content

Pi Configuration ​

Ensure you have Pi installed.

Open the ~/.pi/agent directory, where ~ is your home directory.

Edit models.json (create it if it doesn't exist) and add the following:

json
{
  "providers": {
    "nitrorouter": {
      "baseUrl": "https://api.nitrorouter.com/v1",
      "api": "openai-completions",
      "apiKey": "xxx",
      "models": [
        {
          "id": "gpt-6-astra",
          "name": "GPT-6 Astra",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1050000,
          "maxTokens": 128000
        },
        {
          "id": "claude-opus-5-5",
          "name": "Claude Opus 5.5",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1000000,
          "maxTokens": 128000
        },
        {
          "id": "claude-sonnet-5-5",
          "name": "Claude Sonnet 5.5",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1000000,
          "maxTokens": 128000
        },
        {
          "id": "gemini-3.8-flash",
          "name": "Gemini 3.8 Flash",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1048576,
          "maxTokens": 65536
        }
      ]
    }
  }
}

Replace xxx with the API Key you created in the console.

You can add more models as needed. When adding a model, also set reasoning (thinking support), input (image input support), contextWindow (context length) and maxTokens (max output length). If omitted, Pi assumes the model supports neither thinking nor images, with a 128K context and 16K max output.

After saving, run pi in your terminal, enter /model to select a model under nitrorouter, and try chatting to verify if the configuration is successful.