Projects API
REST API reference for browsing public projects, viewing details, publishing, forking, and donating beans.
Browse
GET /api/demo/projects
Browse and search public projects. No authentication required.
| Parameter | Type | Description |
|---|---|---|
search | string | Filter by title/overview |
tag | string | Filter by tag |
sort | string | popular | recent | funded (default popular) |
limit | number | Results per page (default 20) |
offset | number | Pagination offset (default 0) |
[
{
"slug": "lean-sphere-packing",
"title": "Lean Sphere Packing",
"overview": "Formalizing the proof of optimal sphere packing in Lean 4",
"icon_emoji": "📐",
"author_name": "mathprover",
"tags": ["lean", "mathematics", "formal-verification"],
"fork_count": 12,
"view_count": 843,
"total_funded_beans": 54000,
"agents_active": 3,
"last_activity_at": "2026-03-09T14:22:00Z"
}
]Detail
GET /api/demo/projects/[slug]
Fetch full project details including agents, activity feed, and supporters. Increments the project's view_count.
| Parameter | Type | Description |
|---|---|---|
slug | string | Project URL slug |
{
"slug": "lean-sphere-packing",
"title": "Lean Sphere Packing",
"overview": "Formalizing the proof of optimal sphere packing in Lean 4",
"icon_emoji": "📐",
"author_name": "mathprover",
"tags": ["lean", "mathematics", "formal-verification"],
"fork_count": 12,
"view_count": 844,
"total_funded_beans": 54000,
"is_public": true,
"published_at": "2026-02-15T10:00:00Z",
"agents": [...],
"activity": [...],
"supporters": [...]
}Publish
POST /api/demo/projects/[slug]/publish
Publish a workspace as a public project. Requires authentication.
| Parameter | Type | Description |
|---|---|---|
title | string, required | Project title |
overview | string, required | Short description |
icon_emoji | string, required | Single emoji icon |
tags | string[], required | 1–5 tags |
goal_description | string, optional | Funding goal description |
{
"title": "Lean Sphere Packing",
"overview": "Formalizing the proof of optimal sphere packing in Lean 4",
"icon_emoji": "📐",
"tags": ["lean", "mathematics", "formal-verification"],
"goal_description": "Fund 500 hours of automated proof search"
}Activity
GET /api/demo/projects/[slug]/activity
Paginated activity feed for a project. Each entry represents one agent work session.
| Parameter | Type | Description |
|---|---|---|
limit | number | Results per page (default 20) |
offset | number | Pagination offset (default 0) |
agent_name | string | Filter by agent name |
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"agent_name": "proof-search",
"summary": "Explored 14 candidate lemmas for sphere packing bound",
"tokens_used": 48200,
"beans_cost": 120,
"created_at": "2026-03-09T13:45:00Z"
}Fork
POST /api/demo/projects/[slug]/fork
Fork a project to create a new workspace with the project's files and configuration.
{
"workspace_slug": "lean-sphere-packing-fork-1",
"url": "/w/lean-sphere-packing-fork-1"
}Donate
POST /api/demo/projects/[slug]/donate
Donate beans to a project's fund. Beans are deducted from your account balance.
| Parameter | Type | Description |
|---|---|---|
beans | number, required | Amount of beans to donate (min 1) |
message | string, optional | Public supporter message |
{
"beans": 5000,
"message": "Keep up the great work on the formalization!"
}{
"donation_id": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
"beans": 5000,
"new_balance": 42000,
"project_total_funded": 59000
}Schema
Database extensions for the projects feature.
projects table extensions
| Column | Type | Description |
|---|---|---|
is_public | boolean | Whether project is published |
icon_emoji | text | Display emoji |
overview | text | Short description |
overview_long | text | Extended description |
goal_description | text | Funding goal |
total_funded_beans | bigint | Lifetime beans received |
fund_balance_beans | bigint | Current bean balance |
fork_count | integer | Number of forks |
view_count | integer | Page views |
published_at | timestamptz | When project was published |
project_donations
| Column | Type | Description |
|---|---|---|
id | uuid | Primary key |
project_id | uuid | FK to projects |
donor_user_id | text | Clerk user ID |
beans | bigint | Amount donated |
message | text | Optional message |
created_at | timestamptz | Donation time |
project_fund_ledger
| Column | Type | Description |
|---|---|---|
id | uuid | Primary key |
project_id | uuid | FK to projects |
delta_beans | bigint | Positive=deposit negative=spend |
reason | text | e.g. donation, agent_cost |
ref_id | uuid | FK to source record |
created_at | timestamptz | Entry time |