Skip to main content

Base URL

All endpoints are relative to the application origin. There is no separate API host.
/api

Type safety

The API is built with Elysia.js, which provides end-to-end type safety between the server and any TypeScript client. The included api-client.ts uses the Eden treaty client to consume the API with full type inference.

Request format

Send request bodies as JSON and set the Content-Type: application/json header.

Response format

All endpoints return JSON. Successful responses return the created or updated resource directly, or an array of resources for list endpoints.

Authentication

All endpoints require an active Clerk session. See the Authentication page for details.

HTTP status codes

StatusMeaning
200OK — request succeeded
401Unauthorized — no valid session
403Forbidden — Pro subscription required
404Not Found — resource does not exist
500Internal Server Error — unexpected failure

Explore the API

Authentication

How Clerk sessions protect every endpoint, and what Pro feature flags control access.

Projects

Create a new AI-generated project or list your existing projects.

Messages

Send follow-up prompts and retrieve the conversation history for a project.

Code Fragments

Directly update files inside a live sandbox (Pro).

Build docs developers (and LLMs) love