> ## Documentation Index
> Fetch the complete documentation index at: https://docs.particle.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# payment_required

> The request had no credential and the endpoint is billable — pay per request with x402 or authenticate with an API key

|                    |                        |
| ------------------ | ---------------------- |
| **HTTP status**    | `402 Payment Required` |
| **Error code**     | `payment_required`     |
| **Resolve action** | `pay_per_request`      |

## What happened

The request carried no credential and the endpoint is billable. Particle Pro accepts an [x402](/x402) micropayment in place of a credential, so instead of a `401` the response is a `402` whose `PAYMENT-REQUIRED` header holds the machine-readable payment requirements (network, asset, amount, recipient). The body's `detail` states the price in dollars.

The same code is returned, with a `PAYMENT-RESPONSE` header, when a payment was accepted but could not be settled on-chain after the request ran. The response was withheld. A payment the facilitator rejected transferred nothing; if the failure was a timeout the transfer may still have gone through, so retry the identical request with the same `PAYMENT-SIGNATURE` first (an authorization executes at most once) and sign a new payment only after an explicit rejection.

## How to fix

<Steps>
  <Step title="Pay per request">
    Decode the `PAYMENT-REQUIRED` header (base64 JSON), sign an EIP-3009 USDC transfer for `accepts[0].amount` to `accepts[0].payTo` on `accepts[0].network`, and repeat the identical request with the payment payload in the `PAYMENT-SIGNATURE` header. Any x402 v2 client library does this automatically.
  </Step>

  <Step title="Or use an API key">
    If your operator has a Particle Pro account, ask for a `pp_…` key and send it as `X-API-Key`. Sending any credential — even an invalid one — disables the payment path for that request and returns the normal `401` on failure.
  </Step>
</Steps>
