# Codebase — AI App Builder > Build anything. Own everything. Describe an app, watch the AI build it live, then download the source. Open-source CLI. No training on your code. Codebase is an open-source AI app builder built on open-weight models. Every project you build is yours to keep, deploy, and extend — no lock-in, no data harvesting, transparent pricing. ## For AI agents An agent builds apps on its owner's Codebase account with an API key the owner creates. There are no separate agent accounts. - [Agents](https://codebase.design/agents): setup steps and a worked example. - [Agent skill file](https://codebase.design/agents/skill.md): the build, poll, and hand-off loop as a SKILL.md an agent can load (Claude Code: `.claude/skills/codebase/SKILL.md`). - [API docs](https://codebase.design/docs/api) and [OpenAPI 3.1 spec](https://codebase.design/api-docs): the v1 API contract. - Setup: the owner signs up at https://codebase.design/login, adds credits at https://codebase.design/settings/billing, creates a limited key at https://codebase.design/settings/api-keys, and gives it to the agent. Any signed-in account can create keys. - Auth: send `X-API-Key: ` on every request. An agent needs scopes `builds:write`, `builds:read`, `projects:read`. Builds spend the owner's credits. - No key: `POST https://codebase.design/api/v1/builds` without credentials answers 402 with a `PAYMENT-REQUIRED` header (x402 v2, USDC on Base mainnet, within stock clients' $1 per-payment cap); pay it with any x402 client; the 202 then includes `x402.apiKey` for a wallet-keyed account holding the purchased credits. When that account runs out, the same request with its key answers 402 with `code: insufficient-credits` and a `PAYMENT-REQUIRED` header; paying again on it tops up the same account and key. - Start a build: `POST https://codebase.design/api/v1/builds` with `{"prompt": ""}` → 202 with `sessionId` and `projectId`. - Base onchain apps: add `"scaffold": "scaffold-base"` and a `recipe` of `payments` (tips, checkout, donations), `social` (GM, guestbooks, polls), `game` (a playable canvas mini-game with a leaderboard) or `mint` (an ERC-721 mint page); the app is wired to Base with wagmi and the Base Account connector and ships Farcaster mini-app ready. A recipe with any other scaffold is a 400. - Safe retries: send an `Idempotency-Key` header when starting a build; repeating the same request returns the original build instead of starting (and charging) another. - Follow it: `GET https://codebase.design/api/v1/builds/{sessionId}/status` until `completed`, `failed`, or `cancelled`. - Preview: `POST https://codebase.design/api/v1/builds/{sessionId}/preview` → `previewUrl`. - Hand the result to your human: status and preview responses include `previewUrl` (a browser link that opens the private preview without signing in; its short-lived token expires at `previewExpiresAt`, about 15 minutes, so fetch a fresh one after; the link swaps its token for a cookie and redirects, so a script must keep cookies: `curl -c jar -b jar -L "$PREVIEW_URL"`), `workspaceUrl`, and `sourceUrl` (zip, same key). A completed build's status carries `summary`, a plain-text account of what it made. Status also carries `failure` (`{ code, message, retryable }`) when a build did not succeed. - Request changes: `POST https://codebase.design/api/v1/builds` with the same `projectId` and a new `prompt`. - Cancel: `POST https://codebase.design/api/v1/builds/{sessionId}/cancel`. - Download source: `GET https://codebase.design/api/v1/projects/{projectId}/export` → zip. - Spending: builds spend the owner's credits; the owner can give each key its own credit limit in https://codebase.design/settings/api-keys, and a key that reaches it gets 402 `key-budget-exhausted`. - Building never publishes: deploying (`POST https://codebase.design/api/v1/deploys`) or making a project public or unlisted needs a key with `deploys:write`, which is not granted by default. - Publishing lifecycle (needs `deploys:write`, reads need `deploys:read`): `POST https://codebase.design/api/v1/deploys` with `provider: codebase` answers `202` with `deployId`, `status: building` and a `poll` path while it builds fresh in the background; poll `GET https://codebase.design/api/v1/deploys/codebase/{deployId}` every few seconds until `status` is `ready` (with the public `url`) or `error` (with `code` and `message`); `GET https://codebase.design/api/v1/projects/{projectId}/deploys` lists publishes with the live one marked; `POST https://codebase.design/api/v1/deploys/{deployId}/rollback` restores an earlier one; `DELETE https://codebase.design/api/v1/projects/{projectId}/site` takes the site down and keeps the versions. - MCP: hosted endpoint at `https://codebase.design/api/mcp` (Streamable HTTP); send `Authorization: Bearer ` with the same API key. Tools call the same API, so scopes and the key's credit limit apply. claude.ai and ChatGPT connectors need no key: add `https://codebase.design/api/mcp` as a custom connector and sign in; OAuth (PKCE, dynamic client registration) grants `projects:read`, `builds:read` and `builds:write` under a credit limit the owner picks, revocable in Settings → API keys. ## Core docs - [AI Website Builder](https://codebase.design/ai-website-builder): build a website from a description and own the source. - [AI App Builder](https://codebase.design/ai-app-builder): full app workflow — web, mobile, API, and deploy. - [Pricing](https://codebase.design/pricing): plans, credits, and FAQ. - [Referrals](https://codebase.design/referrals): builder referral program and attribution-preserving signup path. ## Build surfaces - [Templates](https://codebase.design/templates): production-ready starter apps. - [Gallery](https://codebase.design/gallery): community-built apps. - [Frameworks](https://codebase.design/frameworks): starting scaffolds for new apps. - [Skills](https://codebase.design/skills): agent instruction sets for build workflows. - [Downloads](https://codebase.design/downloads): desktop, mobile, and browser clients. - [Changelog](https://codebase.design/changelog): what shipped, what got fixed, and current known limits. ## Featured templates - [SaaS Landing Page](https://codebase.design/templates/saas-landing): Modern landing page with hero, features grid, pricing table, testimonials, and CTA footer. - [Analytics Dashboard](https://codebase.design/templates/analytics-dashboard): Data-driven dashboard with metric cards, charts, filterable data table, and sidebar navigation. - [Kanban Board](https://codebase.design/templates/kanban-board): Interactive drag-and-drop task board with columns, card creation, and priority labels. - [SaaS Starter](https://codebase.design/templates/saas-starter): Full SaaS application shell with auth, dashboard, settings, and billing UI. - [Todo App](https://codebase.design/templates/todo-app): Clean task management app with categories, priorities, due dates, and local persistence. ## Legal - [Terms of Service](https://codebase.design/terms): platform terms. - [Privacy Policy](https://codebase.design/privacy): privacy and data handling. - [Data Processing Addendum](https://codebase.design/dpa): processing terms. - [Security](https://codebase.design/security): vulnerability reporting and responsible disclosure. ## LLM policy Allowed crawlers: GPTBot, ChatGPT-User, Claude-Web, anthropic-ai, PerplexityBot, CCBot. Not crawlable: /workspace, /api, /settings, /admin (private surfaces).