API reference
WalletKit REST API
All endpoints use https://api.alloy.build as the base URL (or https://sandbox.api.alloy.build for sandbox).
OpenAPI JSON
Generated Swagger artifact for API clients and tools.
OpenAPI YAML
Human-readable API contract source.
Version matrix
Trace SDK, OpenAPI, and contract versions.
Rendered Mesh contract explorer
Browse the current proto-derived Mesh routes, required metadata headers, request fields, response fields, and HSM signing examples without loading a separate Swagger viewer.
Open Mesh contract explorerAuthentication
All requests require a Bearer token. Use API keys for server integrations and agent tokens for AI agents.
Authorization: Bearer <your-api-key-or-agent-token> Providers
/v1/providers/connect /v1/providers /v1/providers/:id /v1/providers/:id Wallets
/v1/wallets /v1/wallets /v1/wallets/:id /v1/wallets/:id /v1/wallets/:id/archive Transaction Intents
/v1/wallets/:id/transaction-intents /v1/wallets/:id/transaction-intents /v1/wallets/:id/transaction-intents/:txId /v1/wallets/:id/transaction-intents/:txId/approve /v1/wallets/:id/transaction-intents/:txId/reject Policies
/v1/policies /v1/policies /v1/policies/:id /v1/policies/:id/evaluate /v1/policies/:id/decisions Events & Webhooks
/v1/events /v1/events/:id /v1/webhooks /v1/webhooks /v1/webhooks/:id Agent Tokens
/v1/agent-tokens /v1/agent-tokens /v1/agent-tokens/:id Error codes
All errors return a structured JSON body with error, code, and message fields, plus optional details for validation errors.
{
"error": "policy_rejected",
"code": 422,
"message": "Transaction exceeds daily limit of 50,000 USDC",
"details": {
"policy_id": "pol_daily_limit",
"evaluated_amount": "75000.00",
"limit": "50000.00",
"suggestion": "Split into multiple transactions or request limit increase"
}
} | Status | Code | Description |
|---|---|---|
| 400 | bad_request | Malformed request body or invalid parameters |
| 401 | unauthorized | Missing or invalid API key / agent token |
| 403 | forbidden | Token lacks required scope for this action |
| 404 | not_found | Resource does not exist |
| 409 | conflict | Idempotency key collision or state conflict |
| 422 | policy_rejected | Transaction rejected by policy evaluation |
| 429 | rate_limited | Too many requests — see rate limits below |
| 500 | internal_error | Unexpected server error — retry with backoff |
Rate limits
| Tier | Read | Write |
|---|---|---|
| Sandbox | 100 req/min | 20 req/min |
| Starter | 1,000 req/min | 200 req/min |
| Enterprise | Custom | Custom |
Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Webhooks
Alloy sends normalized webhook events for transaction state changes, policy decisions, risk alerts, and reconciliation updates — regardless of the underlying provider.
Event types
transaction.created Intent submitted transaction.approved Policy + risk passed transaction.confirmed On-chain confirmation transaction.failed Provider or chain failure policy.violation Policy rule violated risk.alert Risk threshold exceeded Signature verification
import crypto from 'crypto';
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}