API Reference
BuildFlow exposes a REST API for programmatic access. API access is available on the Business plan and above.
Authentication
All API requests must include your API key in the Authorization header:
Authorization: Bearer bf_live_xxxxxxxxxxxxxxxxxxxx
API keys start with bf_live_ for production and bf_test_ for testing.
Base URL
https://buildflow-ai.app/api
Rate limits
| Endpoint | Limit | Window |
|---|---|---|
| AI Generation | 10 requests | 1 minute |
| All other endpoints | 60 requests | 1 minute |
| Contact form | 3 requests | 10 minutes |
Rate limit headers are returned on every response:X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Exceeded limits return HTTP 429 Too Many Requests.
Health
/api/healthCheck service health. No auth required.
Example Response
{
"status": "healthy",
"timestamp": "2025-01-15T10:00:00.000Z",
"responseTime": 42,
"checks": {
"database": { "status": "healthy", "responseTime": 12 },
"redis": { "status": "healthy", "responseTime": 8 }
}
}Projects
/api/projectsList all projects for the authenticated user.
Auth
Bearer token (session cookie or API key)
Example Response
{
"projects": [
{
"id": "clx...",
"name": "My Landing Page",
"createdAt": "2025-01-10T09:00:00.000Z",
"isPublished": false,
"publicSlug": null
}
]
}/api/projectsCreate a new project.
Auth
Bearer token
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
name* | string | Project name (max 100 chars) |
code | string | Initial HTML code |
* required
Example Response
{ "id": "clx...", "name": "My Project", "code": "..." }Generation
/api/generateGenerate HTML from a prompt. Returns a streaming response.
Auth
Bearer token
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
prompt* | string | Plain-English description of the site to generate |
projectId | string | Existing project ID to update (omit to create new) |
mode | "iterate" | "fresh" | iterate = build on existing code; fresh = start over (default: iterate) |
* required
Example Response
// Streaming text/event-stream // Each chunk is a fragment of the generated HTML data: <!DOCTYPE html> data: <html lang="en"> ... data: [DONE]
Publishing
/api/publishPublish a project to a public BuildFlow URL.
Auth
Bearer token
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
projectId* | string | Project to publish |
slug | string | Custom URL slug (auto-generated if omitted) |
* required
Example Response
{
"url": "https://buildflow-ai.app/p/my-site",
"slug": "my-site"
}Error responses
All errors return JSON with an error field:
// HTTP 400
{ "error": "Validation failed", "details": { "prompt": ["Required"] } }
// HTTP 401
{ "error": "Unauthorized" }
// HTTP 403
{ "error": "CSRF check failed: unexpected origin" }
// HTTP 429
{ "error": "Too many requests", "resetIn": 42 }
// HTTP 500
{ "error": "Internal server error" }Need API support?
API access is currently in early access for Business plan subscribers.Contact us for integration support or to discuss custom rate limits.
Upgrade to Business →