@pinecall/skills 0.1.9 → 0.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinecall/skills",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Agent Skills for the Pinecall SDK — installable into Claude Code, Antigravity, Cursor, Copilot and any agent that supports the open Skills format.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -67,6 +67,34 @@ curl https://playground.pinecall.io/api/rates/models
67
67
 
68
68
  `managed: true` → usable with no key. `managed: false` → add your own key.
69
69
 
70
+ ## Check a user's access to a model (SDK / API)
71
+
72
+ Before configuring an agent, check whether the org can actually use a model —
73
+ it combines all three gates (model exists · allowed on the org's plan · managed
74
+ or BYOK-key-present):
75
+
76
+ ```ts
77
+ import { fetchModelAccess, hasModelAccess, fetchModelCatalog } from "@pinecall/sdk";
78
+
79
+ const a = await fetchModelAccess({ service: "tts", model: "eleven_multilingual_v2" });
80
+ // { allowed, reason, provider, managed, planAllowed, hasKey, requiresKey }
81
+
82
+ if (!(await hasModelAccess({ service: "llm", model: "grok-4" }))) {
83
+ // reason: "byok_key_required" → tell the user to add their xAI key
84
+ }
85
+
86
+ const all = await fetchModelCatalog(); // access for every priced model
87
+ ```
88
+
89
+ Reads `PINECALL_API_KEY` (override with `apiKey`). Raw endpoint:
90
+
91
+ ```bash
92
+ curl "https://playground.pinecall.io/api/models/access?service=tts&model=eleven_multilingual_v2" \
93
+ -H "Authorization: Bearer pk_…"
94
+ ```
95
+
96
+ `reason` is one of `ok` · `unknown_model` · `plan_restricted` · `byok_key_required`.
97
+
70
98
  ## BYOK enforcement
71
99
 
72
100
  If you configure a BYOK-only provider and your org has **not** saved a key for it,
@@ -88,6 +116,26 @@ One key can cover multiple services where a provider shares it — e.g. an
88
116
  **ElevenLabs** key enables both ElevenLabs TTS and ElevenLabs Scribe STT; a
89
117
  **Cartesia** key enables Sonic TTS and Ink-Whisper STT.
90
118
 
119
+ ## Operators: flip a provider managed ↔ BYOK
120
+
121
+ The managed/BYOK status of any provider is a single DB flag (`rate.managed`) and is
122
+ the source of truth — flipping it takes effect **immediately** (next session / page
123
+ load), no deploy or re-seed:
124
+
125
+ ```bash
126
+ # Pinecall provides it (no token needed) — requires <PROVIDER>_API_KEY on the box:
127
+ npx tsx scripts/set-managed.ts assemblyai true
128
+
129
+ # Force bring-your-own-key (the user must add their token):
130
+ npx tsx scripts/set-managed.ts assemblyai false
131
+
132
+ # Per service (e.g. only Cartesia STT):
133
+ npx tsx scripts/set-managed.ts cartesia false stt
134
+ ```
135
+
136
+ Enabling managed only works if Pinecall actually holds that provider's key in the
137
+ prod `.env` (`shipway env` to check); otherwise leave it BYOK.
138
+
91
139
  ## What's next
92
140
 
93
141
  - [STT Providers](/reference/stt-providers)