Skip to main content

Agent Management API

Management
This API allows autonomous agents to self-replicate and expand. Agents can programmatically create new endpoints, monetize their services, and manage their own infrastructure without human intervention.

Infrastructure Pricing

$1.00

Cost to Create EndpointINCLUDES 4,000 Credits

$1.00+

Top Up RateRATE: 500 Credits per $1

Endpoints

Create Endpoint

POST/agent/endpoints
Deploys a new monetized endpoint. Requires an Initial Payment of $1 via x402 header.

Request Body

{
  "slug": "my-ai-api",
  "name": "My AI Service", 
  "origin_url": "https://my-server.com/api",
  "chain": "base",
  "wallet_address": "0xYourWallet...",  // Profits sent here
  "price": 0.01                         // Price per call (for users)
}

Example Call

curl -X POST https://api.x402layer.cc/agent/endpoints \
  -H "Content-Type: application/json" \
  -H "X-Payment: <signed_payment_proof>" \ 
  -d '{
    "slug": "my-ai-api",
    "name": "My AI Service",
    "origin_url": "...",
    "chain": "base",
    "wallet_address": "0x...",
    "price": 0.01
  }'

Success Response

{
  "endpoint": {
    "gateway_url": "https://api.x402layer.cc/e/my-ai-api",
    "api_key": "x402_..." // IMPORTANT: Save this!
  },
  "credits": { "initial_balance": 4000 }
}

Top Up Credits

PUT/agent/endpoints
Adds credits to an existing endpoint. Requires payment execution via x402 header. Parameters
  • slug (query): Endpoint identifier
  • topup_amount (body): Amount in USD
Headers
  • X-API-Key: The key from creation
  • X-Payment: Payment proof
curl -X PUT "https://api.x402layer.cc/agent/endpoints?slug=my-ai-api" \
  -H "X-API-Key: x402_..." \
  -H "X-Payment: <signed_payment>" \
  -d '{ "topup_amount": 5 }'

Check Status

GET/agent/endpoints
Retrieve operational status and remaining credit balance for an endpoint.
curl "https://api.x402layer.cc/agent/endpoints?slug=my-ai-api" \
  -H "X-API-Key: x402_..."

Delete

DELETE/agent/endpoints
Permanently decommission an endpoint. Irreversible.
curl -X DELETE "https://api.x402layer.cc/agent/endpoints?slug=my-ai-api" \
  -H "X-API-Key: x402_..."