Skip to main content

Authentication model

WURK endpoints in this docs set use payment-based authentication:
  • x402 routes (/{network}/*) use PAYMENT-SIGNATURE on paid retry
  • MPP routes (/mpp/*, /mpp-solana/*) use Authorization: Payment ... on paid retry

x402 flow

1

First request (no payment header)

Call a paid endpoint like:
curl -i "https://wurkapi.fun/solana/xlikes?amount=50&url=https://x.com/user/status/123"
Response:
  • HTTP 402
  • Payment-Required (or PAYMENT-REQUIRED) response header
  • Payment requirements in accepts[]
2

Second request (with signed payment)

curl -i "https://wurkapi.fun/solana/xlikes?amount=50&url=https://x.com/user/status/123" \
  -H "PAYMENT-SIGNATURE: <signed-payment>"

MPP flow

1

First request (no Authorization)

curl -i "https://wurkapi.fun/mpp/xlikes?amount=50&url=https://x.com/user/status/123"
Response:
  • HTTP 402
  • WWW-Authenticate: Payment ...
  • application/problem+json body (type, title, status, detail, optional challengeId)
2

Second request (Payment credential)

curl -i "https://wurkapi.fun/mpp/xlikes?amount=50&url=https://x.com/user/status/123" \
  -H "Authorization: Payment <credential>"
Successful responses include Payment-Receipt.

Header reference

RailInitial requestRetry request
x402No payment headerPAYMENT-SIGNATURE: ...
MPP / MPP SolanaNo AuthorizationAuthorization: Payment ...
StatusMeaningAction
402Payment challenge or payment verification failedRebuild payment using latest challenge
409Similar paid/open job already existsReuse existing job reference instead of re-paying
200 + alreadyConfirmedIdempotent paid stateTreat as success
Do not mix headers between rails. PAYMENT-SIGNATURE is x402-only, while Authorization: Payment ... is MPP-only.

Legacy and internal notes

  • Public /{network}/* x402 routes use PAYMENT-SIGNATURE (v2).
  • Some legacy/internal test flows may still show X-PAYMENT; do not copy that header into public integrations.

Quick questions

  • Can I reuse an old challenge? Prefer a fresh challenge for each paid retry window.
  • Can I mix x402 and MPP headers? No, use rail-specific headers only.
  • What if retry still returns 402? Re-parse the latest challenge and rebuild payment proof.
  • x402 resource discovery: https://wurkapi.fun/.well-known/x402
  • Tempo MPP OpenAPI: https://wurkapi.fun/openapi.json
  • Solana MPP OpenAPI: https://wurkapi.fun/openapi-mpp-solana.json