/iblai-vibe:iblai-vibe-apifrom ibl.ai vibe
Bridges the ibl.ai REST API when no SDK component exists. Provides server-side fetch helper, credential rules (session token vs API key), and maps needs to endpoint docs.
Ships in ibl.ai vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
First time here? If
iblai.envhas noARCHITECTURE=, run/iblai-vibe-startfirst (four questions; two minutes) — it decides single-org / multi-org / headless and who signs in, and every skill reads the answer.
Every /iblai-vibe-* skill mounts an SDK component. When none exists for
what the user wants, do not build a workaround in the browser — call the
platform's REST API from a Next.js route handler with the org's Platform API
Token. Everything the platform can do is reachable that way; the
iblai-api-* skills (kind api, same repo) document each endpoint
(method, URL, body, errors).
Common setup (brand, conventions, env files, verification): see docs/skill-setup.md. Terms: docs/glossary.md.
| Where the code runs | Credential | Header | Use for |
|---|---|---|---|
| Browser (client components) | the signed-in user's session token, attached by the SDK automatically | Authorization: Token <dm_token> | everything an SDK hook or component offers; acts as the user, with the user's permissions |
| Server (route handlers, server actions) | IBLAI_API_KEY (= TOKEN in iblai.env) via config.apiKey() | Authorization: Api-Token <key> | anything without a hook, and anything that needs the org's authority (admin writes, cross-user reads, creating agents, sending notifications) |
Server, OpenAI-compatible /v1 only | the same key | Authorization: Bearer <key> | chat completions / model listing on https://asgi.data.<domain>/api/ai-mentor/orgs/<org>/v1 |
Never prefix the key with NEXT_PUBLIC_, never read it outside server files,
never send it to the browser. config.apiKey() returns "" in the browser
by design.
Copy assets/platform.ts → lib/iblai/platform.ts.
It exports:
platformFetch(path, init?) — server-only fetch against
https://api.<DOMAIN> with the Api-Token header, JSON in/out, and a
typed PlatformError carrying the platform's status and body.verifyCaller(req) — reads the Authorization: Token <dm_token> the
browser forwards, calls GET /dm/api/core/token/verify/, and returns the
caller's username; null when the token is missing or rejected.requireAdmin(req) — verifyCaller plus an org-membership check that the
caller is an admin of NEXT_PUBLIC_MAIN_TENANT_KEY (via
GET /dm/api/core/platform/users/?platform_key=&query=<username>), or a
401/403 NextResponse.The browser side sends its token like this (already how vibe-starter's
lib/iblai/metadata.ts does it):
const token = localStorage.getItem("dm_token") ?? "";
await fetch("/api/admin/whatever", {
method: "POST",
headers: { Authorization: `Token ${token}`, "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
Copy assets/route-example.ts →
app/api/admin/example/route.ts, then change the platform path, the methods
and the body checks. It shows the pattern: verify the caller, validate the
body, call the platform, return its answer, map errors.
Status mapping to keep: platform 401 → your 401; 403 → 403 (not an
admin / not allowed); 404 → 404; 429 → 429 (spend cap hit — pass the
body through, it names the interval); anything else → 502 with the
platform's message.
Only org admins may target &username=<other>; the SDK hook has no such
parameter, so it is a server call.
// inside a route handler, after requireAdmin(req)
await platformFetch(
`/dm/api/core/users/platform-metadata/?platform_key=${org}&username=${encodeURIComponent(target)}`,
{ method: "PATCH", body: { metadata: { role_label: "mentor" }, delete_keys: [] } },
);
Reference: profile-metadata.
const agent = await platformFetch<{ unique_id: string }>(
`/dm/api/ai-mentor/orgs/${org}/users/${caller.username}/mentor-with-settings/`,
{
method: "POST",
body: {
template_name: "ai-mentor",
new_mentor_name: name,
display_name: name,
description,
system_prompt: systemPrompt,
},
},
);
// agent.unique_id is the UUID every other agent skill needs
Reference: agent-create; the full UI pattern is /iblai-vibe-agent-create.
await platformFetch(`/dm/api/notifications/orgs/${org}/send/`, {
method: "POST",
body: { username: target, title: "Welcome", body: "Your account is ready." },
});
Confirm the exact path and body in notification before shipping — notification sending is outward-facing; confirm the recipient list with the user first.
iblai-api-* skill documents whatThey install with the rest of this repo's skills (npx skills add iblai/vibe --all); raw links resolve without installing.
The five families most apps read or write are marked ★.
| Need | Skill |
|---|---|
| ★ Per-user custom data (preferences, flags, onboarding, app state) | profile-metadata |
| ★ The user's own profile (name, bio, image, education, résumé) | profile |
| ★ Agent identity, visibility, capability flags; fork; delete | agent-setting |
| ★ Memory: global, per-agent, agent knowledge, toggles | agent-memory |
| ★ Analytics: usage, users, topics, transcripts, costs, per-user, audit, reports | analytics |
| Org settings (default agent, help URL, toggles, your keys) | org |
| Users, groups, roles, policies, teams, alerts | management, rbac |
| Invitations (single, CSV) | invite |
| Directory sync (SCIM 2.0) | scim |
| Create an agent; chat over REST/SSE/WebSocket; sessions | agent-create, agent-session, agent-chat |
| Agent tabs: prompts, LLM, datasets, tools, access, embed, MCP, safety, privacy, evals, audit, history, sandbox, skills, support, disclaimers | iblai-api-agent-<tab> — see /iblai-vibe-agent for the map |
| LLM inference with the platform key (OpenAI-compatible) | inference |
| Search agents and content; recommendations | search |
| Notifications: counts, inbox, mark read, send | notification |
| Credits, paywalls, checkout, subscriptions, revenue | billing |
| Spend caps (org / agent / user) | spend-caps |
| Per-user feature config, app onboarding flags, trials | feature |
| API tokens; LLM / data-source credentials | token, integration |
| Courses, programs, catalog, milestones, credentials, media, applications | catalog, milestone, credential, apply |
| CRM (people, deals, pipelines) | crm |
| Third-party AI services through the platform (ElevenLabs, HeyGen) | external-service-proxy |
| Self-hosting the backend | infrastructure |
Before constructing any URL not copied from a skill, confirm it exists in the live OpenAPI schema:
DOMAIN=$(grep -m1 '^DOMAIN=' iblai.env 2>/dev/null | cut -d= -f2-); DOMAIN=${DOMAIN:-iblai.app}
curl -sS -o /tmp/iblai_schema.yaml "https://api.$DOMAIN/dm/api/docs/schema/"
grep -nE "^ /api/core/users/platform-metadata" /tmp/iblai_schema.yaml
Browsable at https://api.iblai.app/dm/api/docs/. Gateway rule: DM routes
are called with the /dm prefix (/api/core/… → /dm/api/core/…); edX
routes with /lms.
Run /iblai-vibe-ops-test before telling the user the work is ready, and give
every page, control and state this skill added its own checkpoint — one Playwright
test titled <ID> · … in e2e/journeys/, listed in e2e/coverage.json;
pnpm e2e:coverage must pass. Then:
pnpm typecheck and pnpm test (the helper ships with a unit test in
assets/platform.test.ts → __tests__/platform.test.ts).401 without it, 403 as a non-admin, 200 as an admin.grep -rn "IBLAI_API_KEY" app components lib | grep -v "config.apiKey\|process.env.IBLAI_API_KEY" returns nothing./iblai-vibe-user-metadata, /iblai-vibe-org-metadata, /iblai-vibe-agent-create — the three common cases, done end to end/iblai-vibe-admin — gating admin-only routes and pages/iblai-vibe-ops-deploy — the server env (IBLAI_API_KEY) on the hosting platformWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub iblai/base --plugin iblai-vibe166 skills in this plugin
/iblai-api-agent-accessManage role-based access to an ibl.ai agent via the platform API — list role policies, search users/groups, and grant/revoke editor, chat, or analytics_viewer roles for users, groups, and emails. Use when controlling who can edit, chat with, or view analytics for an agent./iblai-api-agent-auditRead an ibl.ai agent's audit log via the platform API — a who-changed-what trail filterable by action, actor email, and date range. Read-only. Use when investigating configuration changes to an agent./iblai-api-agent-chatSet up live chat with a deployed ibl.ai agent by wiring the hosted iblai-api-agent-chat MCP server into the project (.mcp.json / claude mcp add) using the .env Api-Token and a chosen agent's unique id, or by signing in from claude.ai, ChatGPT or Claude Desktop with only the URL. Use to enable runtime conversations with an agent, and to list or disconnect the apps a user has connected. The actual chatting then happens through the MCP server's tools.Other plugins' skills for the same job