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
| Method | Path | What |
|---|---|---|
| GET | /api/me/credits | Balance, plan and today's usage. |
| GET | /api/catalog | Models you can use with credit prices per 1M tokens. |
| GET | /api/projects | Your projects. |
| POST | /api/projects | Create 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/repos | Remote Coding: repositories your linked GitHub account can push to. |
| GET | /api/github/repos/:owner/:repo/branches | Remote Coding: branches of a repository. |
| GET | /api/projects/:id/pr | Remote Coding: current pull request and a suggested title/body. |
| POST | /api/projects/:id/pr | Remote Coding: open the pull request work branch → base branch. Body: title, body?, draft?. |
| PATCH | /api/projects/:id/remote | Remote Coding: change branches, author or check command (owner, project idle). |
| DELETE | /api/projects/:id | Soft delete. |
| POST | /api/projects/:id/runs | Follow-up build. Body: prompt, model. |
| GET | /api/projects/:id/runs | Runs for a project. |
| GET | /api/runs/:id/events | Server-sent events: the live trace of a run (status, tool calls, file changes, preview_ready, version). |
| POST | /api/projects/:id/publish | Deploy the current version to a production URL. |
| PUT | /api/projects/:id/visibility | Body: 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/assets | Images 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/:assetId | Fetch or remove one image. |
| GET | /api/projects/:id/transcript | The conversation and version list as Markdown. |
| PATCH | /api/projects/:id | Body: name, folderId, defaultModel, status (active | archived), instructions (rules the agent follows on every run, max 4000 chars). |
| POST | /api/reference | Body: url. Summarises a public page (title, headings, excerpt) and returns the prompt block; POST /api/projects also accepts referenceUrl. |
| POST | /api/projects/:id/transfer | Owner 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/webhook | Owner 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/members | Collaborators. 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/env | Project environment variables (names only on read). |
| GET/PUT/DELETE | /api/projects/:id/domain | Custom domain (Pro/Max): DNS records to set, status. |
| POST | /api/audits | SEO 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/usage | Credit ledger entries. |
| GET/PUT | /api/me/email-prefs | Optional mail toggles: digest, lowBalance. |
| GET/POST/DELETE | /api/workspace/members | Your 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/conversations | AI 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}/messages | Send a message and stream the reply as SSE (delta, done, error). Body: model, content. |
| POST | /api/runs/{id}/retry | Re-queue a failed, timed-out or stopped build with the same prompt, model and base version. |
| GET/POST | /api/runs/{id}/claim | Report 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}/fix | Start 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/push | Copy 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}/download | The project's code as a zip (current version, or ?sha= for an older one). Any member can download. |
| GET | /api/me/export | Everything stored about you as one JSON file (no secrets). |
| GET | /api/billing/offers | Plans, 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.