Reference

API Reference

Base URL: https://api.agentlayer.dev

Authentication

All API requests require a Bearer token. Get your API key from the dashboard.

Authorization: Bearer al_dev_xxxxxxxxxxxxxxxxxxxx

Agent clients authenticate with per-agent API keys, which you manage via the Agents endpoint.

Rate Limiting

Starter: 10 req/s. Pro: 100 req/s. Business: 1,000 req/s. Enterprise: custom. Rate limit headers included in every response. 429 responses include Retry-After.

Endpoints

POST
/v1/apis

Create a new API definition from an OpenAPI spec or JSON config.

GET
/v1/apis

List all your published APIs with status, call counts, and revenue.

GET
/v1/apis/{apiId}

Get detailed information about a specific API, including agent discoverability.

PUT
/v1/apis/{apiId}/pricing

Update pricing configuration: free tier, per-call rate, subscription tiers.

POST
/v1/apis/{apiId}/publish

Publish API to MCP Marketplace, GPT Store, and agent directories.

GET
/v1/apis/{apiId}/analytics

Get usage analytics: calls, latency, revenue, agent sources, errors.

GET
/v1/apis/{apiId}/agents

List all agents subscribed to your API with usage per agent.

POST
/v1/webhooks

Register webhook endpoints for real-time call notifications and alerts.

GET
/v1/billing

Get current billing summary: revenue, fees, pending payouts.

POST
/v1/billing/payout

Request manual payout. Auto-payouts processed monthly on Pro+ plans.

MCP (Model Context Protocol) Integration

Every API is automatically exposed as an MCP server. Agents connect via:

{
  "mcpServers": {
    "your-api": {
      "command": "npx",
      "args": ["@agentlayer/mcp", "--api-id", "your-api-id", "--key", "$AGENT_KEY"]
    }
  }
}

Want to test endpoints? Sign up for a free account to get an API key.

Get Free API Key