LaraCopilot
LaraCopilot
Integrations

API Tokens

Generate API tokens to use the LaraCopilot Agent API programmatically

API Tokens

API tokens let you authenticate with the LaraCopilot Agent API to generate projects programmatically — from your own tools, scripts, or CI pipelines.

Only team owners can create, view, and revoke API tokens. Tokens are scoped to the team — API usage deducts from that team's credit balance.


Generating a token

  1. Go to Settings → API Tokens in the sidebar
  2. Enter a name for the token (e.g. "Production", "CI Pipeline", "Staging")
  3. Choose an expiration period:
    • 30 days
    • 60 days
    • 90 days
    • No expiration
  4. Click Generate Token
  5. Copy the token from the modal that appears — it will only be shown once

Store your API token in a secrets manager or environment variable. Never commit it to version control or share it publicly. If a token is compromised, revoke it immediately and generate a new one.


Viewing your token

The API Tokens page shows your active token's:

  • Name
  • Masked value (only the last 4 characters are visible after generation)
  • Created date
  • Expiration date (or "Never")
  • Status — Active (green) or Expired (red)

Revoking a token

  1. On the API Tokens page, click Revoke Token
  2. Confirm by clicking Yes

Revocation is immediate. Any request using the revoked token receives a 401 Unauthorized response.


Using your token

Include the token as a Bearer token in the Authorization header of every API request:

curl -X POST https://builder.laracopilot.com/api/v1/agent/generate \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{"prompt": "Build a task management app"}'

See the full API Reference for all available endpoints, request parameters, and response formats.


Token expiration

Expired tokens return:

{
  "status": false,
  "message": "API token has expired."
}

Generate a new token to regain API access.

On this page