# How to test an agent 402 on the demo

To see an HTTP 402 from an automated client, post to the hosted demo with the agent header and no pass. The contact form on the [demo](/demo) posts to `/demo/contact`. Payments are on for attackfee.dev, so this is the right place to inspect a live 402. The local demo uses a stub backend by default, so it is the wrong place to test a live payment.

Send this official request:

```sh
curl -sS -D - -o /dev/null -X POST https://attackfee.dev/demo/contact -d "message=hi" \
  -H "Attackfee-Client: agent"
```

You should get HTTP 402 and JSON. Look for `error` set to `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. Do not hardcode a dollar figure from the response.

The same route without the agent header, and still with no pass, gets 403:

```sh
curl -sS -D - -o /dev/null -X POST https://attackfee.dev/demo/contact -d "message=hi"
```

People never pay money. Their browser earns a work pass on the form. A paid pass, if you redeem one, is one write and at most 60 seconds.

## Where Attackfee fits

This confirms the agent path. For the refused write without the header, see [How to test a write without a pass](/learn/concepts/how-to-test-a-write-without-a-pass). For what to do with a live offer, see [How does a paid write work?](/learn/payments/how-does-a-paid-write-work).

- [Attackfee](/)
- [Learn](/learn)
- [Payments](/learn/payments)
- [How to test an agent 402 on the demo](/learn/payments/how-to-test-an-agent-402-on-the-demo)

## Related

- [How to test a write without a pass](/learn/concepts/how-to-test-a-write-without-a-pass)
- [Walk through the hosted demo](/learn/concepts/try-the-demo)
- [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 HTTP 402 matters for automated clients](/learn/payments/why-http-402-matters-for-automated-clients)
- [How to read /v1/price](/learn/payments/v1-price-endpoint)
- [Demo](/demo)

## Questions



### "Which URL should I post to?"

"On the hosted demo, POST /demo/contact. A browser-style POST to the same route, with no agent header, gets 403."

### "Should I test a live payment on the local demo?"

"No. The local demo uses a stub backend by default. Use the hosted demo to see a live 402. Current prices are at /v1/price."

### "Do people run this curl?"

"No. People never pay money. Their browser earns a work pass on the demo form."

### "What fields should I look for in the JSON?"

"error set to payment_required, a challenge_url, and offers. Use only methods that /.well-known/attackfee.json lists as live."
