Talk to VibeHub from code.
One REST surface, one TypeScript SDK, one MCP server. Capture sessions from any agent, attach them to commits, query your vibes, and trigger workflows.
Capture a commit in three calls.
The most common API flow: open a session, append messages, and attach it to a commit.
bash# 1) Start a session
curl -X POST https://www.vibehub.co/api/sdk/sessions \
-H "Authorization: Bearer vbh_..." \
-H "Content-Type: application/json" \
-d '{"source":"cursor","model":"claude-opus-4-7"}'
# → { "session": { "id": "3f2a…", "status": "open", … }, "reused": false }
# 2) Append one or more messages (server assigns sequence)
curl -X POST https://www.vibehub.co/api/sdk/sessions/$SESSION_ID/messages \
-H "Authorization: Bearer vbh_..." \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "fix the foo bug" },
{ "role": "assistant", "content": "Looking at src/foo.ts…" }
]
}'
# → { "added": 2, "total": 2 }
# 3) Attach to a commit (closes the session, unless kind: "live")
curl -X POST https://www.vibehub.co/api/sdk/sessions/$SESSION_ID/attach \
-H "Authorization: Bearer vbh_..." \
-H "Content-Type: application/json" \
-d '{
"sha": "1a2b3c4d…",
"projectId": "$PROJECT_ID",
"message": "feat: add waitlist"
}'Prefer the SDK or the MCP server for any non-trivial integration — both wrap this surface with typed methods, timeouts, and structured errors. All ids are UUIDs.
Long-running sessions (terminals, agent mirrors) should pass kind: "live" when starting. Attach then links a commit without closing the session, so the same session keeps accumulating messages across many commits.
Bearer tokens, vbh_ prefix.
Every API call carries a token from the dashboard at Settings → API tokens. The plaintext is shown once at creation — store it like any other secret.
httpPOST /api/sdk/sessions HTTP/1.1
Host: www.vibehub.co
Authorization: Bearer vbh_3f9c…b21
Content-Type: application/json
{ "source": "cursor" }- PREFIXTokens start with
vbh_. Anything else is rejected. - STORAGEOnly the sha-256 hash is stored. Treat tokens as you would any API key.
- EXPIRYNew tokens expire after 90 days. An expired token gets
401with"code": "token_expired";GET /api/sdk/pingreturns the calling token'sexpiresAtso clients can warn early. Tokens created before expiry shipped never expire. - SCOPEEach token has a scope.
fullcan call everything;capturecan only send sessions, transcripts, commits and git pushes (plus list or create projects and ping), which is all the Claude Code plugin needs;readcan only make GET requests. Anything outside the scope gets403with"code": "insufficient_scope". Tokens created before scopes shipped arefull. - MINTINGCreating a token in the browser asks you to re-confirm: your password, or for GitHub / 1Profile accounts a 6-digit code emailed via
POST /api/auth/request-otp {"purpose":"step-up"}. Only afulltoken can mint another token, and the child never outlives its parent. - HOSTCall
https://www.vibehub.co. The apex domain redirects towww, and HTTP clients drop theAuthorizationheader on that redirect. The SDK, MCP server andvbrewrite it for you. - REVOKE
DELETE /api/cli/tokens/:idor the dashboard. - DASHBOARDBrowser-based UI requests use session cookies — same surface, different auth.
vibehub-sdk for TypeScript.
A tiny, typed wrapper around the REST surface. Works in Node 18+, Bun, Deno, and the browser.
Install
npm i vibehub-sdk
# or
pnpm add vibehub-sdk
bun add vibehub-sdkThe npm package is rolling out — until it lands, the SDK ships in the VibeHub repo under sdk/; npm link from a checkout works today.
Create a client
tsimport { createClient } from "vibehub-sdk";
const vb = createClient({
apiUrl: "https://www.vibehub.co",
token: process.env.VIBEHUB_TOKEN!,
});End-to-end capture
ts// 1) start a session
const session = await vb.startSession({
source: "cursor",
model: "claude-opus-4-7",
externalId: "cursor-chat-123", // idempotency key
});
// 2) stream messages
await vb.appendMessages(session.id, [
{ role: "user", content: "fix the foo bug" },
{ role: "assistant", content: "Looking at src/foo.ts…" },
]);
// 3) attach to a commit
await vb.attachToCommit(session.id, {
sha: "1a2b3c4d…",
projectId, // from vb.listProjects()
message: "fix: foo bug",
});One-shot capture
For agents that already have the whole conversation in memory by the time they commit.
tsawait vb.captureCommit({
projectId,
sha,
message: "feat: thing",
committedAt: new Date(),
diff: gitDiff,
filesChanged: 3,
insertions: 42,
deletions: 7,
conversation: {
source: "windsurf",
messages: [
{ role: "user", content: "…" },
{ role: "assistant", content: "…" },
],
},
});Method index
Sessions
ping()Health + identity probe; returns the user and the token's scope and expiresAt.
startSession(input)Open a session. Idempotent via externalId. Pass kind:'live' for terminals & agent mirrors.
appendMessages(id, msgs)Append one or many messages; sequence is server-assigned.
getSession(id, { includeMessages? })Fetch a session with optional messages.
listSessions({ status?, projectId?, limit? })List the authenticated user's sessions.
updateSession(id, patch)Patch summary, status, or endedAt.
attachToCommit(id, params)Link the session to a git commit; closes it unless kind is 'live'.
captureCommit(input)Bulk POST: commit + conversation in one call. Repeat calls for a known sha return reused:true.
Projects & history
createProject(input)Create a project, or reuse yours with the same name. Defaults to private.
listProjects()List the user's projects.
listCommits({ projectId, limit? })Recent commits, newest first, with stats and message counts.
getCommit({ sha, projectId })One commit + its linked conversation. Short sha prefixes (≥4 hex) work.
getCommitDiff({ sha, projectId, path? })File list, or one file's unified diff.
getBlame({ projectId, path, branch? })Approximate per-line blame replayed from stored diffs.
Branches & mirror
listBranches / upsertBranchTracked branches; upsert advances headSha or swaps the default.
updateBranch(id, patch) / deleteBranch(id)Rename, move, re-default, or delete a tracked branch.
getMirror / setMirror / removeMirrorGitHub mirror config; the PAT is stored encrypted.
rotateMirrorWebhook({ projectId })New inbound webhook secret, returned once.
Tokens & credits
listTokens / createToken / revokeTokenManage API tokens; a token-minted child never outlives its parent.
getBalance({ fresh? })Credit balance (cached 60s; fresh: true re-reads it).
createClientFromEnv()Build a client from VIBEHUB_API_URL and VIBEHUB_TOKEN.
Endpoint reference.
All endpoints are JSON-in / JSON-out, return standard HTTP status codes, and live under https://www.vibehub.co. Bearer (vbh_…) tokens authenticate the /api/cli/*, /api/sdk/* and /api/integrations/* groups, plus /api/me and /api/billing/balance, tiers and checkout. Everything else (dashboard projects, vibes, runs, workflows, evals, collections, agent) needs the browser session cookie. List endpoints take limit/offset and return nextOffset (null on the last page). The token-authenticated routes are described in an OpenAPI 3.1 document at /api/openapi.json.
Projects (session)
/api/projectsList the user's projects (paginated).
/api/projectsCreate a project; the slug is made unique. Defaults to public. (The token route POST /api/cli/projects reuses by name and defaults to private.)
/api/projects/:slugOne project. PATCH to edit, DELETE to remove.
/api/projects/:slug/commitsCommits for the project; /commits/:sha for one with its conversation.
/api/projects/:slug/branchesBranches VibeHub tracks for the project.
/api/projects/:slug/mirrorLink the GitHub mirror (GET to read, DELETE to unlink, POST ?action=rotate-webhook for a new webhook secret).
Vibes & commits
/api/vibesYour own vibes (session; paginated). Others' public vibes live at /u/:username/:slug and /explore.
/api/vibesCreate a vibe (session).
/api/vibes/:idOne vibe with its evals and forks. PATCH to edit, DELETE to remove (session).
/api/cli/commitsCapture a commit + conversation (used by vb commit). Free.
/api/cli/commitsList a project's commits (?project_id=…&limit=N).
/api/cli/commits/:shaFetch a commit + conversation by SHA (?project_id=…; short prefixes accepted).
/api/cli/commits/:sha/diffFile list for a commit (?project_id=…), or one file's unified diff with &path=….
/api/cli/blameApproximate blame (?project_id=…&path=…[&branch=…]), replayed from stored diffs.
/api/evalsYour latest evals, or one vibe's with ?vibeId=… (yours or public). Session auth.
/api/evalsRun an eval on a vibe you own. Simulated preview: the result and score are generated, not measured. Free. Session auth.
Git (smart HTTP)
/api/git/:owner/:slug.git/git-receive-packgit push target. HTTP Basic auth with any username and a vbh_ token as the password. Costs 2 credits. Fetch/clone (upload-pack) returns 501.
Sessions (SDK & MCP backend)
/api/sdk/pingIdentity + health probe. Canonical Test Connection target for SDK clients.
/api/sdk/sessionsOpen a new session, or reuse one by externalId. Pass kind:'live' for long-running sessions.
/api/sdk/sessionsList the user's sessions. Filter by status or project_id.
/api/sdk/sessions/:idFetch a session, optionally with messages.
/api/sdk/sessions/:idPatch summary, status, or endedAt.
/api/sdk/sessions/:id/messagesAppend messages. Sequence is server-assigned. Max 500/call.
/api/sdk/sessions/:id/attachLink the session to a commit. Closes the session unless kind is 'live'.
/api/mcpHosted MCP server (Streamable HTTP, stateless): the vibehub-mcp tools over JSON-RPC. Bearer vbh_ token or a 1Profile access token.
Workflows & runs
/api/workflowsList workflows.
/api/workflowsCreate a new workflow.
/api/workflows/:idFetch a workflow. PATCH to edit or pause, DELETE to remove.
/api/workflows/:id/triggerFire an active workflow now (no body). Records the run count and notifies you; 400 if the workflow isn't active.
/api/runsYour recent runs (paginated).
/api/runsStart a run/replay of a vibe ({ vibeId, title?, model? }). Simulated preview: no model is called, and status, tokens and cost are generated. Free.
/api/runs/:idOne run with its status, tokens and cost. DELETE to remove.
/api/runs/:id/eventsAppend up to 500 timeline events (messages, tool calls, results) to your run, in order. Session or vbh_ token. GET returns the timeline.
Collections, builders, activity
/api/collectionsList the user's collections.
/api/collectionsCreate a collection.
/api/collections/:idOne collection with its vibes. PATCH to edit, DELETE to remove.
/api/collections/:id/vibesAdd a vibe to a collection (DELETE to remove it).
/api/buildersBrowse public builders & profiles.
/api/builders/:id/followFollow a builder (DELETE to unfollow).
/api/activityActivity feed for the authenticated user.
/api/analyticsSummary across all your vibes and runs.
Marketplace
/api/marketplace/listingsYour listings, the platform fee percent, and credits earned.
/api/marketplace/listingsList a project for sale ({ projectSlug, title, tagline?, description?, category, tags?, priceCredits }). Goes live after admin review.
/api/marketplace/listings/:idEdit a listing. Text changes send it back to review; price changes don't. DELETE delists it.
/api/marketplace/listings/:id/statusLive price and whether you own it, are the seller, or have a purchase in progress. Works signed out.
/api/marketplace/listings/:id/purchaseBuy and copy the project into your account. Send { expectedPrice }; a changed price returns 409 price_changed with the new price.
/api/marketplace/purchasesListings you've bought, with the project each was copied into.
Agent (dashboard chat)
/api/agent/chatStream a chat turn as Server-Sent Events ({ conversationId, content }). Writes come back as needs_confirm steps; send approved: [{ tool, input }, …] (up to 20) on the next turn to run them. 1 credit per turn; 20/min.
/api/agent/toolsList tools the agent has access to.
/api/agent/metricsPer-conversation usage metrics.
/api/agent/conversationsList the user's agent conversations.
/api/agent/conversationsStart a conversation.
/api/agent/conversations/:idFetch a conversation with its turns. PATCH to rename, DELETE to remove.
/api/agent/conversations/:id/exportExport a conversation as Markdown.
/api/agent/conversations/:id/regenerateRegenerate the last assistant turn.
Account & tokens
/api/meThe authenticated user's profile (session or Bearer). PATCH to update profile and prefs; DELETE closes the account (browser session + step-up only).
/api/cli/tokensList the user's API tokens (metadata only).
/api/cli/tokensMint a token ({ name, scope? }); scope is full (default), capture or read. Plaintext returned once, expires in 90 days. Browser sessions must step up with `password` or an emailed `code`; a token-minted token never outlives its parent.
/api/cli/tokens/:idRevoke a token.
/api/cli/projectsList your projects. POST { name } creates one, or reuses yours with that name.
/api/cli/branchesTracked branches (?project_id=…). POST upserts { projectId, name, headSha?, isDefault? }.
/api/cli/branches/:idRename, move, or re-default a branch. DELETE removes it.
/api/cli/mirrorsThe project's GitHub mirror (?project_id=…[&reveal=1][&reveal_webhook=1]). PUT sets it, DELETE { projectId } removes it, POST ?action=rotate-webhook rotates the secret.
/api/cli/mirrors/pushRecord the result of a push vb already made ({ projectId, sha, error? }).
/api/cli/mirrors/webhookGitHub push webhook receiver (two-way sync; HMAC verified).
Billing (credit-based, cred.diy)
/api/billing/balanceCurrent credit balance (60s cache, ?fresh=1 to refresh). Session or Bearer.
/api/billing/tiersCredit pack tiers. Session or Bearer.
/api/billing/checkoutStart a hosted checkout for a credit pack. Session or Bearer.
/api/billing/transactionsYour credit ledger (session).
Integrations & git
/api/integrations/importImport a finished chat from v0, Lovable, Bolt, Copilot, Cursor, Windsurf or other ({ source, messages, externalId? }; up to 2,000 messages; idempotent on externalId).
/api/integrations/claude-code/hookClaude Code hook receiver ({ type: session_start | message | session_end, … }).
/api/git/:owner/:slug.git/info/refsGit smart-HTTP ref discovery for git push. Basic auth with any username and a vbh_ token as the password. Pushes cost 2 credits. Clone and fetch aren't served yet: git shows an error telling you to fetch from your mirror.
Notifications & invites (session)
/api/notificationsIn-app notifications. PATCH marks read; DELETE clears.
/api/invitesYour sent invites. POST to invite by email.
Errors, idempotency & rate limits.
Predictable failure modes and replay safety for any integration that can't afford double-writes.
- Status codes —
200/201success,400validation,401missing, invalid or expired token,402out of credits,403not allowed (e.g. failed step-up),404not found,409conflict (e.g. project slug taken),429rate-limited. - Error body — always
{ "error": "human-readable", "code"?: "snake_case_key" }. Auth failures usemissing_token,invalid_tokenortoken_expired. - Idempotency — session creation accepts an
externalId; commit registration is idempotent by SHA + project. - Rate limits — session creation, message appends, commit capture, runs and git pushes are capped per user at
30 req/minand300 req/hour. Agent chat has its own20/min,200/hourand a daily token quota. Exceeding a limit returns429with aRetry-Afterheader. - Credits — premium actions deduct prepaid credits: agent chat turn 1, git push 2. Commit capture is free, and so are runs and evals while they're a simulated preview. Marketplace purchases cost the listing's price. Out of credits →
402 { "code": "insufficient_credits" }. - SDK —
VibeHubErrorcarries.status,.codeand the parsed.body.
Model Context Protocol server.
vibehub-mcp is a stdio MCP server. Drop it into any MCP-capable IDE and the agent gains a small toolbelt that records the chat and attaches it to commits.
Install
# install globally
npm i -g vibehub-mcp
# or run on demand
npx vibehub-mcpThe server reads two env vars: VIBEHUB_API_URL (defaults to https://www.vibehub.co) and VIBEHUB_TOKEN (required — same vbh_… token as the SDK).
Like the SDK, the npm package is rolling out — until it lands, run it from a repo checkout: node mcp/src/server.js (or npm link inside mcp/).
How sessions work
A session is an open conversation. It starts open, accumulates messages, and becomes attached when linked to a commit, unless it was started with kind: "live", in which case it stays open and current across commits. The current session id is persisted at ~/.vibehub/mcp-state.json so tools like vibehub_append_message can omit sessionId.
Encourage the agent to actually use these tools by adding an instruction to your project rules file (.cursorrules, AGENTS.md, etc) — see the patterns below.
The vibehub_* toolbelt.
Every MCP-capable agent that mounts the server sees these tools. Each wraps an SDK call, and they persist the “current session” locally so the agent doesn't need to thread an id everywhere.
Session capture
vibehub_whoamiCheck the token: returns the signed-in user and when the token expires.
vibehub_start_sessionOpen a new session and remember it as current. Call once per chat; kind:'live' keeps it open across commits.
vibehub_append_messageAppend a single user/assistant/tool/system message.
vibehub_append_messagesBatch-append messages (useful for backfilling).
vibehub_attach_to_commitLink the session to a SHA (closing it unless live). Creates the commit row if needed.
vibehub_current_sessionReturn the active session id, status, kind, and message count.
vibehub_list_sessionsRecent sessions, filterable by status or project.
vibehub_list_projectsList the user's VibeHub projects (id, slug, name).
vibehub_create_projectCreate (or reuse) a project by name. Sets visibility.
Commit history
vibehub_capture_commitOne-shot commit + conversation capture — the MCP equivalent of vb commit.
vibehub_list_commitsRecent commits for a project, newest first, with stats.
vibehub_get_commitOne commit + linked conversation. Accepts short SHA prefixes (≥4 hex chars).
vibehub_get_commit_diffFile list for a commit, or the per-file unified diff when path is passed.
vibehub_blameApproximate per-line attribution for a file, replayed from stored diffs.
Branches & GitHub mirror
vibehub_list_branchesBranches VibeHub tracks for a project, with head SHAs.
vibehub_upsert_branchCreate or update a tracked branch; headSha advances the head, isDefault swaps the default.
vibehub_get_mirrorRead the GitHub mirror config and last push/receive status.
vibehub_set_mirrorConfigure the mirror. PAT stored encrypted server-side; omit token to keep the existing one.
vibehub_rotate_mirror_webhookGenerate/rotate the inbound webhook secret — plaintext returned once, with the payload URL to register.
Suggested agent instructions
Paste into your IDE's system prompt, project rules, or AGENTS.md:
Use the `vibehub_*` tools to record this conversation.
• Call vibehub_start_session once at the start with source set to the IDE name.
• After every assistant response, call vibehub_append_message with role
"assistant" and the response content.
• When the user commits, call vibehub_attach_to_commit with the SHA.IDE configuration.
Anywhere that accepts a stdio MCP server command + args + env, the same three lines work.
Cursor
~/.cursor/mcp.json
json{
"mcpServers": {
"vibehub": {
"command": "npx",
"args": ["-y", "vibehub-mcp"],
"env": {
"VIBEHUB_API_URL": "https://www.vibehub.co",
"VIBEHUB_TOKEN": "vbh_…"
}
}
}
}Claude Desktop
macOS ~/Library/Application Support/Claude/claude_desktop_config.json · Windows %APPDATA%\Claude\claude_desktop_config.json · Linux ~/.config/Claude/claude_desktop_config.json
json{
"mcpServers": {
"vibehub": {
"command": "npx",
"args": ["-y", "vibehub-mcp"],
"env": {
"VIBEHUB_API_URL": "https://www.vibehub.co",
"VIBEHUB_TOKEN": "vbh_…"
}
}
}
}Windsurf · Zed · JetBrains · Visual Studio · Continue.dev
Any MCP-capable IDE uses the same command + args + env shape — the exact config file changes, but the contents don't. Ready-made templates for each IDE live under integrations/<ide>/mcp.template.json in the repo, with per-IDE guides on the dashboard's Integrations page.
json{
"command": "npx",
"args": ["-y", "vibehub-mcp"],
"env": {
"VIBEHUB_API_URL": "https://www.vibehub.co",
"VIBEHUB_TOKEN": "vbh_…"
}
}Windows: npx is a .cmd script there, and editors that launch MCP servers without a shell (Claude Desktop, Zed) fail with spawn npx ENOENT. Use "command": "cmd", "args": ["/c", "npx", "-y", "vibehub-mcp"] instead. The npx vibehub-* installers write this for you.
For zero-friction commits, point your IDE's commit flow at vb commit --attach-session <id> — the CLI calls attach_to_commit for you.
How often Vibe picks the right tool.
Vibe, the in-app agent, is graded against a fixed set of requests: routing, writes held for approval, refusals of destructive or injected actions, and multi-step chains.
| Model | Pass rate | Graded | p95 latency | Cost / case | Measured |
|---|---|---|---|---|---|
| Keyword router (no model) | 100.0% | 39/39 (3 runs) | 1232 ms | $0 | 2026-11-12 |
No Claude model has a published run yet. The keyword router is the built-in mode used without an API key; it is graded only on the cases it is meant to handle, and its latency reflects local streaming, not a model. Fixture: tests/eval/router.json. Model notes and the switching rule live in docs/agent-models.md.
shellnpm run db:seed
ANTHROPIC_API_KEY=… npm run eval:agent -- --model claude-sonnet-4-6 \
--user-email demo@vibehub.co --publish