# Why HTTP 402 matters for automated clients

HTTP 402 is the status Attackfee uses when an automated client tries a protected write without a pass. The client sends `Attackfee-Client: agent`. The response is JSON, not a page, so a program can read the next step without parsing HTML. That is why 402 matters for automated clients. A browser-style request without a pass gets 403 instead. People never pay money.

The 402 body includes `error: payment_required`, a `challenge_url` for the work, and `offers`. The client can do the work, or, when payments are on, pay a live offer and redeem a pass. Current prices are at `/v1/price`. Use only methods that `/.well-known/attackfee.json` lists as live. Do not hardcode a dollar figure.

A paid pass covers one write and lasts at most 60 seconds. The work path is always available. Payments are on for attackfee.dev. A self-hosted server uses a stub backend by default. The WordPress plugin takes no payments itself.

## Where Attackfee fits

If you are building a client, send the agent header, follow the JSON, and present a pass as `Authorization: Attackfee <pass>`. See [What is HTTP 402 Payment Required?](/learn/payments/what-is-http-402), [How does a paid write work?](/learn/payments/how-does-a-paid-write-work), and [How agents write to an Attackfee site](/learn/agents/how-agents-write-to-an-attackfee-site).

- [Attackfee](/)
- [Learn](/learn)
- [Payments](/learn/payments)
- [Why HTTP 402 matters for automated clients](/learn/payments/why-http-402-matters-for-automated-clients)

## Related

- [What is HTTP 402 Payment Required?](/learn/payments/what-is-http-402)
- [How does a paid write work?](/learn/payments/how-does-a-paid-write-work)
- [Why a paid path exists alongside background work](/learn/payments/why-a-paid-path-exists)
- [How to read /v1/price](/learn/payments/v1-price-endpoint)
- [How agents write to an Attackfee site](/learn/agents/how-agents-write-to-an-attackfee-site)
- [An agent that pays for one write](/learn/agents/an-agent-that-pays-for-one-write)
- [What happens if a write has no pass?](/learn/concepts/what-happens-without-a-pass)

## Questions



### "Do people ever see HTTP 402?"

"No. A browser-style request without a pass gets 403. People never pay money. Their browser earns a work pass in the background."

### "What does the 402 body contain?"

"JSON with error payment_required, a challenge_url for the work, and offers. Current prices are also at /v1/price. Use only methods that /.well-known/attackfee.json lists as live."

### "Does every Attackfee install take payment?"

"No. Payments are on for attackfee.dev. A self-hosted server uses a stub backend by default. The WordPress plugin takes no payments itself."

### "Can one payment cover many writes?"

"No. A paid pass is one write and at most 60 seconds."
