Introduction
Overview of the LaraCopilot Agent API — generate Laravel applications programmatically
LaraCopilot Agent API
The LaraCopilot Agent API lets external clients generate fully functional Laravel applications programmatically. Send a natural language prompt and receive a live, running app URL — no infrastructure setup required on your end.
This is the same generation engine that powers the LaraCopilot web interface, exposed as a REST API.
Base URL
All Agent API requests use the following base URL:
https://builder.laracopilot.com/api/v1
How it works
- Authenticate — include your API token as a Bearer token in the
Authorizationheader of every request. - Send a prompt — POST your application description to the generate endpoint.
- Receive a live URL — the API provisions a container, generates code, and returns a live app URL via a streaming response.
- Iterate — send follow-up prompts to the same project ID to refine your application.
Response format
The generate endpoints return Server-Sent Events (SSE) streams. Each event is a JSON object prefixed with data:.
data: {"type":"project_created","project_id":"abc123","app_url":"https://abc123.laracopilot.com"}
data: {"type":"container_progress","message":"Installing Laravel...","percentage":40}
data: {"type":"container_ready","message":"Container ready. Starting AI generation..."}
data: {"type":"stream_end","project_id":"abc123","app_url":"https://abc123.laracopilot.com"}The project status endpoint (GET /project/:id) returns standard JSON.
The generation stream may emit the following event types:
| Event Type | Description |
|---|---|
project_created | Sent immediately with project_id and app_url |
container_progress | Container setup progress with percentage and message |
container_ready | Container is ready and AI generation is starting |
file_created | A file has been generated or modified |
tool_progress | AI agent tool execution progress |
stream_end | Generation completed successfully |
credits_exhausted | Team credits ran out during generation |
error | An error occurred while processing the request |
Rate limits
| Endpoint | Limit |
|---|---|
| All Agent API endpoints | 10 requests per minute |
Requests that exceed the rate limit receive a 429 Too Many Requests response.
Credits
Each project generation consumes credits from your team's balance. If credits are exhausted during generation, the stream ends with a credits_exhausted event.
You can check your balance and purchase credits from the Credits section of the LaraCopilot dashboard.
See the authentication guide for token setup and the endpoints page for request and response examples with playground support.