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

# fetch_with_auth

> Compatibility alias for fetch.

The `fetch_with_auth` tool is a deprecated compatibility alias for [`fetch`](/tools/fetch). It uses the same unified flow: probe the route, attempt SIWX (Sign-In With X) when available, and only pay if the route still returns `402`.

Equivalent CLI command: `npx agentcash fetch-auth <url>` (deprecated alias for `npx agentcash fetch <url>`)

## Parameters

<ParamField body="url" type="string" required>
  The URL to fetch.
</ParamField>

<ParamField body="method" type="string" default="GET">
  HTTP method. One of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`.
</ParamField>

<ParamField body="body" type="string">
  Raw request body string.
</ParamField>

<ParamField body="headers" type="string[]">
  Additional HTTP headers. Each entry must be a string in `Name: value` format.
</ParamField>

<ParamField body="timeout" type="number">
  Request timeout in milliseconds.
</ParamField>

## Response

<ResponseField name="data" type="object">
  The parsed response body from the endpoint.
</ResponseField>

<ResponseField name="paymentInfo" type="object">
  Payment details, present when the request still required payment after the SIWX retry.
</ResponseField>

## Behavior

1. Sends the initial request
2. If the response includes a SIWX challenge, extracts the challenge
3. Signs the challenge with your wallet's private key
4. Retries the request with signed auth headers
5. If the route still returns `402`, pays and retries again
6. Returns the final response

## When to use

Prefer `fetch` for new integrations. Keep `fetch_with_auth` only for compatibility with older prompts or clients.
