Introduction
The Beacon REST API provides programmatic access to Beacon’s core functionality for generating and validating AGENTS.md files. The API allows you to integrate Beacon’s repository analysis and agent capability inference into your own workflows, services, and automation pipelines.API vs CLI
When to Use the API
The REST API is ideal when you need to:- Integrate Beacon into existing web services or applications
- Build automation pipelines that generate AGENTS.md files on demand
- Create custom user interfaces or dashboards
- Process multiple repositories programmatically
- Integrate with CI/CD systems via HTTP requests
When to Use the CLI
The CLI is better suited for:- Local development and testing
- One-off repository analysis
- Manual validation of AGENTS.md files
- Simple scripts and shell automation
- Quick prototyping and experimentation
Base URL
When running the Beacon server locally:Response Format
All API responses are returned in JSON format with a consistent structure:Success Response
Error Response
Rate Limits
The Beacon API implements rate limiting to ensure fair usage and system stability:Rate Limit: 20 requests per minute per IP address
POST /generatePOST /validate
GET /health
Error Codes
The Beacon API uses standard HTTP status codes:| Status Code | Meaning | Description |
|---|---|---|
200 | OK | Request succeeded |
400 | Bad Request | Invalid request body or parameters |
402 | Payment Required | Payment needed for Beacon Cloud |
409 | Conflict | Transaction hash already used |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error occurred |
Common Error Scenarios
400 Bad Request
400 Bad Request
The request body is malformed or missing required fields.
402 Payment Required
402 Payment Required
Using Beacon Cloud requires payment. See the authentication documentation for payment headers.Response includes payment details in headers:
x-payment-run-idx-payment-amountx-payment-currencyx-payment-address-basex-payment-address-solana
429 Too Many Requests
429 Too Many Requests
You’ve exceeded the rate limit of 20 requests per minute.Wait 60 seconds before retrying or implement exponential backoff in your client.
500 Internal Server Error
500 Internal Server Error
An error occurred during inference or file generation.
Getting Started
Here’s a quick example to get you started with the Beacon API:Next Steps
Authentication
Learn about AI provider keys and Beacon Cloud payment
Generate Endpoint
Generate AGENTS.md files programmatically
Validate Endpoint
Validate AGENTS.md file content
Health Check
Monitor server health and status