Remote Jobs API 如何透過 x402 按次付費取得職位資料
Call a live pay-per-call API with x402 - no key, no signup, no billing
文章以 Remote Jobs API 示範透過 x402 呼叫按次付費 API,無需註冊或 API key,付款後即可取得職位資料。該 API 收錄 67 個招聘平台的標準化遠端職位資料,每次呼叫收費 $0.01 USDC,可在 Base 或 Solana 付款。
Call a live pay-per-call API with x402 — no key, no signup, no billing
Most APIs make you register, mint an API key, enter a card, and wait on support for a tier. There's a different model that's quietly becoming real: pay-per-call over x402. You hit an endpoint, it returns 402 Payment Required with the exact amount and asset to send, you pay in stablecoin (USDC on Base or Solana), and the data comes back. No account. No key. No invoice.
This post shows the whole flow against a real, live endpoint — Remote Jobs API — which serves ~1.2M normalized remote-job listings across 67 boards and sells the full feed per-call for $0.01 in USDC.
What x402 is
x402 is an HTTP-based payment protocol. The server says "this costs X" in a standard response; the client attaches a signed payment in a PAYMENT header; a facilitator verifies and settles it on-chain. The 402 status code — long reserved for "Payment Required" but almost never used — finally has a job.
You don't need a framework to consume one. You need to know two things: how the endpoint advertises its price, and how to satisfy it.
1. Discover the endpoint
Every x402 endpoint publishes a manifest at .well-known/x402. For Remote Jobs API:
curl https://remote-jobs-api.tten.no/.well-known/x402
You get the machine-readable contract:
{
"x402Version": 1,
"name": "Remote Jobs API",
"description": "Live, normalized remote-job data across 67 job boards (1,231,240 jobs). Pay-per-call via x402, no signup, no key.",
"price_per_call_usd": "$0.01",
"currency": "USDC",
"endpoints": [
{ "path": "/x402/jobs", "method": "GET" },
{ "path": "/x402/sources", "method": "GET" }
],
"facilitator": "https://pay.openfacilitator.io",
"networks": [
{ "network": "base", "payTo": "0xA2239F602a35dC31C5a9F995351e359a5cd61B96", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": 10000 },
{ "network": "solana", "payTo": "VqFNE9ToBykVD9aWF7MpNDJhcj1uDpGTwYCjZfiAf4L", "asset": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8LLwX", "amount": 10000 }
],
"free_tier": { "path": "/v1/jobs", "description": "Anonymous read access, capped at 10 jobs per request (no key)." }
}
Read that and you know everything: the price ($0.01), the rails (Base USDC or Solana USDC), the destination wallet, and — importantly — that there's a free tier so you can test without spending anything.
2. Try the free tier (spend $0)
curl "https://remote-jobs-api.tten.no/v1/jobs?limit=3"
Live response (real, at time of writing):
{
"count": 3,
"tier": "free",
"jobs": [
{ "title": "Partnership Specialist Intern", "location": "Genoa, Milan, Remote", "source": "oceanofjobs", "url": "https://buddyfit.jobs.personio.de/job/2860577" },
{ "title": "Senior Motion Designer", "location": "Remote", "source": "oceanofjobs", "url": "https://job-boards.greenhouse.io/embed/job_app?for=fxpro" }
]
}
Ten jobs per request, anonymous, no key. Enough to inspect the schema before you commit to a paid call.
3. See the 402 (the whole point)
Hit the paid endpoint without paying:
curl -i https://remote-jobs-api.tten.no/x402/jobs
You get HTTP/2 402 with a payment-required header that is a base64-encoded JSON object:
{
"x402Version": 1,
"error": "Payment Required",
"accepts": [
{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "10000",
"resource": "https://remote-jobs-api.tten.no/x402/jobs",
"mimeType": "application/json",
"payTo": "0xA2239F602a35dC31C5a9F995351e359a5cd61B96",
"maxTimeoutSeconds": 300,
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"extra": { "name": "USDC", "version": "2", "assetTransferMethod": "eip3009" }
}
]
}
maxAmountRequired: "10000" is in USDC atomic units = $0.01. The accepts[] array tells you exactly which rails are available and how the transfer should be structured (EIP-3009 transferWithAuthorization on Base).
4. Pay and get the data
To complete the call you attach a signed PAYMENT header. The cleanest way is an x402 client that reads the payment-required header, signs a USDC authorization from your wallet, and re-sends the request with the payment attached. The response is the full normalized feed:
{
"jobs": [
{ "title": "...", "location": "Remote", "source": "himalayas",
"salary": "$120k-$150k", "skills": ["go", "kubernetes"], "fit_score": 87 }
]
}
The fit_score (0–100, deterministic) is the part that makes a per-call API useful for agent tooling: you pass ?skills=go,kubernetes&location=Remote and the server ranks every matching job against your constraints in the same response you paid for.
Why this matters
The model collapses the onboarding that most data APIs bolt on — accounts, keys, tiers, invoices — into a single signed payment. For agents and scripts that need a small, verifiable, pay-per-use data source, that's a lower-friction path than any marketplace or API key. You can:
-
Probe the contract for free (
.well-known/x402). - Test the schema on the free tier ($0).
-
Inspect the exact charge before paying (
402+payment-required). - Settle in the asset and rail the endpoint advertises.
If you're building an agent that needs to consume data, x402 endpoints are worth watching — this one is live right now at remote-jobs-api.tten.no.
來源:DEV Community · dev.to