feat(ai): add xAI device OAuth and route grok-4.5 through Responses (#6651)

* feat(ai): add xAI device OAuth and route grok-4.5 through Responses

Add xAI device-code OAuth alongside XAI_API_KEY. Route only grok-4.5
through Responses with low/medium/high reasoning; other xAI models stay
on Completions.

* fix(ai): tolerate xAI device-code interval 0 and correct token poll error label

---------

Co-authored-by: Jaaneek <Jaaneek@users.noreply.github.com>
This commit is contained in:
Milosz Jankiewicz
2026-07-16 08:58:24 +01:00
committed by GitHub
parent 36db3fa385
commit 5220aba619
10 changed files with 667 additions and 8 deletions
+6
View File
@@ -18,6 +18,7 @@ Use `/login` in interactive mode, then select a provider:
- ChatGPT Plus/Pro (Codex)
- Claude Pro/Max
- GitHub Copilot
- xAI (Grok/X subscription)
- Radius
Use `/logout` to clear credentials. Tokens are stored in `~/.pi/agent/auth.json` and auto-refresh when expired.
@@ -36,6 +37,11 @@ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party h
- Press Enter for github.com, or enter your GitHub Enterprise Server domain
- If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
### xAI (Grok/X subscription)
- Run `/login xai`, then select **Use a subscription**
- `XAI_API_KEY` remains available through **Use an API key**
### Radius
Radius is a dynamic `pi-messages` gateway. `/login radius` stores OAuth tokens in `auth.json`; the gateway catalog is refreshed independently and cached in `models-store.json`. Custom Radius gateways can be declared in `models.json` with `"oauth": "radius"` and a gateway `baseUrl`.