How SIWX works
1
Request triggers a 402 with SIWX challenge
The endpoint responds with
402 Payment Required and includes a SIWX challenge, either on its own or alongside a payment requirement.2
AgentCash signs the challenge
Your wallet signs the server’s challenge to prove ownership of the address.
3
Request retries with auth headers
AgentCash retries the original request with the signed proof in the headers.
Making authenticated requests
Ask your agent to usefetch:
Use AgentCash fetch to call https://example.com/api/protected-endpoint.Or via CLI:
402.