OpenArtifacts

openartifacts.sh / use / webhooks and bots

Webhook receivers and bots, deployed by your agent

For code that waits for someone else to call it, and should cost nothing while it waits.

The problem

A webhook needs a public HTTPS URL that answers whenever another service decides to POST to it: a payment went through, someone pushed to a repository, a form came in, a person messaged your bot. That is a server. Setting one up for twenty events a day is most of the work, and leaving it running around the clock bills you for a whole day to do a few seconds of it.

Here the receiver is a service with its own HTTPS URL, https://<slug>-xxxx.openartifactsusercontent.com. It sleeps between deliveries and the next one wakes it. Every HTTP method passes through, and the request reaches your process with its body and its own headers, a signature header included, so the code can verify the sender. The platform removes only its own and Cloudflare's headers, and sets X-Forwarded-Host and X-Forwarded-Proto. Republishing the same slug keeps the URL, so the sender's settings never change.

On a paid account the receiver can also answer on a subdomain of yours, such as hooks.example.com: oa domains add orders-hook hooks.example.com, then a CNAME and the TXT ownership records at your DNS provider. $0.50 a domain per month.

One prompt, or one call

Give your agent this:

Read https://openartifacts.sh/skill and https://openartifacts.sh/templates/webhook-receiver. Deploy the webhook-receiver template on OpenArtifacts with the slug orders-hook and set its sleep_after_s to 60. Tell me the price before you pay anything, then give me the URL to paste into the sender and the claim link.

Behind it are these calls:

# 1. An account and a token (there is no signup form)
curl -X POST "https://api.openartifacts.sh/v1/signup?ref=use-webhooks"

# 2. Deploy the template
curl -X POST https://api.openartifacts.sh/v1/publish \
  -H "Authorization: Bearer oa_sk_..." \
  -F type=service -F template=webhook-receiver -F slug=orders-hook

# 3. Sleep one minute after the last delivery instead of ten
curl -X PATCH https://api.openartifacts.sh/v1/artifacts/orders-hook \
  -H "Authorization: Bearer oa_sk_..." -H "Content-Type: application/json" \
  -d '{"sleep_after_s": 60}'

# The deploy over MCP (https://mcp.openartifacts.sh/mcp): publish_artifact with
{"type":"service","template":"webhook-receiver","slug":"orders-hook"}

# Or from a terminal
npx @openartifacts/cli deploy --template webhook-receiver --slug orders-hook

On a new account the deploy first answers 402 Payment Required: a service needs an hour of its rate in credit before it starts, $0.03 on the small size. The agent pays over MPP or x402 (USDC from $0.25, or a card through its human's Link wallet from $5), retries, and the surplus stays as credit. A new account expires 30 minutes after signup, and the receiver stops with it, unless a human opens the claim link.

Start from a template

webhook-receiver takes deliveries; telegram-bot is a bot. Deploy one as it is, then publish the same slug again with your own handling. The gallery has the rest.

A bot here takes its updates by webhook, not by polling. Idle means no inbound request: outbound traffic does not keep a service awake, so a bot that only polls is put to sleep after sleep_after_s and nothing wakes it. Telegram's setWebhook points updates at the service URL, and each message is a request that wakes the bot. Any platform that delivers by HTTP POST works the same way.

Keep the bot's token and the webhook's signing secret in the service's environment, set over REST or the CLI with the variable names the code reads:

npx @openartifacts/cli env set my-bot KEY=value

Environment variables cannot be set over MCP, so a secret never passes through a chat transcript. Setting them restarts the service with the new values.

What it costs

The small size (1/4 vCPU, 1 GiB memory) is $0.03 an hour awake, billed per minute from the first minute of each wake, plus $0.216 per vCPU-hour of CPU the container uses. Asleep it costs nothing. A wake lasts the boot, the work and then sleep_after_s of quiet, rounded up to whole minutes: about 2 minutes with a 60-second sleep when the boot takes under a minute, about 11 with the default ten.

How it is used, on smallAwakeAwake costCPU, at most
20 deliveries a day, more than ten minutes apart, sleep_after_s 60: 600 wakes of about 2 minutes20 h$0.60$1.08
The same 20 a day on the default ten-minute sleep: 600 wakes of about 11 minutes110 h$3.30$5.94
A bot in a busy group chat, awake 4 hours a day120 h$3.60$6.48
Awake all month720 h$21.60$38.88

"CPU, at most" is what the CPU line would be if the container kept its quarter vCPU fully busy the whole time it was awake; CPU is never billed beyond that, and a receiver that mostly waits uses a small part of it. Deploys are free up to 100 a month on a claimed account, then $0.005 each. Running two services at the same moment needs $2 of balance: one running service per $1, at most 10.

Limits

Start with a token. It is free, and there is no form.

curl -X POST "https://api.openartifacts.sh/v1/signup?ref=use-webhooks"

Then hand your agent the skill, or read the full reference. Prices for everything are on the home page.


MCP servers   APIs and scheduled jobs   Templates   Status   Support