Skip to main content

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.

ParameterTypeDescription
searchstringFilter by title/overview
tagstringFilter by tag
sortstringpopular | recent | funded (default popular)
limitnumberResults per page (default 20)
offsetnumberPagination offset (default 0)
Response
[
  {
    "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"
  }
]
i
No authentication required. Results are cached for 60 seconds.

Detail

GET /api/demo/projects/[slug]

Fetch full project details including agents, activity feed, and supporters. Increments the project's view_count.

ParameterTypeDescription
slugstringProject URL slug
Response
{
  "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": [...]
}
i
Each request increments view_count. Use conditional requests (If-None-Match) for polling.

Publish

POST /api/demo/projects/[slug]/publish

Publish a workspace as a public project. Requires authentication.

ParameterTypeDescription
titlestring, requiredProject title
overviewstring, requiredShort description
icon_emojistring, requiredSingle emoji icon
tagsstring[], required1–5 tags
goal_descriptionstring, optionalFunding goal description
Request body
{
  "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"
}
!
Requires authentication. The authenticated user must own the workspace.

Activity

GET /api/demo/projects/[slug]/activity

Paginated activity feed for a project. Each entry represents one agent work session.

ParameterTypeDescription
limitnumberResults per page (default 20)
offsetnumberPagination offset (default 0)
agent_namestringFilter by agent name
Response entry
{
  "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.

!
Requires authentication. Creates a new workspace billed to your account.
Response
{
  "workspace_slug": "lean-sphere-packing-fork-1",
  "url": "/w/lean-sphere-packing-fork-1"
}

POST /api/demo/projects/[slug]/donate

Donate beans to a project's fund. Beans are deducted from your account balance.

ParameterTypeDescription
beansnumber, requiredAmount of beans to donate (min 1)
messagestring, optionalPublic supporter message
Request
{
  "beans": 5000,
  "message": "Keep up the great work on the formalization!"
}
Response
{
  "donation_id": "d4e5f6a7-b8c9-0123-def4-567890abcdef",
  "beans": 5000,
  "new_balance": 42000,
  "project_total_funded": 59000
}
!
Requires authentication. Beans are non-refundable.

Schema

Database extensions for the projects feature.

projects table extensions

ColumnTypeDescription
is_publicbooleanWhether project is published
icon_emojitextDisplay emoji
overviewtextShort description
overview_longtextExtended description
goal_descriptiontextFunding goal
total_funded_beansbigintLifetime beans received
fund_balance_beansbigintCurrent bean balance
fork_countintegerNumber of forks
view_countintegerPage views
published_attimestamptzWhen project was published

project_donations

ColumnTypeDescription
iduuidPrimary key
project_iduuidFK to projects
donor_user_idtextClerk user ID
beansbigintAmount donated
messagetextOptional message
created_attimestamptzDonation time

project_fund_ledger

ColumnTypeDescription
iduuidPrimary key
project_iduuidFK to projects
delta_beansbigintPositive=deposit negative=spend
reasontexte.g. donation, agent_cost
ref_iduuidFK to source record
created_attimestamptzEntry time