Skip to main content
The fetch_with_auth tool is a deprecated compatibility alias for 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

url
string
required
The URL to fetch.
method
string
default:"GET"
HTTP method. One of GET, POST, PUT, PATCH, DELETE.
body
string
Raw request body string.
headers
string[]
Additional HTTP headers. Each entry must be a string in Name: value format.
timeout
number
Request timeout in milliseconds.

Response

data
object
The parsed response body from the endpoint.
paymentInfo
object
Payment details, present when the request still required payment after the SIWX retry.

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.