Done.
Created:
C:\Users\Daniel.Esuga\.pi\agent\models.jsonwith provider isw-gateway and model gpt-5-codex.
Next, set your key env var (PowerShell):
Persist it for future terminals:
Then restart pi (or pi-ui server) and run /model, select:
isw-gatewayGPT-5 Codex (ISW Gateway)If you want to change the active model, tell me which one to use (or I can list common options and recommend one by task).
If you meant the /model slash command behavior in pi, say that and I’ll check the exact implementation/docs in this repo.
Perfect — you can do this without code changes using ~/.pi/agent/models.json.
Also: since you pasted a live key here, rotate it after setup.
Use any variable name, e.g.:
~/.pi/agent/models.jsonUse the exact model IDs your gateway exposes (from its /v1/models).
/model → provider isw-gatewayIf your gateway is not fully OpenAI-compatible, add compat flags per model (e.g. maxTokensField, supportsUsageInStreaming).
If you want, I can generate a ready-to-paste models.json from the exact model IDs you have.
$env:ISW_AI_GATEWAY_KEY=[REDACTED]setx ISW_AI_GATEWAY_KEY "sk-..."export ISW_AI_GATEWAY_KEY=[REDACTED]{ "providers": { "isw-gateway": { "baseUrl": "https://ai-gateway.isw.la/v1", "api": "openai-completions", "apiKey": "ISW_AI_GATEWAY_KEY", "models": [ { "id": "openai/gpt-4o-mini", "name": "GPT-4o Mini (ISW Gateway)", "reasoning": false, "input": ["text", "image"], "contextWindow": 128000, "maxTokens": 16384, "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } } ] } }}