Enterprise API Reference
REST API for enterprise partners to integrate Singularity Layer into their platform.
For the full interactive API reference with request/response schemas, see the Enterprise API Reference in our developer docs.
Authentication
All API requests require an enterprise API key passed via the X-Enterprise-Key header:
curl https://studio.x402layer.cc/api/v1/enterprise \ -H "X-Enterprise-Key: sgl_ent_your_api_key_here"
Generate API keys from your Enterprise Dashboard → API Keys. Keys use the sgl_ent_ prefix. Up to 10 active keys per partner.
Base URL
Endpoints
/api/v1/enterpriseReturns your enterprise partner configuration and pricing.
{
"partner": {
"id": "uuid",
"name": "Your Platform",
"slug": "your-platform",
"endpoint_creation_fee": 2.00,
"min_topup_amount": 1.00,
"initial_credits": 4000,
"credits_per_dollar": 500,
"revenue_share_enterprise": 0.70,
"revenue_share_singularity": 0.15,
"revenue_share_infra": 0.15
}
}/api/v1/enterprise/endpointsReturns all endpoints deployed through your enterprise program. Supports page and limit query params.
{
"endpoints": [{
"id": "uuid",
"slug": "my-agent-api",
"title": "My Agent API",
"chain": "base",
"pricing_model": "credit",
"owner_credits": 3500,
"is_active": true,
"created_at": "2026-05-01T12:00:00Z"
}],
"pagination": { "page": 1, "limit": 50, "total": 12, "pages": 1 }
}/api/v1/enterprise/statsReturns aggregated revenue summary for your enterprise program.
{
"total_revenue": 150.00,
"enterprise_earned": 120.00,
"singularity_earned": 15.00,
"infra_reserved": 15.00,
"pending_payout": 40.00,
"distributed": 20.00,
"transaction_count": 25,
"endpoint_count": 12
}/api/v1/enterprise/transactionsReturns the full revenue ledger. Supports page, limit, and type (endpoint_creation, topup, recharge) query params.
{
"transactions": [{
"id": "uuid",
"payment_type": "endpoint_creation",
"total_amount": 5.00,
"enterprise_amount": 4.00,
"singularity_amount": 0.50,
"infra_amount": 0.50,
"currency": "USDC",
"chain": "base",
"tx_hash": "0x...",
"enterprise_distributed": false,
"created_at": "2026-05-01T12:00:00Z"
}],
"pagination": { "page": 1, "limit": 50, "total": 25, "pages": 1 }
}Worker API (Endpoint Creation)
When agents on your platform deploy endpoints, pass the enterprise API key via the X-Enterprise-Key header instead of the ?partner=slug query parameter:
curl -X POST https://worker.x402layer.cc/agent/endpoints \
-H "X-Enterprise-Key: sgl_ent_your_key_here" \
-H "X-Payment: <x402-payment-payload>" \
-H "Content-Type: application/json" \
-d '{"title": "My API", "url": "https://...", "chain": "base"}'The x402 payment flow is unchanged — agents still pay the deployment fee via the X-Payment header. The enterprise key provides authenticated partner identification.
MCP Server
For agent-native integration, agents can connect to the Singularity MCP server and pass your enterprise slug:
MCP Endpoint: https://mcp.x402layer.cc/mcp
// In tool calls:
{ "enterprise_partner_slug": "your-slug" }Code Examples
Quick integration examples in TypeScript and Python.
TypeScript — List Endpoints
const API_KEY = process.env.ENTERPRISE_API_KEY;
const BASE = "https://studio.x402layer.cc/api/v1/enterprise";
const res = await fetch(`${BASE}/endpoints?page=1&limit=50`, {
headers: { "X-Enterprise-Key": API_KEY },
});
const { endpoints, pagination } = await res.json();
for (const ep of endpoints) {
console.log(ep.slug, ep.owner_credits, ep.is_active ? "active" : "paused");
}Python — Query Revenue Stats
import os, requests
API_KEY = os.environ["ENTERPRISE_API_KEY"]
BASE = "https://studio.x402layer.cc/api/v1/enterprise"
stats = requests.get(
f"{BASE}/stats",
headers={"X-Enterprise-Key": API_KEY},
).json()
print(f"Total revenue: ${stats['total_revenue']:.2f}")
print(f"Your earnings: ${stats['enterprise_earned']:.2f}")
print(f"Pending payout: ${stats['pending_payout']:.2f}")TypeScript — Verify Webhook Signature
import { createHmac } from "crypto";
function verifyWebhook(rawBody: string, headers: Record<string, string>, secret: string): boolean {
const signature = headers["x-x402-signature"];
const timestamp = headers["x-x402-timestamp"];
if (!signature || !timestamp) return false;
const expected = createHmac("sha256", secret)
.update(timestamp + "." + rawBody)
.digest("hex");
return signature === expected;
}
// In your webhook handler:
app.post("/webhooks/singularity", (req, res) => {
if (!verifyWebhook(req.rawBody, req.headers, process.env.WEBHOOK_SECRET)) {
return res.status(401).send("Invalid signature");
}
const event = JSON.parse(req.rawBody);
console.log(event.event, event.source_slug, event.amount);
res.status(200).send("ok");
});Error Responses
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Insufficient scope |
| 404 | Resource not found |
| 500 | Server error |