agents
Use when designing, deploying, or debugging a Butterbase Agent (declarative LLM/tool graph), registering an MCP server for tool…
Use when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage, polling video jobs or preparing declared fictional image references
Claude Code
$ npx -y skills add butterbase-ai/butterbase-skills --skill ai --agent claude-code
Codex
$ npx skills add butterbase-ai/butterbase-skills --skill ai -a codex -y
Cursor
$ npx skills add butterbase-ai/butterbase-skills --skill ai -a cursor -y
Gemini CLI
$ npx skills add butterbase-ai/butterbase-skills --skill ai -a gemini-cli -y
GitHub Copilot
$ npx skills add butterbase-ai/butterbase-skills --skill ai -a github-copilot -y
OpenCode
$ npx skills add butterbase-ai/butterbase-skills --skill ai -a opencode -y
Windsurf
$ npx skills add butterbase-ai/butterbase-skills --skill ai -a windsurf -y
name: ai description: Use when calling the app's AI gateway from agent tools — chat completions, embeddings, listing models, configuring defaults or BYOK, reading token/cost usage, polling video jobs or preparing declared fictional image references
The AI gateway provides chat, embeddings, model listing, configuration, usage reporting, and asynchronous video jobs. 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 | | `submit_video` | Submit an ordinary async video job | `{ job_id, status, polling_url }` | | `poll_video` | Read an existing video job without submitting again | status, optional stage and authenticated content URLs |
---
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 function or DO instead.
`messages[].content` can be a string or an array of content parts (`{ type: "text", text }`, `{ type: "image_url", image_url: {...} }`, `{ type: "video_url", video_url: {...} }`).
---
manage_ai({
action: "embed",
app_id,
input: "hello world", // or ["a", "b", "c"]
model: "openai/text-embedding-3-small", // optional
encoding_format: "float" // or "base64"
})---
manage_ai({ action: "list_models", app_id })
// → { models: [{ id, provider, capabilities: ["chat", "embed", ...], context_window, pricing }, ...] }Use this to discover what the app can call — capabilities + context window matter when picking a model.
---
manage_ai({
action: "update_config",
app_id,
config: {
defaultModel: "openai/gpt-4o-mini",
allowedModels: ["openai/gpt-4o-mini", "anthropic/claude-haiku-4-5"],
maxTokensPerRequest: 4000,
byokKey: "..." // optional — rotates the customer-supplied OpenRouter / Anthropic key
}
})---
manage_ai({
action: "get_usage",
app_id,
startDate: "2026-05-01",
endDate: "2026-05-31"
})Returns aggregate token counts + cost. Useful for billing reconciliation, spending-cap diagnostics, and showing dashboards.
---
---
---
For routing, classification, moderation or scoring, where code needs a choice / yes-no / score with probabilities, use `manage_ai` `action: "decide"` (SDK `ai.decide`) with a decision model (default `typesafe/jev-1.13`) instead of asking a chat model for JSON. It is cheaper, faster and returns typed probabilities. Full reference: `butterbase_docs` topic `ai`, "Decision models".
---
Before video work, call `butterbase_docs` with `topic: "ai"` and discover supported models with `manage_ai({ action: "list_models", app_id, modality: "video" })`.
Preserve the returned job ID, show the reported stage, poll without issuing another submission, and display authenticated content URLs after completion. Use the caller's explicit fictional-character declaration only. Never silently add declarations or automatically label real people as fictional.
Inspect the connected `manage_ai` tool schema before choosing a client surface. When it includes both `reference_declarations` and `prepare_references`, add the declaration example below to `manage_ai` with `action: "submit_video"`. For older MCP servers that lack these fields, send the fields in the REST body for `POST /v1/:appId/videos/completions`; do not assume an older wrapper forwards unknown arguments. Poll the returned job ID with `poll_video` or `GET /v1/:appId/videos/completions/:jobId`. Do not invent an SDK video helper.
Eligible apps and models can declare specific image slots as AI-generated fictional characters:
{
"input_images": ["https://images.example/fictional-character.png"],
"reference_declarations": [
{"path": "/input_images/0", "kind": "ai_generated_fictional_character"}
],
"prepare_references": "onClaude Code plugin for Butterbase — the AI-Native Backend-as-a-Service. This plugin gives Claude deep knowledge of Butterbase's nearly 40 MCP tools, guides you through common workflows, and auto-configures the MCP server connection.
Use when designing, deploying, or debugging a Butterbase Agent (declarative LLM/tool graph), registering an MCP server for tool…
Use when configuring OAuth providers (Google/GitHub/Apple/X/etc.), setting up post-login auth hooks, tuning JWT lifetimes, or…
Use when building a new Butterbase app from scratch, creating a full-stack application, or when the user asks to set up a…
Use when contributing to the Butterbase codebase, adding new MCP tools, creating API routes, writing migrations, or understanding…
Use when users report access denied errors, see wrong data, RLS policies are not working, or when troubleshooting Row-Level…
Use when deploying a frontend (React, Next.js, or static HTML) to a live URL on Butterbase, or when troubleshooting deployment…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.