39. Audit your AI provider keys before they silently die
The job: Point Muse at your AI provider configs — it checks every key against /v1/models, flags dead or unreachable ones, and tells you which breakage actually matters.
Go through every AI provider I have configured (OpenAI, Anthropic, OpenRouter, any custom OpenAI-compatible endpoints). For each one: 1) list the base_url and which env var holds the key, 2) call /v1/models with the key and report HTTP status, 3) flag any that return 401/403 as 'dead key' and any that time out as 'unreachable', 4) cross-check which providers my config actually references as the active model or fallback so I know which dead keys are harmless and which ones would break me. Show me a table: provider, base_url, key prefix (first 6 + last 4 chars only), status, in-use yes/no. Then ask me one question per dead key: keep, rotate, or delete. Do NOT delete or modify anything until I explicitly answer each one.
What Muse will do:
- Tell Muse where your provider configs live (env files, config files)
- Muse lists every provider, base_url, and which env var holds each key
- It calls /v1/models on each and reports the status table
- Answer keep / rotate / delete for each dead key — nothing changes until you say so
Why it works: API keys die quietly: a rotated key, an expired trial, a revoked token. You don't notice until the one night you actually need that fallback provider. This prompt turns a chore nobody does into a five-minute audit — Muse probes every configured provider, then separates the dead keys that would actually break you from the ones that are just clutter. The load-bearing detail is the in-use cross-check: without it you'd waste an evening rotating keys that nothing references.
Common failures:
- Only show key prefixes (first 6 + last 4 chars), never full keys in chat
- 401/403 means dead key; timeouts mean unreachable endpoint — different fixes
- Don't delete a key just because it's dead — check whether any config still references it
Prompt variations:
- Run it monthly as a scheduled check so dead keys never surprise you
- Extend the audit to non-AI API keys (Stripe, Twilio) with the same table format
Submitted by kong
Loading comments…