---
name: ai-stack-audit
description: Audit the AI apps and subscriptions someone pays for (image, video, music, voice, editing). For each one, find the model underneath, whether it has an official API, CLI or MCP server, what going direct would cost at their real monthly usage, and whether to keep it, go direct, or mix. Use when the user lists AI tools they use, asks "is this a wrapper?", "is there an API for X?", "am I overpaying for X?", "can Claude use X?", or wants to connect their creative tools to Claude Code.
---

# AI stack audit

Many AI apps are **wrappers**: a nice app on top of someone else's model. Some are worth the markup (good presets, a fast editor, a license, bundled credits). Others charge extra for a model you could call directly for less. This skill works out which is which, one tool at a time, and then connects the ones worth connecting to Claude Code.

## 1. Get the list and the usage

Ask the user for:
- Every AI tool they use, and what they use it for.
- What they pay for each one (plan name and monthly price).
- Rough monthly usage: images, songs, video seconds, minutes of voice, hours of editing.

If they don't know their usage, ask for a rough guess and say the verdict depends on it. Don't skip this step: a subscription with bundled credits is often cheaper at low or uneven volume, and pay-per-call is cheaper at high volume.

## 2. Look up each tool (search the web; don't answer from memory)

For each tool, find and cite a source URL with the date for every point:

1. **What it is.** Pick one:
   - **Model maker.** It trains its own model, e.g. Google Gemini, xAI Grok, Suno, Runway.
   - **Wrapper.** It runs other companies' models. Look for "powered by", a model picker, or model names in its docs.
   - **Aggregator.** One key for many models, e.g. fal.ai, Replicate, OpenRouter.
   - **Desktop app.** Local software with its own scripting, e.g. DaVinci Resolve, ComfyUI.
2. **The model underneath.** Name it if a wrapper says which one, e.g. "Kling 2.x", "Veo 3.1", "Flux". If it doesn't say, write "not disclosed". Don't guess.
3. **The lowest level you can reach**, in this order:
   - Official API: docs URL, auth, and price per unit.
   - Official CLI or SDK.
   - MCP server. Official, or community? For community servers give GitHub stars, the last commit date, and whether it needs a paid version of the app.
   - Scripting API inside the app, e.g. Python or Lua.
   - Open weights you can run on your own computer: license, and the memory (VRAM or unified memory) it needs.
   - A website only: Claude in Chrome can drive it, but only if the terms allow automation. Many don't (Suno's terms ban "robots"). Then mark it **No lower level**.
4. **The price both ways:**
   - The subscription: monthly price, the credits it includes, and what a credit buys.
   - Direct: price per image, per second of video, or per song.
   - The same model on an aggregator, if it's there.
5. **What the wrapper adds that direct doesn't.** For example: presets and prompt templates, an editor, a commercial license, upscaling, consistent characters, a community, or a mobile app.

## 3. Do the math

At the user's monthly usage, for each tool, give:
- **Direct cost:** usage × direct price.
- **Subscription cost:** the plan price, plus any overage.
- **Break-even:** the usage where the two cost the same.

Then pick one verdict:
- **Keep it.** The wrapper's extras, or its bundled credits, beat going direct at this usage.
- **Go direct.** Same model, clearly cheaper, and nothing they'd miss.
- **Mix.** Use the aggregator or wrapper to *try* models, then switch to the model maker's own API once one model wins.
- **No lower level.** There is no official API. Keep the subscription. Do **not** suggest unofficial "API" scrapers or cookie-based wrappers: they break the tool's terms and can get the account banned.

## 4. Connect what's worth connecting

For each tool marked **Go direct** or **Mix**:
1. Tell the user where to create the API key. **They** create it and copy it on this Mac (or on an iPhone next to it with Handoff on). Never in the chat. Then save it from the clipboard without anyone typing it:
   - If `~/studio/bin/save-key` is missing, install it: `mkdir -p ~/studio/bin && curl -fsSL https://massonit.com/ai-studio/save-key.sh -o ~/studio/bin/save-key && chmod +x ~/studio/bin/save-key`. Show them the script first if they want to read it.
   - Run `~/studio/bin/save-key XAI_API_KEY` (the right name for each provider). It moves the key into the macOS Keychain, adds a loader line to `~/.zshrc` and prints only "Saved". Never run `pbpaste` on its own, never print the variable, and never read the Keychain item back.
   - Then they quit and reopen Claude Code (and any `claude remote-control` window) so the key loads.
   - Fallback, if they'd rather not: they open `~/.zshrc` with `open -e ~/.zshrc`, add `export XAI_API_KEY=...` themselves, save and restart. Never type a key into a command.
2. Tell them to set a spending cap or a prepaid balance on the provider's billing page, if the provider has one.
3. Wire it up, preferring the first option that exists:
   - An official MCP server: `claude mcp add ...`, with the key passed as an `${ENV_VAR}`, not typed out.
   - The official CLI or SDK.
   - A small script that Claude writes for the user. It should log what each call cost to a file, so spend stays visible.
4. Test it with **one** cheap call, and show the result and its cost.

## 5. Report

Write `ai-stack-audit.md` in the current folder and show the user a summary. Include:
- A table with these columns: Tool, What it is, Model underneath, API / CLI / MCP, Direct price, Their plan, Monthly at their usage (direct vs plan), Verdict.
- One paragraph per tool, in plain words, with the sources.
- What to cancel, what to keep, and what to connect next.
- What changes if usage doubles or halves.

## Rules

- Answer in the user's language. If they write in Spanish, the questions, the report and `ai-stack-audit.md` are in Spanish.
- Every price and claim needs a source URL and an "as of" date. If you can't verify something, write "unverified".
- Never sign up for anything, buy anything, or change a plan. Tell the user what to do and let them do it.
- Never ask for an API key in the chat.
- Pick the cheapest option that does the job, but say so when the wrapper is worth it.
