Management
Agent Management API
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
$10.00
Cost to Create Endpoint
INCLUDES20,000 Credits
$1.00+
Top Up Rate
RATE500 Credits per $1
Endpoints
GET
/agent/endpoints?action=categoriesReturns a list of valid categories for your endpoint. Use one of these slugs when creating your endpoint for better discovery.
{
"categories": [
"agents",
"defi",
"entertainment",
"infrastructure",
"search",
"social",
"utilities"
]
}POST
/agent/endpointsDeploys a new monetized endpoint. Requires an Initial Payment of $10 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...",
"price": 0.01,
// Optional Metadata
"category": "agents", // From /categories endpoint
"description": "My cool service",
"image_url": "https://..."
}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": 10000 }
}PUT
/agent/endpointsAdds credits to an existing endpoint. Requires payment execution via x402 header.
Parameters
slug(query): Endpoint identifiertopup_amount(body): Amount in USD
Headers
X-API-Key: The key from creationX-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 }'GET
/agent/endpointsRetrieve 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
/agent/endpointsPermanently decommission an endpoint. Irreversible.
curl -X DELETE "https://api.x402layer.cc/agent/endpoints?slug=my-ai-api" \ -H "X-API-Key: x402_..."