You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/skills/add-hosted-key/SKILL.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,45 @@ In the block config (`blocks/blocks/{service}.ts`), add `hideWhenHosted: true` t
194
194
195
195
The visibility is controlled by `isSubBlockHiddenByHostedKey()` in `lib/workflows/subblocks/visibility.ts`, which checks the `isHosted` feature flag.
196
196
197
+
### Excluding Specific Operations from Hosted Key Support
198
+
199
+
When a block has multiple operations but some operations should **not** use a hosted key (e.g., the underlying API is deprecated, unsupported, or too expensive), use the **duplicate apiKey subblock** pattern. This is the same pattern Exa uses for its `research` operation:
200
+
201
+
1.**Remove the `hosting` config** from the tool definition for that operation — it must not have a `hosting` object at all.
202
+
2.**Duplicate the `apiKey` subblock** in the block config with opposing conditions:
203
+
204
+
```typescript
205
+
// API Key — hidden when hosted for operations with hosted key support
Both subblocks share the same `id: 'apiKey'`, so the same value flows to the tool. The conditions ensure only one is visible at a time. The first has `hideWhenHosted: true` and shows for all hosted operations; the second has no `hideWhenHosted` and shows only for the excluded operation — meaning users must always provide their own key for that operation.
229
+
230
+
To exclude multiple operations, use an array: `{ field: 'operation', value: ['op_a', 'op_b'] }`.
231
+
232
+
**Reference implementations:**
233
+
-**Exa** (`blocks/blocks/exa.ts`): `research` operation excluded from hosting — lines 309-329
Add an entry to the `PROVIDERS` array in the BYOK settings component so users can bring their own key. You need the service icon from `components/icons.tsx`:
0 commit comments