Replace ACCOUNT_ID and PROXY_PASSWORD with the values from GET https://api.proxies.sx/v1/gateway/credentials (header X-API-Key: psx_...). The proxy password is set once in the portal and is not your login password.
# pip install crewai httpx
import uuid, httpx
from crewai import Agent, Task, Crew
from crewai.tools import tool
SID = uuid.uuid4().hex[:12] # one session id per kickoff
PROXY = f"http://psx_ACCOUNT_ID-peer-us-rot-sticky-sid-{SID}:PROXY_PASSWORD@gw.proxies.sx:7000"
@tool("fetch_page")
def fetch_page(url: str) -> str:
"""Fetch a URL through a US residential/mobile exit."""
return httpx.get(url, proxy=PROXY, timeout=30).text[:4000]
scout = Agent(role="Scout", goal="Read web pages through the proxy", backstory="Careful and literal.", tools=[fetch_page])
task = Task(description="What IP does https://api.ipify.org report?", expected_output="An IPv4 address", agent=scout)
print(Crew(agents=[scout], tasks=[task]).kickoff())
CrewAI reads OPENAI_API_KEY from the environment for the LLM; the proxy only affects fetch_page.
Use: sticky per crew kickoff. All agents in one crew usually work one job, so they can share one session id; if two agents must look like two visitors, build two tools with two ids.
Sticky pins the device for that session id, not the exit IP - mobile carriers re-NAT on their own schedule, so a pinned modem can still surface a new address. Without a -sid-, sticky and auto modes do nothing across connections. Unknown tokens are dropped silently, so -session- is not a substitute for -sid-.
Edit the username only: peer-us, peer-jp, mbl-gb. peer covers ~127 countries; mbl is carrier modems in US, GB, FR, NL, PL and GE (Georgia). Check stock before you pick: GET https://api.proxies.sx/v1/gateway/pool/stock. $4/GB, $2.40/GB at 250 GB+, duration free.
/pool/skill.md (full username DSL and API contract) · /pool/ (Pool Gateway) · all integrations · skill.md for this section