# Schedule a job
$ curl -X POST https://cron.prim.sh/v1/jobs \
-H "X-402-Payment: $TOKEN" \
-d '{"schedule": "*/5 * * * *",
"endpoint": "https://my-app.dns.sh/healthcheck",
"method": "POST"}'
{ "id": "job_n4k8m2", "schedule": "*/5 * * * *",
"next_run": "2026-02-23T06:35:00Z", "status": "active" }
# Or run a command on a spawn.sh instance
$ curl -X POST https://cron.prim.sh/v1/jobs \
-H "X-402-Payment: $TOKEN" \
-d '{"schedule": "0 9 * * MON-FRI",
"action": "spawn_exec",
"instance": "inst_k7x9m2",
"command": "python3 daily_report.py"}'
# One-shot: run once at a specific time
$ curl -X POST https://cron.prim.sh/v1/jobs \
-H "X-402-Payment: $TOKEN" \
-d '{"at": "2026-02-23T15:00:00Z",
"endpoint": "https://relay.prim.sh/v1/send",
"method": "POST",
"body": {"to": "[email protected]", "subject": "Reminder"}}'
Ping an endpoint every 5 minutes. If it fails, trigger a ring.sh SMS alert or a spawn.sh restart. Uptime monitoring without a monitoring service.
Every morning at 9am: run a script, generate a report, email it via relay.sh. The agent's daily routine.
Fetch data every hour. Process it. Store results on store.sh. No long-running server needed.
Agent decides at 2pm to do something at midnight. Schedules a one-shot. Doesn't need to stay alive.
POST /v1/jobs # Create job (cron, interval, or one-shot)
GET /v1/jobs # List jobs
GET /v1/jobs/:id # Job details + next run
PUT /v1/jobs/:id # Update schedule or endpoint
DELETE /v1/jobs/:id # Delete job
POST /v1/jobs/:id/trigger # Trigger immediately (skip schedule)
GET /v1/jobs/:id/runs # Execution history
GET /v1/runs/:id # Run details (status, response, duration)
| Resource | Cost | Notes |
|---|---|---|
| Active job | $0.001/day | Per scheduled job |
| Invocation | $0.0002 | Per execution |
| Execution history | Free | 7 day retention |
| One-shot timer | $0.0005 | Single execution |
Health check every 5 min for a month: ~$0.06 total.