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

# Fetch responses

> Behavior and return values after wrapping fetch

## Behavior

* 200: returned directly
* 402: automatically signs and retries; final response is returned
* Other errors: original response is passed through

## Return

* Same as native `fetch`, returns a `Response` object

## Retry flow

1. First request → if 402 (with `accepts`)
2. Choose `PaymentRequirements` by selector/default strategy
3. Create and sign `PaymentPayload` (matching `requirements`)
4. Attach `X-Payment` header and retry automatically
5. Return the final response (200/402/other)
