@monotykamary/pi-opencode-provider 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@ _GPT, Claude, Gemini, GLM, MiniMax, Kimi, DeepSeek — unified API for [pi](http
15
15
 
16
16
  ## Features
17
17
 
18
- - **50+ AI Models** including GPT-5.x Codex, Claude Opus/Sonnet/Haiku, Gemini 3.x, GLM, MiniMax, Kimi K2.5, and more
18
+ - **52+ AI Models** including GPT-5.x Codex, Claude Opus/Sonnet/Haiku, Gemini 3.x, GLM, MiniMax, Kimi K2.5, and more
19
19
  - **Multi-API Support** — uses the correct API protocol per model (Anthropic, OpenAI Responses, OpenAI Completions, Gemini)
20
20
  - **Cost Tracking** with per-model pricing for budget management
21
21
  - **Reasoning Models** with thinking level maps for proper effort control
@@ -112,7 +112,9 @@ pi
112
112
  | GPT-5.4 Pro | Responses | Text + Image | 1.1M | 128K | $30.00 | $180.00 |
113
113
  | GPT-5.5 | Responses | Text + Image | 1.1M | 128K | $5.00 | $30.00 |
114
114
  | GPT-5.5 Pro | Responses | Text + Image | 1.1M | 128K | $30.00 | $180.00 |
115
+ | Grok 4.5 | Completions | Text + Image | 500K | 500K | $2.00 | $6.00 |
115
116
  | Grok Build 0.1 | Completions | Text + Image | 256K | 256K | $1.00 | $2.00 |
117
+ | Hy3 Free | Completions | Text | 256K | 64K | Free | Free |
116
118
  | Kimi K2.5 | Completions | Text + Image | 262K | 66K | $0.60 | $3.00 |
117
119
  | Kimi K2.6 | Completions | Text + Image | 262K | 66K | $0.95 | $4.00 |
118
120
  | Kimi K2.7 Code | Completions | Text + Image | 262K | 262K | $0.95 | $4.00 |
@@ -136,17 +138,19 @@ After loading the extension, use the `/model` command in pi to select your prefe
136
138
 
137
139
  Then select "opencode" as the provider and choose from the available models.
138
140
 
141
+ The default model for this provider is `kimi-k2.6` (matching pi core's built-in default); use `/model` to pick another.
142
+
139
143
  ## Authentication
140
144
 
141
- The opencode API key can be configured in multiple ways (resolved in this order):
145
+ The opencode API key can be configured in multiple ways. Credentials are resolved in this order:
142
146
 
143
- 1. **`auth.json`** (recommended)Add to `~/.pi/agent/auth.json`:
147
+ 1. **CLI flag**`--api-key` (highest priority, runtime override)
148
+ 2. **`auth.json`** (recommended) — Add to `~/.pi/agent/auth.json`:
144
149
  ```json
145
150
  { "opencode": { "type": "api_key", "key": "your-api-key" } }
146
151
  ```
147
- The `key` field supports literal values, env var names, and shell commands (prefix with `!`). See [pi's auth file docs](https://github.com/badlogic/pi-mono) for details.
148
- 2. **Runtime override** — Use the `--api-key` CLI flag
149
- 3. **Environment variable** — Set `OPENCODE_API_KEY`
152
+ The `key` field supports literals, `$ENV_VAR`/`${ENV_VAR}` interpolation, and `!command` execution. See [pi's providers docs](https://github.com/earendil-works/pi-coding-agent/blob/main/docs/providers.md) for details.
153
+ 3. **Environment variable** — `OPENCODE_API_KEY`
150
154
 
151
155
  ## Environment Variables
152
156
 
package/index.ts CHANGED
@@ -302,6 +302,7 @@ export default function (pi: ExtensionAPI) {
302
302
  const staleModels = buildModels(staleBase, customModels, patches);
303
303
 
304
304
  pi.registerProvider("opencode", {
305
+ name: "OpenCode Zen",
305
306
  baseUrl: BASE_URL,
306
307
  apiKey: "$OPENCODE_API_KEY",
307
308
  api: "openai-completions",
@@ -328,6 +329,7 @@ export default function (pi: ExtensionAPI) {
328
329
  revalidateModels(cachedApiKey, embeddedModels, signal).then((freshBase) => {
329
330
  if (freshBase && !signal.aborted) {
330
331
  pi.registerProvider("opencode", {
332
+ name: "OpenCode Zen",
331
333
  baseUrl: BASE_URL,
332
334
  apiKey: "$OPENCODE_API_KEY",
333
335
  api: "openai-completions",
package/models.json CHANGED
@@ -503,6 +503,25 @@
503
503
  "contextWindow": 204800,
504
504
  "maxTokens": 131072
505
505
  },
506
+ {
507
+ "id": "grok-4.5",
508
+ "name": "Grok 4.5",
509
+ "api": "openai-completions",
510
+ "baseUrl": "https://opencode.ai/zen/v1",
511
+ "reasoning": true,
512
+ "input": [
513
+ "text",
514
+ "image"
515
+ ],
516
+ "cost": {
517
+ "input": 2,
518
+ "output": 6,
519
+ "cacheRead": 0.5,
520
+ "cacheWrite": 0
521
+ },
522
+ "contextWindow": 500000,
523
+ "maxTokens": 500000
524
+ },
506
525
  {
507
526
  "id": "north-mini-code-free",
508
527
  "name": "North Mini Code Free",
@@ -597,6 +616,24 @@
597
616
  "contextWindow": 1000000,
598
617
  "maxTokens": 128000
599
618
  },
619
+ {
620
+ "id": "hy3-free",
621
+ "name": "Hy3 Free",
622
+ "api": "openai-completions",
623
+ "baseUrl": "https://opencode.ai/zen/v1",
624
+ "reasoning": true,
625
+ "input": [
626
+ "text"
627
+ ],
628
+ "cost": {
629
+ "input": 0,
630
+ "output": 0,
631
+ "cacheRead": 0,
632
+ "cacheWrite": 0
633
+ },
634
+ "contextWindow": 256000,
635
+ "maxTokens": 64000
636
+ },
600
637
  {
601
638
  "id": "claude-haiku-4-5",
602
639
  "name": "Claude Haiku 4.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-opencode-provider",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Opencode provider extension for pi - Access GPT, Claude, Gemini, GLM, MiniMax, Kimi and more through the opencode.ai API",
5
5
  "type": "module",
6
6
  "main": "index.ts",
package/patch.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "forceAdaptiveThinking": true
5
5
  },
6
6
  "thinkingLevelMap": {
7
- "xhigh": "max"
7
+ "max": "max"
8
8
  }
9
9
  },
10
10
  "claude-opus-4-7": {
@@ -33,7 +33,7 @@
33
33
  "low": null,
34
34
  "medium": null,
35
35
  "high": "high",
36
- "xhigh": "max"
36
+ "max": "max"
37
37
  }
38
38
  },
39
39
  "gemini-3-flash": {