LaraCopilot
LaraCopilot
Api reference

Endpoints

Complete reference for every public LaraCopilot Agent API endpoint, with request parameters, response formats, and an interactive playground.

Complete reference for all public LaraCopilot Agent API endpoints. All endpoints require bearer token authentication.

Generate Project

Creates a new Laravel project, provisions a container, runs AI code generation, and returns a live app URL. The response is an SSE stream.

POST
/agent/generate
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://builder.laracopilot.com/api/v1/agent/generate" \  -H "Content-Type: application/json" \  -d '{    "prompt": "stringstri"  }'
{}
{
  "message": "string",
  "errors": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  }
}

Follow-up Prompt

Continue iterating on an existing project. The AI agent has context from previous conversations and can modify existing files.

Follow-up requests skip container creation because the project already exists, so the stream starts directly with AI-generation events.

POST
/agent/generate/{projectId}
AuthorizationBearer <token>

In: header

Path Parameters

projectId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://builder.laracopilot.com/api/v1/agent/generate/string" \  -H "Content-Type: application/json" \  -d '{    "prompt": "stringstri"  }'
{}
{
  "message": "string",
  "errors": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  }
}

Get Project Status

Returns the current status and live URL of a project. This endpoint returns standard JSON rather than SSE and is safe to poll.

GET
/agent/project/{projectId}
AuthorizationBearer <token>

In: header

Path Parameters

projectId*string

Response Body

application/json

application/json

curl -X GET "https://builder.laracopilot.com/api/v1/agent/project/string"
{
  "status": true,
  "project_id": "string",
  "app_url": "string",
  "project_status": "string",
  "name": "string"
}
{
  "status": true,
  "message": "Project not found."
}

Error Responses

All public Agent API error responses follow the same JSON structure:

{
  "status": false,
  "message": "Human-readable error description."
}

Common examples:

400 Bad Request

{
  "status": false,
  "message": "Not enough credits. Please purchase more credits to continue."
}

401 Unauthorized

{
  "status": false,
  "message": "Unauthorized."
}

403 Forbidden

{
  "status": false,
  "message": "Project does not belong to the specified team."
}

404 Not Found

{
  "status": false,
  "message": "Project not found."
}

422 Validation Error

{
  "status": false,
  "message": "The prompt must be at least 10 characters.",
  "errors": {
    "prompt": ["The prompt must be at least 10 characters."]
  }
}

On this page