@billjr99/pi-openai-compat 1.1.26 → 1.1.28
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 +1 -0
- package/index.ts +10 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ If pi is already running when you install, type `/reload` first.
|
|
|
65
65
|
| **xKiro** | `https://api.xkiro.com/v1` | `sk-xt-...` key from the xKiro console at xkiro.com (docs.xkiro.com) |
|
|
66
66
|
| **TeamoRouter** | `https://api.teamorouter.com/v1` | `sk-teamo-...` key from teamorouter.com (teamorouter.com/docs) |
|
|
67
67
|
| **GMI Cloud** | `https://api.gmi-serving.com/v1` | API key from console.gmicloud.ai → Organization Settings → API Keys |
|
|
68
|
+
| **Token Harbor** | `https://tokenharbor.ai/v1` | `thk_live_...` Universal Key from tokenharbor.ai/dashboard/api-keys |
|
|
68
69
|
| **Ollama (local)** | `http://localhost:11434/v1` | Keyless |
|
|
69
70
|
| **Ollama Cloud** | `https://ollama.com/v1` | Ollama Cloud API key from ollama.com |
|
|
70
71
|
| **llmproxy** | `http://localhost:8080/v1` (editable) | Keyless by default; bearer token if your instance requires one |
|
package/index.ts
CHANGED
|
@@ -358,6 +358,13 @@ const TEMPLATES: Record<string, {
|
|
|
358
358
|
// control plane (containers, clusters, sandboxes) and has no /chat/completions.
|
|
359
359
|
keyHint: "console.gmicloud.ai → Organization Settings → API Keys (docs at docs.gmicloud.ai/inference-engine)",
|
|
360
360
|
},
|
|
361
|
+
tokenharbor: {
|
|
362
|
+
displayName: "Token Harbor",
|
|
363
|
+
baseUrl: "https://tokenharbor.ai/v1",
|
|
364
|
+
keyless: false,
|
|
365
|
+
// One "Universal Key" reaches every model; free models carry a ":free" id suffix.
|
|
366
|
+
keyHint: "tokenharbor.ai/dashboard/api-keys (Universal Key, format thk_live_...; docs at tokenharbor.ai/docs)",
|
|
367
|
+
},
|
|
361
368
|
custom: {
|
|
362
369
|
displayName: "Custom Endpoint",
|
|
363
370
|
baseUrl: "",
|
|
@@ -646,7 +653,7 @@ function registerProvider(pi: ExtensionAPI, key: string, p: ProviderConfig): voi
|
|
|
646
653
|
pi.registerProvider(compatKey(key), {
|
|
647
654
|
name: `compat/${key.replace(/_/g, "-")}`,
|
|
648
655
|
baseUrl: p.baseUrl,
|
|
649
|
-
apiKey: p.apiKey
|
|
656
|
+
apiKey: p.apiKey,
|
|
650
657
|
api: "openai-completions" as const,
|
|
651
658
|
models: buildProviderModels(p.cachedModels),
|
|
652
659
|
});
|
|
@@ -821,9 +828,9 @@ export default async function (pi: ExtensionAPI) {
|
|
|
821
828
|
if (!baseUrl) { ctx.ui.notify("Base URL cannot be empty.", "error"); return; }
|
|
822
829
|
}
|
|
823
830
|
|
|
824
|
-
// Step 3 — API key (skipped for keyless templates
|
|
831
|
+
// Step 3 — API key (skipped for keyless templates)
|
|
825
832
|
let apiKey: string | null = null;
|
|
826
|
-
if (!tpl.keyless
|
|
833
|
+
if (!tpl.keyless) {
|
|
827
834
|
const keyPrompt = tpl.keyHint
|
|
828
835
|
? `API Key: required — get it at ${tpl.keyHint}`
|
|
829
836
|
: "API Key: leave blank if keyless";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@billjr99/pi-openai-compat",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.28",
|
|
4
4
|
"description": "pi-coding-agent extension: OpenAI-compatible endpoint support (OpenRouter, NVIDIA NIM, Nous Portal, Ollama, custom)",
|
|
5
5
|
"author": "Bill Mongan <https://github.com/BillJr99>",
|
|
6
6
|
"license": "MIT",
|