Blog/Search & RAG
5 min read

Rotating Proxy for AI Agents: Do You Need One or a Fetch Call?

Rotating proxy for an AI agent: what it does, how to rotate in Python, and the fetch call that picks the exit country for you, billed per page.

Rotating Proxy for AI Agents: Do You Need One or a Fetch Call?

Read a defended page from a chosen country without buying a proxy pool. Paste this into your agent:

Set up https://monid.ai/SKILL.md, and then use Monid to fetch https://ipinfo.io/json as seen from Germany and from the US, and tell me the city and network each request came from.

One prompt replaces a proxy account. 1 min setup · 10-20 hrs saved.

You are building an agent that reads web pages, some of them refuse it, and the advice you keep finding is to buy a rotating proxy. This guide explains what a rotating proxy does, shows the Python for rotating one yourself, and then tests the alternative: a fetch call that picks the exit country for you. We ran it from Germany and from the US on 2026-10-16 and read back where each request came from. It runs through Monid, the OpenRouter for agent tools: one key, one balance, every tool priced per call.

Do you need a rotating proxy for an AI agent, or is there an easier way?

Probably not, if what the agent needs is a page rather than an address. A fetch endpoint on Monid leaves from a proxy exit that it chooses, renders the page and returns text, so there is no pool to buy and nothing to rotate. Use a proxy when the address is the product; use a fetch call when the page is.

  • Pay per call. A page costs $0.002533 (Verified 2026-10-16 on the web extraction tools page). The endpoint's note says premium proxies are included and failed or blocked requests are not billed. You buy calls as you need them: no monthly plan and no minimum top-up. Discovery and inspection are free; only a run bills.
  • One install, every tool. The same key and balance call the fetch endpoints and every other tool on Monid, so there is no proxy account to open, fund and monitor next to your other vendors.
  • Lives inside your agent. Install the CLI, add your key, run the prompt above, and your agent has a fetch tool on demand, with a country option and no gateway to run. Your agent reads SKILL.md and learns the rest, so setup is about a minute.

At that price a thousand pages cost about $2.53 (Verified 2026-10-16).

What is a rotating proxy, and what does it do?

A rotating proxy is a gateway that sends each request out from a different IP address taken from a pool, so the site you call sees a different origin each time. You connect to one host and port with credentials, the provider picks the exit address, and the response comes back down the same connection.

Datacentre, residential and mobile

Where the pool comes from is the whole pricing story. Datacentre addresses belong to hosting companies: cheap, plentiful and the easiest for a site to recognise as automated. Residential addresses belong to consumer connections, so they look like ordinary visitors and cost more. Mobile addresses sit on carrier networks and cost the most.

We saw the difference in three plain requests on 2026-10-16, each to a page that prints the address it was called from. The Germany request left from a Deutsche Telekom line in Ludwigsburg, and its reverse-DNS name sat under a consumer access domain. The US request left from a New York telecom network. A free fetch with no proxy of its own left from an Amazon datacentre in San Jose, and its hostname said compute.amazonaws.com. A site that blocks datacentre ranges sees the third request for what it is, and the first two as people.

How the pool is billed

Residential and mobile pools are usually sold by bandwidth. You pay for the bytes that cross the connection whether or not the page you wanted came back, so a block, a challenge page and a success all cost something. Datacentre pools are often sold per address or per month, which is easier to budget for a resource that is worse at the job. Neither unit measures pages retrieved, which is what you wanted.

Worked example with a stated assumption: at 2 MB a page, a gigabyte is 500 fetches. Divide your per-gigabyte price by 500 and compare the result with $0.002533 a page (Verified 2026-10-16), then remember that your figure also pays for every attempt that failed.

Where the addresses come from

Residential pools are built from real people's connections, usually through software those people installed for another reason. Providers differ in how they source and audit this, and it is worth reading before you buy. If your own product will be judged on data provenance, the provenance of the pipe counts too.

📖 See also Datacenter Proxies vs Residential: Which One Does the Job

How do you rotate proxies in Python?

You point your HTTP client at the gateway and let the provider rotate, or you rotate a list yourself. With requests it is a proxies dictionary, and the mechanics are a few lines.

import itertools
import requests

proxies = itertools.cycle([
    "http://user:pass@proxy-1.example:8000",
    "http://user:pass@proxy-2.example:8000",
    "http://user:pass@proxy-3.example:8000",
])

def fetch(url, tries=3):
    for _ in range(tries):
        p = next(proxies)
        try:
            r = requests.get(url, proxies={"http": p, "https": p}, timeout=15)
            if r.status_code == 200:
                return r.text
        except requests.RequestException:
            pass
    return None

In Selenium or Playwright the proxy is a launch argument, and the same cycle applies: pick an address, start the browser with it, discard it when the page fails.

What you inherit once it works

A list of credentials to rotate and expire, a bandwidth budget to watch, a retry policy that you wrote and that nobody tests, and a failure mode you cannot see: a block looks the same as a slow page until you read the body. None of it is hard on its own. Together it is a system whose output is page text.

The version where the fetch is the endpoint

What it does. Returns the page, with the exit address, the browser and the retry on the provider's side of the call.

The endpoints. context.dev/web/scrape/markdown, context.dev/web/scrape/html, and octen/extract for batches.

The call.

monid inspect -p context.dev -e /web/scrape/markdown

monid run -p context.dev -e /web/scrape/markdown \
  --query '{"url":"https://example.com","useMainContentOnly":true}' -w

What comes back. success, markdown, contentLength, url, a metadata object carrying sourceUrl and finalUrl, a cache_metadata object with status and age_ms, finalDOMState and a request_id. Verified against live runs on 2026-10-16.

For agents

Grab an API key at app.monid.ai, then paste this to your agent and hand it the key:

set up https://monid.ai/SKILL.md

It learns the whole discover, inspect, run workflow itself. More in the agent quickstart.

For humans

npm install -g @monid-ai/cli
monid keys add -k <your-api-key> -l main

📖 See also Python Web Scraping Without a Scraper: Fetch Any Page as Data

Can you choose the exit country without owning a proxy pool?

Yes: the scrape endpoints take a two-letter country code, and we confirmed it by reading back the address each request came from. The endpoint's description says the code must be one of Context.dev's supported countries.

monid run -p context.dev -e /web/scrape/markdown \
  --query '{"url":"https://ipinfo.io/json","country":"de","maxAgeMs":0}' -w

monid run -p context.dev -e /web/scrape/markdown \
  --query '{"url":"https://ipinfo.io/json","country":"us","maxAgeMs":0}' -w

What we saw on 2026-10-16:

RequestExit cityNetworkAddress type
country: "de"Ludwigsburg, DEDeutsche TelekomConsumer access line
country: "us"New York City, USA US telecom networkNot named in the page
tinyfish/fetch, no country optionSan Jose, USAmazonDatacentre

Set maxAgeMs to 0 when you test this. The default reuses a cached copy for a day, and a cached page tells you nothing about where a fresh request would come from. Each context.dev call billed 1 unit, or 2,533 micro-dollars, which is $0.002533 (Verified 2026-10-16), so the two country checks cost twice that. The free fetch billed nothing.

This covers the common reason people shop for a rotating proxy: seeing a page as a visitor from one country sees it. Prices, language, consent banners and stock lists change with the exit, and a country parameter is enough to compare them. It does not give you a city, a carrier or a specific address; the US call landed in New York and the parameter did not ask for it.

📖 See also Node Unblocker Proxy: Fetch a Blocked Page From Your Agent

Rotating or sticky: which does your job need?

Sticky more often than people assume. A rotating setup gives a new address per request; a sticky one keeps the same address for a window, usually a few minutes. The deciding question is whether the target has to recognise you across requests.

Rotate when every request is independent: a list of unrelated URLs, a wide crawl, a batch of lookups where nothing carries over. Rotation spreads the load and no request cares about the last one.

Stick when there is a session. A login, a cart, a cursor-based pagination or a multi-step form breaks when the address changes underneath it, and the failure looks like the site logged you out at random. A static residential address held for the whole job is what you buy when the session lasts hours.

A fetch call sits on the rotating side of this line: each call is its own request, and the exit is the provider's choice, so two calls with the same country can leave from different addresses. For a job with state, such as a logged-in flow, use a hosted browser session instead, which keeps one browser and one identity for the length of the session. The Browserbase session endpoint returns a connectUrl you attach Playwright to, and its listed price is $0.011 per call (Verified 2026-10-16). We inspected it and did not run it.

📖 See also Browser Automation Without an API

What goes wrong when a rotating proxy does not fix the block?

Most failures are not about the address. Rotation changes where a request appears to come from; it does not change what the request looks like. These are four ways it goes wrong.

Why does a clean residential address still get blocked?

Modern bot detection reads the shape of the connection and the browser fingerprint along with the address, so an obviously scripted client on a perfect residential IP is still an obviously scripted client. Teams add a proxy, see no improvement and buy a bigger pool, when the address was never the failing part. The fetch endpoints in this post are described as bundling rendering, anti-bot handling and proxies, which is why the three come as one call rather than three purchases.

Why does a proxied request return an empty page?

Because rotation does nothing about rendering. If the content arrives through JavaScript after load, a proxied requests call returns the same empty shell from a nicer address. Check whether the body is a block or an empty render before you change the pool.

Why does the bill grow faster than the page count?

Bandwidth pricing charges for attempts. Every retry, every challenge page and every redirect chain adds bytes, so cost scales with failures as well as with results. A per-page price that excludes failures moves that risk to the provider: the context.dev note says failed or blocked requests are not billed, and Octen's note says a failed URL is free. We did not trigger a failure in this post.

Why is the free fetch the wrong tool for a defended page?

The TinyFish fetch left from an Amazon datacentre address, and its note says it has no anti-bot bypass: protected pages fail on it with bot_blocked. That is the datacentre trade-off in one endpoint. It is free and fine for open pages, and it is the wrong tool for a page that blocks datacentre ranges.

📖 See also Your Scraper Is Blocked: Why You Get a 403 and What Gets Through

Which endpoint should I use for which job?

JobEndpointInputOutputBillingPrice
One defended page to markdown, from a chosen countrycontext.dev/web/scrape/markdownurl, country, useMainContentOnly, maxAgeMs, waitForMsMarkdown plus page metadataPer call, failures not billed$0.002533 (Verified 2026-10-16)
Rendered HTML for your own parsercontext.dev/web/scrape/htmlurl, country, waitForMs, maxAgeMsFully rendered HTMLPer call, failures not billed$0.002533 (Verified 2026-10-16)
Up to 20 URLs in one requestocten/extracturls, optional queryMarkdown or text per URLPer URL extracted, failures free$0.001 (Verified 2026-10-16)
Up to 10 open URLstinyfish/fetchurls, format, ttlText per URLPer call$0.00 (Verified 2026-10-16)
A job that needs one sessionx402.browserbase.com/browser/session/createestimatedMinutesA browser session to attach toPer call$0.011 (Verified 2026-10-16)

Every price was Verified 2026-10-16 with monid inspect, and current figures are on monid.ai/tools. We ran the context.dev Markdown endpoint and TinyFish, and inspected the other three.

When is another route a better fit?

The address is the requirement. If your job is to see a site from a city, a carrier or a specific address, a country code is not enough, and you need a proxy product where you control the exit.

The protocol is not HTTP. Fetch endpoints return web pages. A socket service, a mail server or a game protocol needs a real proxy, and nothing in this post applies to it.

You run sustained volume against one target. Providers often quote a committed plan for large, steady traffic, and at the top end a plan you negotiate can beat any per-page price. If you have the engineering to operate it, take the plan and keep a fetch endpoint for the long tail.

You need the same identity across many requests. A fetch call is stateless. Use a hosted browser session for that.

And the disclosure: we resell these endpoints. Most teams asking whether they need a rotating proxy want the page, and for them buying the proxy also means buying its operating cost.

Conclusion

You need a rotating proxy only when you need an address. If your agent needs a page, the quickest route is one fetch call through Monid: $0.002533 a page (Verified 2026-10-16), a country option that we confirmed by reading back the exit address, one key for this and every other tool, and about a minute to set up.

Two things matter more than the choice. Read the address you actually got: the free fetch left from a datacentre, the Germany request from a consumer line, and that difference decides whether a site lets you in. And price the outcome, not the input, since a gigabyte of bandwidth pays for blocked attempts and a billed page does not.

How we estimated the time saved: choosing a proxy provider, wiring rotation and retries into your code, and adding a renderer so JavaScript pages work is roughly 10 to 20 hours for most teams, before the first month of upkeep. The 1 minute is the install, key and first call once you already have a Monid key.

Free next step: run monid inspect -p context.dev -e /web/scrape/markdown, then make one call against https://ipinfo.io/json with country set and read the network name in the reply. Start at monid.ai.

FAQ

Is there a free rotating proxy?

Public free proxy lists exist, but you cannot know who operates the exit your traffic passes through, so they are a poor choice for anything you care about. For free page fetching rather than free addresses, the TinyFish fetch endpoint on Monid is $0.00 per call (Verified 2026-10-16) and takes up to ten URLs, with no anti-bot bypass. In our test it left from an Amazon datacentre address.

What is the difference between a rotating and a static residential proxy?

A rotating residential proxy gives a different consumer address per request; a static one gives the same consumer address for as long as you hold it. Rotating suits many independent requests, static suits a job with a session that must not change identity. Static addresses are usually sold per address rather than only by bandwidth, which is easier to budget.

Is there a rotating proxy with pay as you go pricing?

Some providers sell prepaid bandwidth with no monthly commitment, which is pay as you go per gigabyte, so blocked attempts still cost you. Through Monid the fetch endpoint is billed per page at $0.002533 (Verified 2026-10-16), with no monthly plan and no minimum top-up, and a blocked request is not billed.

Do I need a proxy to scrape with Selenium?

Not usually, and reaching for one first is a common misdiagnosis. Selenium already solves rendering, so if pages still fail, check whether the response is a block or an empty render before you buy addresses. When you need both a browser and an address you did not source, a hosted session such as the Browserbase endpoint gives you a connectUrl to attach Playwright to.

Published August 2026.

rotating proxyresidential proxyrotating proxy pythonai agentsweb scraping