# Schedule an HTTP request for later: wake | agentic402

> Schedule an HTTP request: wake POSTs your JSON to a public URL at a set time, 10 s to 30 days ahead, with up to 6 attempts. $0.005 per job, no account.

Source: https://agentic402.dev/tools/wake/

Published 3 December 2026 · Updated 3 December 2026

Schedule an HTTP request with one call: `POST https://agentic402.dev/v1/wake` with a time, a URL and a JSON body, and at that time wake POSTs the body to the URL. Times can be 10 seconds to 30 days ahead. If the target doesn't answer with a 2xx status, wake tries again, up to 6 attempts in all.

Each job costs $0.005 in USDC, paid over HTTP 402. Checking its status and cancelling it are free.

```
$ POST /v1/wake
{"at": "2026-12-04T09:00:00Z",
 "url": "https://agentic402.dev/in/911bd778e30d25b91227595148dd4d2e",
 "body": {"reminder": "check the deploy"}}

201 {"job_id": "cc6aa94cd9754c04d726b9c0fc989d0c", "at": "2026-12-04T09:00:00.000Z",
     "status_url": "https://agentic402.dev/v1/wake/cc6aa94cd9754c04d726b9c0fc989d0c",
     "cancel_token": "<64 hex characters>"}
```

## How wake differs from cron services

Most tools that schedule HTTP requests are built for repeating jobs set up by a person with an account: a report every night, a cache warm-up every hour. wake is built for the other case, a single request at a single moment, booked by an agent at run time with nothing but a wallet. The table compares it with three schedulers that turn up for this search, using each one's own documentation as read on 3 December 2026.

*One-off HTTP scheduling compared. Sources: each provider's docs, 3 December 2026.*

| Service | One-off time | Retries | Access |
|---|---|---|---|
| Google Cloud Scheduler | Built around cron schedules; its example runs every 3 hours | Retry count "Default is 0" | Google Cloud project |
| Vercel Schedules | Yes (`"type": "single"`), but API-created schedules "only support queue topics" | Not covered in its API reference | Vercel token |
| Val Town delay | Yes | "No retries: Failed requests are not automatically retried" | "No authentication: This is an open service". Free, experimental |
| agentic402 wake | Yes, 10 s to 30 days ahead | 6 attempts, 20 s to 320 s apart | x402 payment, $0.005. No account |

Val Town's scheduler also says "No cancellation: Scheduled requests cannot be cancelled". wake jobs can be cancelled at any point before delivery, and their status stays readable for a week after they finish.

## Three jobs agents book with wake

**A deploy check in 15 minutes.** The agent starts a deploy that usually takes ten to fifteen minutes. Instead of polling for a quarter of an hour, it books a job for 15 minutes ahead pointed at its own start endpoint, with `{"task": "verify-deploy", "deploy_id": "..."}` as the body, and exits. When it's woken, the body tells it what to check. Cost: $0.005.

**A reply that may take days.** The agent has emailed a supplier and expects an answer within the week. It books a job for 09:00 the next working day. Each morning it checks for the reply. If there's none, it books the next morning before stopping. Five mornings cost $0.025, and the agent is idle the rest of the time.

**A rate limit with a Retry-After header.** An API answers `429` with `Retry-After: 3600`. Rather than sleep for an hour inside a running process, the agent saves its place in [memory](https://agentic402.dev/tools/memory/), books a wake job for an hour and a few seconds later, and stops. The job carries the key of the saved state, so the next run picks up exactly where this one left off.

In all three, the schedule is decided at run time by the agent, from what it just learned. That's the difference from a cron table, which someone has to edit by hand.

## Booking a job from JavaScript

Any x402 client works. With the `@x402/fetch` wrapper set up as in the [quickstart](https://agentic402.dev/docs/quickstart/), booking a job three hours from now looks like this:

```
const at = new Date(Date.now() + 3 * 3600e3).toISOString();
const res = await payFetch("https://agentic402.dev/v1/wake", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ at, url: START_URL, body: { resume: "state/progress.json" } }),
});
const { job_id, cancel_token } = await res.json();  // keep both
```

`toISOString()` always writes UTC with a trailing `Z`, which avoids the time-zone mistake described below.

## The request body and its checks

All four fields are checked before the 402 is sent, so a bad time or URL costs nothing.

*Fields accepted by POST /v1/wake*

| Field | Rule |
|---|---|
| at | Required. ISO 8601 time, at least 10 seconds and at most 30 days in the future. |
| url | Required. Public http or https address. Private, local and link-local addresses are refused. |
| body | Optional. Any JSON value, up to 64 KB (65,536 characters) once encoded as JSON. |
| headers | Optional. Object of up to 20 string values. `host` and `content-length` aren't allowed. |

Write `at` with a `Z` or an explicit offset, such as `2026-12-04T10:00:00+01:00`. A time without either is read in the server's clock, which is UTC, and that is rarely what someone writing "09:00" means.

The response repeats `at` in normalised UTC form, gives the `job_id` and a `status_url`, and returns a `cancel_token`. Only the token's SHA-256 hash is stored, so keep the token if you may want to check or cancel the job.

## What arrives at the target URL

At the scheduled time wake sends one POST. The body is your `body` value encoded as JSON, so an object arrives as that object, and a plain string arrives as a quoted JSON string. With no `body`, the request has an empty body.

Headers are built in this order: `Content-Type: application/json`, then your own headers (which can replace the content type), then two that wake always sets. `User-Agent: agentic402-wake/1.0 (+https://agentic402.dev/tools/wake/)` names the sender, and `X-Agentic402-Wake` carries the job ID, so the receiving service can log which job called it or ignore jobs it doesn't recognise.

Redirects are not followed. A target that answers `301` or `302` counts as a failed attempt and is retried, so point wake at the final URL. Each attempt waits up to 15 seconds for an answer.

## Retries, attempt by attempt

A delivery succeeds when the target answers with a 2xx status. Anything else, including a timeout, a network error or a redirect, counts as a failure. After a failure, wake waits twice as long as the previous gap, starting at 20 seconds, for a total of 6 attempts. If all six fail, the job's status becomes `failed` and the last error is recorded.

*wake delivery attempts. Times are after the first attempt, not counting each request's own duration (up to 15 s).*

| Attempt | Wait before it | Time after attempt 1 |
|---|---|---|
| 1 | (scheduled time) | 0 s |
| 2 | 20 s | 20 s |
| 3 | 40 s | 60 s |
| 4 | 80 s | 140 s |
| 5 | 160 s | 300 s |
| 6 | 320 s | 620 s |

So a target that is down for up to about ten minutes still gets the request. One that is down for longer won't. If your receiver may be offline for hours, deliver into an [inbox](https://agentic402.dev/tools/inbox/) instead and let the receiver collect the message when it's back.

Retries mean your receiver can, rarely, see the same job twice: for example when it processed a request but its answer was lost or arrived after the 15-second limit. Use the `X-Agentic402-Wake` job ID to skip a job you've already handled.

## Checking and cancelling a job

`GET /v1/wake/{job_id}` with `Authorization: Bearer <cancel_token>` returns the job's status (`scheduled`, `delivered` or `failed`), the scheduled time, the target URL, the number of attempts so far, the last error if any, and `delivered_at` once it succeeds. `DELETE` on the same URL cancels the job and answers `204`.

Both are free. A wrong token and an unknown job ID return the same `404`. After a job is delivered or fails, its record stays readable for 7 days and is then deleted.

## How precise the timing is

wake is built on Cloudflare Durable Object alarms, one alarm per job. An alarm fires at the set time or shortly after it, and survives restarts of the machine it runs on. Jobs booked for the same moment each have their own alarm, so none of them waits in line behind the others. The code sets one alarm for the scheduled time and nothing tighter is guaranteed, so plan for a short delay rather than delivery to the second, and don't use wake where a few seconds' difference matters, such as market orders.

## Restarting an agent at a set time

The main job wake does for agents is bringing them back. An agent that has to wait three hours for a deploy, or until Monday for a reply, can book a wake job pointed at whatever starts it again: a serverless function, a workflow trigger, or the endpoint of a hosted agent platform. Then it stops, and nothing runs, or bills, until the request arrives.

If that endpoint needs a secret, pass it in `headers`, for example `{"Authorization": "Bearer ..."}`. Be aware that the headers are stored with the job until it ends, plus the 7-day record period, so use a secret that only allows starting the agent and that you can rotate.

When there's no endpoint to call, the agent can leave a note instead. Point the job at its own inbox URL and the reminder sits next to any callbacks, ready for the next run to read. Deliveries to an agentic402 inbox go straight into it without leaving the Worker. The [recipe for waiting on a callback](https://agentic402.dev/recipes/wait-for-a-callback/) puts both tools together.

## Checking that a wake request is yours

The `X-Agentic402-Wake` header identifies the job, but it isn't proof of anything: any client can send a request with that header. If the target URL does something that matters, such as starting a paid agent run, don't trust the header alone. Add your own secret in `headers` when you book the job and check it on arrival, or keep a list of the job IDs you booked and ignore any request whose ID isn't on it.

The body deserves the same care. It's the JSON you wrote yourself, but anyone who can reach your endpoint can send JSON shaped the same way.

## Repeating schedules

wake has no cron syntax and no repeating jobs. To check something every morning, have each run book the next one: the job at 09:00 on Monday wakes the agent, and the agent's last step schedules 09:00 on Tuesday. Each link in the chain costs $0.005, so a daily check costs about $0.15 a month, and the chain stops on its own if the agent decides there's nothing left to do. Keep the cancel token of the next booked job in memory, so you can stop the chain from outside if the agent goes wrong.

A chain also adapts in a way cron can't: the agent can choose the next time based on what it found, checking again in ten minutes when a deploy is nearly done, or in a week when nothing has changed.

## When another scheduler fits better

wake is a poor choice for a fixed job that a team runs forever, such as a nightly export. A cron service inside the cloud account that owns the data is cheaper to reason about and doesn't need a wallet. It's also the wrong tool when the request must reach a private network, carry more than 64 KB, use a method other than POST, or land within a second of a given time.

Where wake fits is the gap those tools leave: an agent with no account anywhere, deciding while it runs that it needs one request at one future moment, and wanting retries and a status it can check without keeping anything alive. If the request is the agent's own wake-up call, that gap is most of the problem.

## Limits and charges

These come from the wake code as of 3 December 2026.

*wake limits*

| Limit | Value |
|---|---|
| Earliest time | 10 seconds from now |
| Latest time | 30 days from now |
| Body | 64 KB (65,536 characters) as JSON |
| Custom headers | 20 |
| Attempts | 6, at 20, 40, 80, 160 and 320 s gaps |
| Timeout per attempt | 15 seconds |
| Status record | 7 days after delivery or failure |

The $0.005 is charged when the job is scheduled, not when it's delivered: scheduling is the work the payment buys. A job that later fails to deliver, or that you cancel, isn't refunded. A request rejected with `400` never reaches payment. [How agentic402 payments are settled](https://agentic402.dev/docs/payments/) has the general rules, and [the price list](https://agentic402.dev/pricing/) has every endpoint.

## wake over MCP

The [MCP server](https://agentic402.dev/docs/mcp/) has three wake tools. `wake_schedule` costs $0.005 and takes `at`, `url`, and optional `body` and `headers`. `wake_status` and `wake_cancel` are free and take the `job_id` and `cancel_token` as arguments.

## Questions about scheduling requests

**Can wake send a GET request?**
No. Every delivery is a POST, with your JSON body or an empty body. If the target only accepts GET, put a small function in front of it, or deliver to an inbox and act on the message from there.

**What happens if I schedule a job and my agent never comes back?**
The job runs anyway. wake doesn't depend on the caller being alive. That's the point of it. Cancel jobs you no longer want with the cancel token.

**How long does wake keep my body and headers?**
They are stored with the job until it is delivered, fails or is cancelled. After delivery or failure the record stays for 7 days and is then deleted. Cancelling deletes it at once.

**Can I change the time of a job?**
No. Cancel it with the cancel token, which is free, and book a new job for $0.005. The new job gets a new ID and token.

**Can the target URL be on localhost or a private network?**
No. The same private-address rules as fetch apply: checked before payment, and again at delivery time after a DNS lookup, so a name that points at a private address fails then. Use a public URL, or an agentic402 inbox as a public drop point.

Cite this page: agentic402, "Schedule an HTTP request for later: wake", https://agentic402.dev/tools/wake/, published 3 December 2026. Behaviour is taken from `src/wake.js` as of that date; other schedulers are quoted from their documentation as read that day.

## Related

- [Wait for a callback with inbox and wake](https://agentic402.dev/recipes/wait-for-a-callback/)
- [Webhook URL for AI agents: inbox](https://agentic402.dev/tools/inbox/)
- [Webhooks for AI agents: patterns compared](https://agentic402.dev/guides/webhooks-for-ai-agents/)
- [Status codes and what each one costs](https://agentic402.dev/docs/errors/)
