LaraCopilot
LaraCopilot
API Reference

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

  1. Authenticate — include your API token as a Bearer token in the Authorization header of every request.
  2. Send a prompt — POST your application description to the generate endpoint.
  3. Receive a live URL — the API provisions a container, generates code, and returns a live app URL via a streaming response.
  4. 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 TypeDescription
project_createdSent immediately with project_id and app_url
container_progressContainer setup progress with percentage and message
container_readyContainer is ready and AI generation is starting
file_createdA file has been generated or modified
tool_progressAI agent tool execution progress
stream_endGeneration completed successfully
credits_exhaustedTeam credits ran out during generation
errorAn error occurred while processing the request

Rate limits

EndpointLimit
All Agent API endpoints10 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.

On this page