Connect Oh My Pi to ModelGo: Setup & Troubleshooting

Oh My Pi (omp) is a terminal coding agent. Declare an OpenAI-compatible provider in models.yml to use ModelGo. You need an API key from the ModelGo Console and a logical model ID from the Model Catalog.

1. Install

bash
bun install -g @oh-my-pi/pi-coding-agent
omp --version

2. Add a ModelGo provider

Edit ~/.omp/agent/models.yml:

yaml
providers:
  modelgo:
    baseUrl: https://api.modelgo.ai/v1
    api: openai-completions
    apiKey: MODELGO_API_KEY
    models:
      - id: your-model-id
        name: ModelGo / your-model-id
        contextWindow: 128000
        maxTokens: 8192

apiKey is the environment variable name, not the key itself:

bash
export MODELGO_API_KEY="mgk_your_api_key"

If the variable is unset or empty, Oh My Pi does not fail; it sends the literal string MODELGO_API_KEY as the key and the request returns 401. Make sure the variable is set in the current terminal before starting omp.

3. Verify

bash
curl https://api.modelgo.ai/v1/models \
  -H "Authorization: Bearer $MODELGO_API_KEY"
omp models modelgo
omp --model modelgo/your-model-id

Troubleshooting

  • ModelGo is missing from the model list: check the path ~/.omp/agent/models.yml and the YAML indentation, then restart omp.
  • 401: confirm MODELGO_API_KEY is exported in the current terminal.
  • 404: remove a duplicate /v1 or a full endpoint path from baseUrl.

Related docs