# Totalum App Builder API

> Create real apps from a prompt, programmatically.

The **Totalum App Builder API** turns a prompt into a working, hosted, full-stack app, and lets you keep changing it. You send a prompt; Totalum's AI agent writes a real Next.js app with its own database, sign-in, file storage, AI and payments built in; Totalum hosts it, gives it a preview and publishes it when you say so. Use it to put an app builder inside your product, to let an AI agent ship apps, or to run your own white-label builder.

<div class="doc-facts"><div class="doc-fact"><div class="doc-fact-k">Base URL</div><div class="doc-fact-v"><code>https://builder-api.totalum.app/api/v1/vcaas</code></div></div><div class="doc-fact"><div class="doc-fact-k">Auth</div><div class="doc-fact-v"><code>api-key: tlm_sk_…</code> header</div></div><div class="doc-fact"><div class="doc-fact-k">Format</div><div class="doc-fact-v">JSON · <code>{ errors, data }</code></div></div></div>

:::note Projects created before 8 October 2026
Projects created before 8 October 2026, or without the v2 engine, are **legacy projects**: they keep working, but some endpoints and features on this page do not apply to them. See [Legacy projects: what differs](https://www.totalum.app/docs/api/migration-v2).
:::

## Get your API key

1. Open **API** in your [Totalum account](https://platform.totalum.app/api). A key is created for you; reveal and copy it (`tlm_sk_…`). You can create more keys and restrict a key to some projects.
2. Send it in the `api-key` header of every request: **from your server only**, never from browser or mobile code.
3. Keep a credit balance: actions that spend need at least 1 credit. The API works on every plan, including the free one.

```bash
curl -H "api-key: tlm_sk_your_key" https://builder-api.totalum.app/api/v1/vcaas/account
```

The older host `https://api-accounts.totalum.app` answers the same paths, so existing integrations keep working.

## The development cycle

```text
launch ─▶ prompt ─▶ preview ─▶ prompt ─▶ preview … ─▶ publish ─▶ live site
 (dev database, preview URL)                          (live database, your domain)
```

1. **[Launch Project](https://www.totalum.app/docs/api/projects#launch-project)** creates the project and runs the first prompt.
2. Poll **[Get Agent Status](https://www.totalum.app/docs/api/agent#get-agent-status)** (every 10–15 s) until `status` is `"done"`; show [progress](https://www.totalum.app/docs/api/agent#get-agent-progress) meanwhile.
3. Open the **development preview**: `temporalDevelopmentProjectUrl` from [Get Project](https://www.totalum.app/docs/api/projects#get-project). Every prompt that changes code is saved as a [version](https://www.totalum.app/docs/api/versions) and deployed to the preview, on the project's **development database**.
4. Send more prompts with **[Run AI Agent](https://www.totalum.app/docs/api/agent#run-ai-agent)**.
5. **[Publish](https://www.totalum.app/docs/api/deployments#deploy-to-production)** when it is right: the version goes live at `<projectId>.totalum-project.com` (and your [custom domain](https://www.totalum.app/docs/api/domains)), and its database changes are applied to the **live database**. Poll [Get Deployment Status](https://www.totalum.app/docs/api/deployments#get-deployment-status).

Development and production are like two branches: prompts, file edits and restores only ever change **dev**; only a publish changes **live**. A publish that would delete live data asks for confirmation.

## What you can do

| Area | Endpoints |
|---|---|
| Build | [Projects](https://www.totalum.app/docs/api/projects) · [AI Agent](https://www.totalum.app/docs/api/agent) · [Publishing](https://www.totalum.app/docs/api/deployments) · [Versions](https://www.totalum.app/docs/api/versions) · [Project Files](https://www.totalum.app/docs/api/project-files) · [Visual Edits](https://www.totalum.app/docs/api/visual-edit) |
| Data | [Database](https://www.totalum.app/docs/api/database) · [Backups & Restore](https://www.totalum.app/docs/api/database-backups) · [Source Code & Uploads](https://www.totalum.app/docs/api/source-files) · [Export & Import](https://www.totalum.app/docs/api/transfer) |
| Run | [Logs](https://www.totalum.app/docs/api/server) · [Usage & Analytics](https://www.totalum.app/docs/api/analytics) · [Spending & Rate Limits](https://www.totalum.app/docs/api/limits) · [Scheduled Jobs](https://www.totalum.app/docs/api/cron-jobs) · [Secrets, Keys & .env](https://www.totalum.app/docs/api/secrets) |
| Ship | [Custom Domains](https://www.totalum.app/docs/api/domains) · [Buy a Domain](https://www.totalum.app/docs/api/domain-registration) · [Mobile Apps](https://www.totalum.app/docs/api/mobile) · [Payments](https://www.totalum.app/docs/api/payments) |
| Connect | [Webhooks](https://www.totalum.app/docs/api/webhooks) · [GitHub](https://www.totalum.app/docs/api/github) · [Figma](https://www.totalum.app/docs/api/figma) · [Project Groups](https://www.totalum.app/docs/api/project-groups) · [Account](https://www.totalum.app/docs/api/account) |
| Reference | [Errors & Limits](https://www.totalum.app/docs/api/errors) · [OpenAPI 3.1](https://www.totalum.app/openapi.json) · [Docs for AI agents](https://www.totalum.app/docs/ai-agents) · [MCP server](https://www.totalum.app/docs/mcp) |

## What every generated app includes

Each project is a standard **Next.js** app (App Router, React, Tailwind CSS) that runs on **Cloudflare Workers**, with its own SQL database (two of them: development and live), sign-in, file storage and the [Totalum SDK](https://www.totalum.app/docs/sdk) for e-mail, AI (text, images, video, speech), document scanning, web scraping, a cloud browser, PDFs, payments, real-time, scheduled jobs and vector search. Mention what you need in the prompt; no keys to set up. Read [For Developers](https://www.totalum.app/docs/developers) for the stack, and the code is yours: [download it](https://www.totalum.app/docs/api/source-files#download-source-code) or [sync it to GitHub](https://www.totalum.app/docs/api/github) any time.

## Response envelope

```json
{ "errors": null, "data": { "projectId": "barber-bookings" } }
```

On failure `data` is `null` and `errors` is `{ errorCode, errorMessage, errorDetails? }`. Branch on `errorCode`. All codes, limits and retry rules: [Errors & Limits](https://www.totalum.app/docs/api/errors).
