API Reference

BuildFlow exposes a REST API for programmatic access. API access is available on the Business plan and above.

Business plan required. API keys are available at Account Settings → API. Upgrade →

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

EndpointLimitWindow
AI Generation10 requests1 minute
All other endpoints60 requests1 minute
Contact form3 requests10 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

GET
/api/health

Check 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

GET
/api/projects

List 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
    }
  ]
}
POST
/api/projects

Create a new project.

Auth

Bearer token

Request Body (JSON)

FieldTypeDescription
name*stringProject name (max 100 chars)
codestringInitial HTML code

* required

Example Response

{ "id": "clx...", "name": "My Project", "code": "..." }

Generation

POST
/api/generate

Generate HTML from a prompt. Returns a streaming response.

Auth

Bearer token

Request Body (JSON)

FieldTypeDescription
prompt*stringPlain-English description of the site to generate
projectIdstringExisting 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

POST
/api/publish

Publish a project to a public BuildFlow URL.

Auth

Bearer token

Request Body (JSON)

FieldTypeDescription
projectId*stringProject to publish
slugstringCustom 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 →