ai
Use when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage
npx skills add butterbase-ai/butterbase-skills --skill ai --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Butterbase AI Gateway Every app has an LLM gateway with chat, embeddings, model listing, configuration, and usage reporting. One umbrella tool: **`manage_ai`**. | Action | What it does | Returns | |---|---|---| | `chat` | Synchronous chat completion (no streaming) | OpenAI-shaped `{ choices: [...] }` | | `embed` | Vector embeddings for string or string[] | OpenAI-shaped `{ data: [{ embedding: [...] }] }` | | `list_models` | Available models with capabilities | `{ models: AiModel[] }` | | `get_config` | Current AI config (default model, BYOK key flag, etc.) | `AiConfig` | | `update_config` | Set defaults, allowed models, max tokens, BYOK | `AiConfig` | | `get_usage` | Token + cost aggregate over a window | usage record | --- ## 1. Chat ``` manage_ai({ action: "chat", app_id, messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What's RAG?" } ], model: "openai/gpt-4o-mini", // optional — falls back to app's default temperature: 0.2, // optional max_tokens: 500 // optional }) ``` This action sets `stream: false` deliberately — agent tools don't stream. If you need partial-token deltas, drive the SDK's `ai.chatStream(…)` from inside a fun
- 1. Chat
- 2. Embed
- 3. List models
- 4. Configure
- 5. Usage
- 6. Common pitfalls
- 7. What this skill does NOT cover
What does the ai skill do?
Use when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage
How do I install it?
Run `npx skills add butterbase-ai/butterbase-skills --skill ai --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From butterbase-ai/butterbase-skills, a repository with 532 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.