API Reference

API reference

Every route under /api accepts a session cookie (the browser) or a personal API key: Authorization: Bearer bfk_…. Keys are created on the API keys page and act as you, with your plan and credits. A read-only key is refused (403 read_only_key) on anything but GET and cannot open an MCP session.

Machine-readable version: openapi.json (OpenAPI 3.1; paths, methods and summaries, bodies described in prose).

Quick start

curl -X POST https://app.example.com/api/projects \
  -H "Authorization: Bearer bfk_..." -H "Content-Type: application/json" \
  -d '{"prompt":"A landing page for a bakery","model":"openrouter/openrouter/free","template":"vite-react"}'

# → { project: { id, slug, ... }, run: { runId, budgetUsd } }
curl -N https://app.example.com/api/runs/<runId>/events -H "Authorization: Bearer bfk_..."

CLI

buildify login stores a key; then buildify create "prompt", buildify continue <project> "change", buildify watch <run>, buildify publish <project>, buildify projects, buildify models, buildify credits, plus duplicate, folders, assets, billing, members / invite / uninvite and team / team-invite / team-remove / team-leave. create takes --reference <url>. Source lives in packages/cli.

MCP

Point Claude, Cursor or any MCP client at /mcp (Streamable HTTP) with the same bearer key. Tools: get_credits, list_models, list_projects, create_project (with referenceUrl), get_plan, build_from_plan, continue_project, get_run, publish_project, list_folders, move_project, duplicate_project, list_assets, list_members, add_member, remove_member, list_team, add_team_member, remove_team_member, run_audit, get_audit, fix_audit, retry_run, report_run, get_billing.

Routes

MethodPathWhat
GET/api/me/creditsBalance, plan and today's usage.
GET/api/catalogModels you can use with credit prices per 1M tokens.
GET/api/projectsYour projects.
POST/api/projectsCreate a project and start the first build. Body: prompt, model, template (vite-react | nextjs | vite-three | remote), name?, plan? (true = plan + questions first); draft? (true = create only, attach assets, then POST /runs with kind create); remote? (template remote: owner, repo, baseBranch, createBranch?, workBranch?, author {name, email}, checkCmd?).
GET/api/github/reposRemote Coding: repositories your linked GitHub account can push to.
GET/api/github/repos/:owner/:repo/branchesRemote Coding: branches of a repository.
GET/api/projects/:id/prRemote Coding: current pull request and a suggested title/body.
POST/api/projects/:id/prRemote Coding: open the pull request work branch → base branch. Body: title, body?, draft?.
PATCH/api/projects/:id/remoteRemote Coding: change branches, author or check command (owner, project idle).
DELETE/api/projects/:idSoft delete.
POST/api/projects/:id/runsFollow-up build. Body: prompt, model.
GET/api/projects/:id/runsRuns for a project.
GET/api/runs/:id/eventsServer-sent events: the live trace of a run (status, tool calls, file changes, preview_ready, version).
POST/api/projects/:id/publishDeploy the current version to a production URL.
PUT/api/projects/:id/visibilityBody: isPublic. Public projects get a share page and appear in /apps.
GET/api/projects/:id/files?sha=File list at a version; /file?sha=&path= returns one file.
GET/api/projects/:id/diff?base=&head=Changed files with patches between two commits.
GET/POST/api/projects/:id/assetsImages attached to the project (multipart file, 2 MB and 10 per project). They appear in the sandbox under public/assets and are mentioned to the agent.
GET/DELETE/api/projects/:id/assets/:assetIdFetch or remove one image.
GET/api/projects/:id/transcriptThe conversation and version list as Markdown.
PATCH/api/projects/:idBody: name, folderId, defaultModel, status (active | archived), instructions (rules the agent follows on every run, max 4000 chars).
POST/api/referenceBody: url. Summarises a public page (title, headings, excerpt) and returns the prompt block; POST /api/projects also accepts referenceUrl.
POST/api/projects/:id/transferOwner only. Body: userId of a collaborator, who becomes the owner; you stay as editor. Refused while a build runs.
GET/PUT/POST/DELETE/api/projects/:id/webhookOwner only. PUT body: url (public https) returns the signing secret once; POST sends a signed ping. Events: run.finished, project.published, project.publish_failed; header X-Buildify-Signature: sha256=HMAC-SHA256(secret, raw body).
GET/POST/DELETE/api/projects/:id/membersCollaborators. POST body: email (an existing account), role (editor | viewer). Editors build on the owner's credits. DELETE body: userId (owner removes anyone; a member can remove themselves).
GET/PUT/DELETE/api/projects/:id/envProject environment variables (names only on read).
GET/PUT/DELETE/api/projects/:id/domainCustom domain (Pro/Max): DNS records to set, status.
POST/api/auditsSEO or accessibility audit. Body: url, kind (seo | a11y), projectId? (links the audit to a project so its findings can become a fix run), pages? (a11y: crawl up to 10 same-site pages; each is priced as one audit).
GET/api/me/usageCredit ledger entries.
GET/PUT/api/me/email-prefsOptional mail toggles: digest, lowBalance.
GET/POST/DELETE/api/workspace/membersYour team: members see every project in your workspace. POST body: email, role (editor | viewer). DELETE body: userId (remove), email (revoke invite) or workspaceId (leave a team).
GET/POST/api/chat/conversationsAI chat: list conversations; POST body: model, firstMessage.
GET/PATCH/DELETE/api/chat/conversations/{id}Transcript; PATCH renames (title), stars (isStarred) or shares (shared: true mints /shared/<token>, false revokes); DELETE removes it and its messages.
POST/api/chat/conversations/{id}/messagesSend a message and stream the reply as SSE (delta, done, error). Body: model, content.
POST/api/runs/{id}/retryRe-queue a failed, timed-out or stopped build with the same prompt, model and base version.
GET/POST/api/runs/{id}/claimReport a bad build (POST body: reason) to ask for the run's credits back; one claim per run, within 14 days. GET shows the claim's status.
POST/api/audits/{id}/fixStart a follow-up build on the audit's project that fixes the failing checks. Body: model? (defaults to the recommended model).
PATCH/DELETE/api/projects/{id}PATCH: name, folderId, defaultModel, instructions, status (active | archived), pinned (sorts first on the dashboard); DELETE archives it.
POST/api/projects/{id}/github/pushCopy the current version into your own GitHub repository (linked GitHub account with repo scope). Body: repo (name or owner/name; created private when missing), branch? (main).
GET/api/projects/{id}/downloadThe project's code as a zip (current version, or ?sha= for an older one). Any member can download.
GET/api/me/exportEverything stored about you as one JSON file (no secrets).
GET/api/billing/offersPlans, packs, your subscription and payment history.

Errors

401 unauthorized · 402 with error = insufficient_credits, daily_cap, concurrency, project_busy, model_unavailable · 429 rate_limited (retry_after_s) · 404 for anything outside your workspace.