Overview
The/validate endpoint checks whether an AGENTS.md file’s content conforms to the expected schema and format. It performs structural validation and can optionally verify endpoint reachability when using the beacon-ai-cloud provider.
Endpoint
Rate Limiting
This endpoint is rate-limited to 20 requests per minute per IP address.Authentication
No direct authentication is required for basic validation. When using thebeacon-ai-cloud provider for enhanced validation with endpoint checking, payment verification is required (similar to the /generate endpoint).
Request
Request Body
The complete AGENTS.md file content as a string to be validated.
The validation provider to use:
"none"- Basic schema validation (default)"beacon-ai-cloud"- Enhanced validation with AI-powered checks (requires payment)
Example Request
Example Request with Payment (beacon-ai-cloud)
Response
Success Response (200 OK)
Always
true for successful validation requests (even if the content is invalid).Whether the AGENTS.md content is valid according to the schema.
Array of error messages describing validation failures. Empty if no errors found.Each item is a string describing a specific validation error.
Array of warning messages for non-critical issues. Empty if no warnings.Each item is a string describing a potential improvement or minor issue.
Array of endpoint reachability check results (only populated when endpoints are checked).Each object contains:
endpoint(string): The endpoint path that was checkedreachable(boolean): Whether the endpoint responded successfullystatus_code(number): HTTP status code received (if reachable)error(string): Error message if the endpoint check failed
Example Valid Response
Example Invalid Response
Example with Endpoint Checks
Error Responses
402 Payment Required
Returned when usingbeacon-ai-cloud provider without valid payment.
x-payment-run-id: Unique run identifier for this validation requestx-payment-amount: Amount required in USDC (e.g., “0.09”)x-payment-currency: Always “USDC”x-payment-address-base: Base blockchain wallet addressx-payment-address-solana: Solana blockchain wallet address
409 Conflict
Returned when a transaction hash has already been used.429 Too Many Requests
Returned when rate limit is exceeded (>20 requests/minute).500 Internal Server Error
Returned when validation fails unexpectedly.Validation Checks
The validator performs several types of checks:Schema Validation
- Required sections: Ensures all mandatory sections are present (name, description, capabilities/endpoints)
- Field types: Verifies that fields have the correct data types
- Required fields: Checks that required fields within capabilities and endpoints are not missing
- Schema structure: Validates input/output schemas are valid JSON
Content Validation
- Frontmatter: Checks for proper markdown frontmatter if present
- Examples: Validates that examples are well-formed
- Parameters: Ensures endpoint parameters have required fields
Endpoint Checks (Optional)
When endpoint checking is enabled (via CLI--check-endpoints flag or when using certain validation providers):
- Reachability: Makes HTTP requests to verify endpoints are accessible
- Response codes: Records HTTP status codes returned
- Timeout handling: Reports timeouts and connection errors
Payment Flow (beacon-ai-cloud)
The payment flow forbeacon-ai-cloud validation is identical to the /generate endpoint:
- Initial request without payment headers returns 402 with payment details
- Submit payment to Base or Solana wallet address
- Retry request with payment verification headers:
x-payment-txn-hash: Your transaction hashx-payment-chain:"base"or"solana"x-payment-run-id: Run ID from initial response
Implementation Details
The endpoint (defined insrc/main.rs:299-370):
- Handles payment verification for
beacon-ai-cloudprovider - Calls
validator::validate_content()to perform schema and structural validation - Returns detailed validation results including errors, warnings, and endpoint check results
Use Cases
- Pre-commit validation: Validate AGENTS.md files before committing to version control
- CI/CD integration: Add validation checks to your continuous integration pipeline
- Quality assurance: Ensure generated AGENTS.md files meet quality standards
- Endpoint monitoring: Verify that declared endpoints are actually reachable
- Schema compliance: Confirm that documentation follows the AGENTS.md specification