Integrations

Use uncensored models in the pi coding agent

A provider block in ~/.pi/agent/models.json with the openai-completions API. Set the token limits; pi's defaults are small.

pi is a terminal coding agent. It reads custom providers from ~/.pi/agent/models.json (the directory can be moved with PI_CODING_AGENT_DIR).

models.json

json
{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "chainless": {
      "name": "Chainless",
      "baseUrl": "https://chainless.one/v1",
      "api": "openai-completions",
      "apiKey": "$CHAINLESS_API_KEY",
      "models": [
        { "id": "kimi-k3.1-pro-uncensored", "name": "Kimi K3.1 Pro Uncensored", "reasoning": true, "input": ["text", "image"], "contextWindow": 1048576, "maxTokens": 131072 },
        { "id": "glm-5.3-fast-uncensored", "name": "GLM 5.3 Fast Uncensored", "reasoning": true, "input": ["text", "image"], "contextWindow": 1048576, "maxTokens": 131072 }
      ]
    }
  }
}
shell
export CHAINLESS_API_KEY="cl-..."
pi --model chainless/kimi-k3.1-pro-uncensored

/model inside pi reloads the file. The guides page generates this file with every public model and its limits, from the live model list.

Notes

  • apiKey accepts a literal key, $NAME / ${NAME}, or !command.
  • Defaults without limits are a 128000 context and 16384 max tokens; set both.
  • "reasoning": true fits every current Chainless model. GLM 5.3 Uncensored is text-only: use "input": ["text"] for it.
  • Leave the compat options unset unless you hit a verified difference.
  • For authorized security engagements, put the agent brief from /guides in your project's AGENTS.md.

Sources

Checked against the official documentation on 2026-11-29. Tools change their settings often; if a field moved, the source below is the reference.

Other tools

Questions

Which api value should I use?

openai-completions. Chainless serves the Chat Completions API; the openai-responses value would call an endpoint that does not exist.

Why does pi stop answers early or compact too soon?

Without contextWindow and maxTokens pi assumes 128000 and 16384. Set them to 1048576 and 131072 for the current Chainless models.

How do I keep the key out of models.json?

Use "apiKey": "$CHAINLESS_API_KEY" and export the variable in your shell profile. pi also accepts a literal key or a !command that prints it.