# agproxy

> Preferred location: /agents.md (this text is also served at /llms.txt).

> Residential proxies for AI agents: buy a pack of traffic (gigabytes) and get a proxy login, or fetch one URL from a residential IP. Each call is paid in stablecoins: x402 on Base and Polygon or MPP on Base. No API keys, accounts or subscriptions.

## When to use this service

- Use proxy packs when an HTTP client or browser needs to send its own requests through residential IPs, with a chosen country or a session IP. Use raw fetch when you need one URL requested from a residential IP and want its unprocessed HTTP response.
- Do not use it for JavaScript rendering, browser fingerprints, or pages that require solving bot challenges; fetch is a plain HTTP client. Do not use the proxy to reach private, loopback, link-local, or local-name destinations.

## How a call is paid

- POST the JSON body to the endpoint with no payment. The 402 answer carries the quote for exactly what you asked, in the `PAYMENT-REQUIRED` header (x402) and in a `WWW-Authenticate: Payment` challenge (MPP). Sign one and POST the same body again with `PAYMENT-SIGNATURE` (x402) or `Authorization: Payment` (MPP). Every endpoint answers on `/x402/<name>` and on `/mpp/<name>`; both protocols are accepted on both.
- The payment settles only after the call succeeded. A call that cannot be served (no exit, a refused tunnel, no capacity) is not charged. Retrying with the same payment returns the stored answer.
- Errors the service itself produces are JSON: `{"error": code, "message": text}`. A request body over 64 KiB is refused (413).

## Proxy packs

- POST `/x402/proxy` (or `/mpp/proxy`) with `{"gb":1,"country":"DE"}`. `gb` is a whole number of gigabytes, 1 to 100 (default 1); `country` is an optional two-letter default exit country.
- The answer is a JSON array with one record: `host`, `port`, `tls_port` (only when the proxy inside TLS is offered), `protocol` (`http`), `username`, `password`, `country`, `cap_bytes`, `expires_at` and an `example` curl line. The password is shown once, in this answer; retrying the same payment returns the same login. The login works as soon as the payment has settled (a few seconds).
- Use it as an HTTP proxy: `curl -x http://USERNAME:PASSWORD@HOST:PORT https://example.com/`. HTTPS targets go through CONNECT, plain http targets through the proxy request. When `tls_port` is present it is the same proxy inside TLS (an `https://` proxy URL) for clients that should not send the password in the clear.
- Username options, appended with dashes: `-country-DE` picks the exit country (any two-letter code the network has), `-session-TAG` keeps one exit IP for connections that use the same tag (letters, digits, underscore), `-ttl-60` is how many minutes a session lasts (1 to 180, default 30). Without a session tag every connection gets a new IP. Example: `ap_0123456789abcdef-country-DE-session-job1`.
- Traffic counts on both directions through the upstream, including the tunnel set-up. A pack ends at its byte cap or after 90 days; an open connection is closed when the cap is reached and a new one gets `402` with the way to buy more. `GET http://usage.agproxy/` through the proxy, or `GET /v1/usage` on this site with the proxy username and password as HTTP Basic auth, returns `{used_bytes, cap_bytes, remaining_bytes, expires_at}` and uses no traffic.
- Not reachable through the proxy: private, loopback and link-local addresses and local names. A name the service refuses answers `403` with the reason; wrong or missing credentials answer `407`; a pack whose payment has not settled yet answers `407` with that text.
- When the service has no capacity left the quote is refused with `503` and the gigabytes that are left; ask for fewer or try later.

## Fetch

- POST `/x402/fetch` (or `/mpp/fetch`) with `{"url":"https://example.com/","method":"GET","country":"DE","max_mb":1}`. `url` is required; `method` is GET (default), HEAD or POST; `headers` is an object of request headers; `body` is the POST body (at most 1 MiB); `country` is a two-letter exit country; `max_mb` is 1 to 10 (default 1) and is what the quote scales with.
- The answer is a JSON array with one record: `status`, `final_url`, `headers` (content-type, last-modified, etag, location, cache-control and a few more), `body` (UTF-8 text) or `body_base64` (anything else), `bytes`, `truncated` (true when the body was cut at `max_mb`), `elapsed_ms` and `wire_bytes`.
- Any answer of the target, 403 and 404 included, is delivered and charged by the traffic it took, rounded up to whole megabytes (at least one); the rest of the quote is refunded on-chain to the paying address. A request that fails on the way is not charged: `502`. A target that answers 403 or 429 is tried once more from another IP. Up to 5 redirects are followed.
- It fetches the page as a plain HTTP client does: no JavaScript is run and no browser fingerprint is sent. For pages behind bot protection or that need rendering, use agdata's unblock endpoint at https://agdata.shveik.dev/agents.md.
- A call takes a few seconds and up to 25 s. It is not offered on Solana: pay on Base or Polygon.

## Limits and reliability

No uptime SLA; service and upstream availability are best-effort. A quote is shown before payment, and work starts only after settlement. A request refused before settlement is not charged; product-specific refunds for partial results, orders and deals follow the docs. Raw fetch times out after 25 seconds; delivered target responses are charged by traffic and failed fetches are not charged. Free GET docs, guides, pricing and discovery pages allow 120 requests per client IP per minute and return RateLimit headers; HTTP 429 includes Retry-After. GET /health is a liveness check. HTTP 402 means payment is required, 502 means delivery failed, and 503 means the service cannot accept work; follow Retry-After when present. Report problems at /contact.

## Try also agdata

- Need the page rendered, unblocked and returned as Markdown, or structured data from social, maps, search, news and jobs? agdata does that, paid the same way. Site: https://agdata.shveik.dev, docs: https://agdata.shveik.dev/agents.md

## Endpoints

- [POST /x402/proxy](/docs#fetch): Residential proxy pack. Example body: `{"gb":1}`
- [POST /x402/fetch](/docs#fetch): Raw fetch from a residential IP. Example body: `{"max_mb":1,"url":"https://example.com/"}`

## Machine-readable

- [OpenAPI 3.1](https://agproxy.shveik.dev/openapi.json): full request schemas and x-payment-info
- [x402 manifest](https://agproxy.shveik.dev/.well-known/x402)
- [MCP tools](/docs#mcp): one tool per endpoint, payments with x402 inside the tool call
- [Health](https://agproxy.shveik.dev/health)

## Feedback

- Free, no payment: POST `https://agproxy.shveik.dev/feedback` (or the MCP tool `feedback`) with `{"message":"what you want to tell us","kind":"bug|idea|praise|other","route":"optional route name","contact":"optional"}`. `message` is required (2000 characters at most); `route` is one of the routes above. A person reads it. Please say what worked, what failed (the route, what you sent, what came back) and what you miss; send no secrets or private data. Limited to a few messages an hour per caller.
