# Fetch a BRC-121-protected HTTP resource.

> For the complete documentation index, see [llms.txt](https://bsvblockchain.com/docs/llms.txt).

**GET** `/{resourcePath}`

Base URL: `https://{host}`

When called without payment headers the server returns 402.
When called with valid payment headers the server serves the resource.

The same pattern applies to any HTTP method; GET is used as the
canonical example.  POST, PUT, DELETE etc. follow identical header
semantics.

## Header parameters

- `x-bsv-beef` (string)
  Base64-encoded Atomic BEEF (BRC-95) transaction containing the payment
  output.  MUST be present on the paid request.
- `x-bsv-sender` (string)
  Client's compressed, hex-encoded secp256k1 identity public key.
  Used by the server as the `senderIdentityKey` in `paymentRemittance`.
- `x-bsv-nonce` (string)
  Base64-encoded BRC-29 derivation prefix for this payment.
  Serves as `derivationPrefix` in the internalizeAction remittance.
- `x-bsv-time` (string)
  Unix millisecond timestamp as a decimal string (e.g. `1719500000000`).
  Two purposes:
    1. Freshness check — server rejects if |serverTime - x-bsv-time| > 30 s.
    2. Derivation suffix — base64(x-bsv-time) is used as the BRC-29
       `derivationSuffix` in key derivation.
  MUST be present on the paid request.
- `x-bsv-vout` (string)
  Zero-based output index (decimal string) of the payment output within
  the BEEF transaction.  MUST be present on the paid request.

## Path parameters

- `resourcePath` (string, required)
  Arbitrary path of the protected resource.

## Responses

### 200

Payment accepted; protected resource served.
Body is application-specific.

### 402

Payment is required.  The response body MUST be empty (the server
MUST NOT serve the protected content).

Two distinct conditions both result in 402:
  1. No payment headers — client should read `x-bsv-sats` and
     `x-bsv-server`, construct payment, and retry.
  2. Invalid payment — client SHOULD NOT retry automatically to
     avoid double-spending.

### 500

The server failed to initialise its wallet or encountered an unexpected
error.  The client SHOULD NOT retry payment for 5xx responses.

- `error` (string, required)
  Human-readable error description.

Example:

```json
{
  "error": "wallet unavailable"
}
```

### 503

Payment processing failed after wallet work began, so acceptance state
may be ambiguous. No fresh payment challenge headers are sent. The
client MUST NOT create another payment until the transaction is
reconciled.