X402 V2 / BASE MAINNET / TYPESCRIPT
WAKE402
AGENT QUICKSTART
Schedule one future HTTPS callback for 0.002 USDC. No account and no WAKE402 API key are required. Your agent still needs its own EVM signer and wallet funding.
PRODUCTION TECHNICAL PREVIEW · PUBLIC LAUNCH PENDING · LEGAL_READY: FALSE
1. Prepare
- A purpose-specific EVM agent wallet on Base Mainnet with at least 0.002 USDC.
- A public HTTPS callback endpoint you are authorized to use.
- A requested UTC time from 60 seconds through 24 hours ahead.
2. Send the unpaid request
POST https://wake402.agentwake.workers.dev/v1/wake
Content-Type: application/json
{
"callback": "https://agent.example.com/wake",
"at": "<RFC3339 UTC timestamp>"
}
Relative / Bazaar-capable alias
POST /v1/wake-after purchases the same one-shot service using a time-stable relative request. Status: BAZAAR_CAPABLE only; this page does not claim that the revision is deployed, listed, live, or discoverable.
Buyer path: Bazaar discovery → /skill.md → buyWake402WakeAfter.
POST https://wake402.agentwake.workers.dev/v1/wake-after
Content-Type: application/json
{
"callback": "https://agent.example.com/wake",
"delay_seconds": 300
}
Use createWake402RelativeRequestCommitmentClientExtension for the route's v2 request commitment. WAKE402 anchors the final scheduled time once to its immutable first verified payment-attempt timestamp; an identical retry cannot move it.
3. Validate the HTTP 402
Read PAYMENT-REQUIRED and the JSON body's wake402_delivery_contract. Fail closed unless they declare the exact supported payment and delivery terms before any Payment Identifier or signature is created. Payment terms are x402 v2, scheme exact, network eip155:8453, amount 2000, Base Mainnet USDC, the required Payment Identifier extension, and the route's required wake402-request-commitment EIP-712 extension: v1 for /v1/wake or v2 for /v1/wake-after.
4. Inspect the operational delivery contract
0.002 USDC buys one wake. Delivery is at-least-once; successful delivery and exact-second execution are not guaranteed. The buyer must process callbacks idempotently. In V1, callback authentication is none, redirects are not followed, Idempotency-Key equals wake_id, retries are bounded, terminal failure is delivery_failed, and callback delivery failure alone does not trigger an automatic refund.
{
"version": "1",
"delivery_semantics": "at-least-once",
"successful_delivery_guaranteed": false,
"exact_second_timing_guaranteed": false,
"timing": {
"expectation": "for or shortly after the requested scheduled time",
"successful_delivery_sla_guaranteed": false
},
"schedule": {
"min_delay_seconds": 60,
"max_delay_seconds": 86400
},
"callback": {
"method": "POST",
"content_type": "application/json",
"redirects_followed": false,
"timeout_ms": 5000,
"authentication": {
"mode": "none"
},
"idempotency_key": {
"header": "Idempotency-Key",
"present": true,
"value_semantics": "wake_id"
},
"body": {
"format": "fixed",
"additional_properties": false,
"fields": {
"type": {
"const": "wake402.wake"
},
"wake_id": {
"value_semantics": "wake_id"
},
"scheduled_at": {
"value_semantics": "scheduled wake time"
},
"fired_at": {
"value_semantics": "delivery attempt time"
}
}
}
},
"retry": {
"first_delivery_attempt": "at-or-after-scheduled-time",
"retry_limit": 3,
"maximum_total_attempts": 4,
"initial_retry_delay": "5 seconds",
"backoff": "exponential",
"network_failures_retryable": true,
"callback_timeout_retryable": true,
"retryable_http_statuses": [
408,
425,
429,
500,
501,
502,
503,
504,
505,
506,
507,
508,
510,
511
],
"other_http_failures_retryable": false
},
"failure": {
"terminal_state": "delivery_failed",
"successful_delivery_sla_guaranteed": false,
"callback_response_body_retained": false,
"automatic_refund_on_delivery_failure": false
},
"expiry": {
"absolute_wall_clock_delivery_expiry_guaranteed": false,
"semantics": "delivery processing ends on success, non-retryable failure, or bounded retry exhaustion; no absolute wall-clock expiry is promised"
}
}
5. Sign with one payer
- Create a unique Payment Identifier. Never reuse it for a different request.
- Use the same EVM signer for the exact x402 payment authorization and the WAKE402 request commitment.
- The commitment payer-binds the canonical callback URL and
atordelay_seconds, their request fingerprint, network, asset, amount, payTo, and Payment Identifier.
6. Retry the identical body
Send the exact same serialized body again with PAYMENT-SIGNATURE. Do not change callback or the route's time field between the unpaid request and paid retry.
7. Require HTTP 201
{
"wake_id": "...",
"status": "scheduled",
"scheduled_for": "...",
"delivery_semantics": "at-least-once",
"status_url": "..."
}
8. Observe independently
The normal path is the callback. Independently, poll the returned status_url. Delivery is at-least-once, callbacks may be retried, and downstream processing should remain idempotent. WAKE402 provides no exact-second SLA.
The buyer private key or injected signer is the caller's secret. Never send it to WAKE402, never log it, and do not use a primary personal wallet. Prefer a purpose-specific agent wallet with limited funds. Always validate payment requirements before signing.
Executable TypeScript
The reusable buyWake402WakeAfter adapter accepts an injected ClientEvmSigner, registers Exact EVM and the existing relative request-commitment helper internally, and validates both the live payment requirements and operational delivery contract before creating signatures. Start with dry-run mode; it returns the validated contract, sends no PAYMENT-SIGNATURE, and performs no payment.
npm install @x402/core@2.23.0 @x402/evm@2.23.0 @x402/extensions@2.23.0 viem@2.55.19
curl -O https://wake402.agentwake.workers.dev/examples/wake402-client.ts
node --input-type=module -e '
const buyer = await import("./wake402-client.ts");
console.log(await buyer.buyWake402WakeAfter({
request: {
callback: "https://agent.example.com/wake",
delay_seconds: 300
},
dryRun: true
}));
'