orientxorientx

Pi

Earendil's coding agent on the Messages API

Pi is a terminal coding agent. For tool calling it should use Anthropic Messages (api: "anthropic-messages"), not Chat Completions — otherwise tool results come back as role: "tool" and the API returns 400.

Base URLhttps://api.orientx.ai
AuthORIENTX_API_KEY plus authHeader: true
Config~/.pi/agent/models.json
Official docsCustom models

Install

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

Needs Node.js ≥ 22.19. Confirm with pi --version.

Add a provider

{
  "providers": {
    "orientx": {
      "name": "orientx",
      "baseUrl": "https://api.orientx.ai",
      "apiKey": "$ORIENTX_API_KEY",
      "authHeader": true,
      "api": "anthropic-messages",
      "models": [
        {
          "id": "<MODEL_ID>",
          "contextWindow": 200000,
          "maxTokens": 8192
        }
      ]
    }
  }
}

baseUrl is the host root — Pi appends /v1/messages. Adding /v1 yourself produces POST /v1/v1/messages and a 404. authHeader: true sends Authorization: Bearer; without it Pi only sets x-api-key and some setups 401.

Export the key if you used "$ORIENTX_API_KEY":

export ORIENTX_API_KEY="sk-..."

Run Pi

pi

Type /model and select the orientx id.

Do not set api to openai-completions for agent work. Chat Completions will reject Pi's tool turns with Unexpected role "tool".

On this page