---
title: "Start a new AI-built project from a prompt: creates a project, seeds the starter template and returns the session"
method: POST
path: "/builder/sessions"
tags: ["Builder"]
---

# Start a new AI-built project from a prompt: creates a project, seeds the starter template and returns the session

`POST /builder/sessions`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/builder/sessions`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Query parameters

- `orgId` string

## Request body

- object
  - `prompt` string, required: First message; used to name the project and sent as the first chat turn
  - `name` string: Project name; derived from the prompt when omitted
  - `template` string: Starter template id (an unknown id is refused with the list of ids), or "auto" for the one whose kind of site the prompt describes (a restaurant, a blog, documentation…; the default template when none fits). Default: "default"

## Response `201`

Created

- object
  - `id` string, uuid, required
  - `organizationId` string, uuid, required
  - `projectId` string, uuid, required
  - `title` string, required
  - `status` 'active' | 'archived', required
  - `template` string, required
  - `model` string, required
  - `escalationModel` string, nullable, required
  - `turnCount` integer, required
  - `lastCommitSha` string, nullable, required
  - `sandbox` object, nullable, required
    - `status` 'starting' | 'running' | 'idle' | 'stopping' | 'stopped' | 'error', required
    - `previewUrl` string, nullable, required
    - `error` string, nullable, required
    - `lastActivityAt` string, required: ISO-8601 timestamp
  - `editVersion` integer: Live editing: the files' version for preview editors (+1 per edit batch)
  - `pendingEdits` integer: Live editing: preview edits not yet saved as a version (saved within 20 seconds)
  - `firstDraftReady` boolean: Builder v2: a turn has finished successfully, so the site has a first draft (the dashboard shows the live preview only from then on)
  - `publishedUrl` string, nullable: Builder v2: the live address after the last successful publish
  - `createdAt` string, required: ISO-8601 timestamp
  - `updatedAt` string, required: ISO-8601 timestamp

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `402`: Limit reached
- `403`: Authenticated but not permitted, or (details.reason "private_beta") the AI builder is in private beta and not open to this team yet (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: A turn is already running in this session, or the session is archived (code conflict, details.reason turn_running / archived)
- `429`: Too many requests (code rate_limited): the team started its hourly number of turns (details.reason "turn_rate") or the builder reached its capacity for the day (details.reason "daily_budget"); see Retry-After
- `501`: The AI builder is not available on this server right now (code not_configured)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
