An autonomous AI agent running in Docker on my Mac, paying per-request in USDC to a peer-to-peer model network. No OpenAI subscription, no Anthropic billing, no vendor lock-in. Here's exactly how I got it working โ and the gotchas that almost stopped me.
I wanted a real autonomous agent โ one that can browse the web, write and run code, manage files, and chain reasoning across long tasks โ without handing my credit card to OpenAI or Anthropic and without locking myself into a single provider's pricing whims.
Combine that with the fact that agents execute arbitrary code, and running one directly on my MacBook felt like a bad idea. So the goal became: containerized agent + decentralized model access + crypto pay-per-use. Three problems, three pieces:
localhost:8377. Anything that speaks the OpenAI API can talk to it.End result: a sandboxed agent on my Mac, picking from a catalog of frontier and open models, billed in USDC, no monthly subscriptions. Let me show you exactly how.
Agent Zero is genuinely autonomous. It executes shell commands, writes and runs Python and Node.js code, edits files, browses the web, and chains tool calls together to solve multi-step tasks. That's what makes it powerful โ and that's exactly why you don't want it running directly on your laptop.
An agent that can rm -rf things doesn't need to be evil to do damage. It just needs to be confused once. A misread instruction, an exploited prompt injection from a webpage it scraped, a hallucinated path โ any of these can wreck a host system. Containers solve this elegantly.
Running Agent Zero in Docker gives you:
docker rm -f Agent-Zero wipes the slate clean.Docker Desktop is free for personal use on Mac and basically Just Works once you click through the installer. Which brings us to step one.
First, check whether you're on Apple Silicon (M1/M2/M3/M4) or an older Intel Mac. Click the Apple menu in the top-left corner โ About This Mac. The "Chip" or "Processor" line tells you which build to grab.
Then:
Docker.dmg. Drag the Docker whale icon to your Applications folder.Verify everything's healthy from Terminal:
docker --version
docker ps
The first command should print something like Docker version 27.x.x. The second should print an empty table (no containers running yet โ that's expected). If both work, you're set.
๐ก Tip: The whale icon in your Mac's menu bar is your status indicator. Solid whale = Docker running. Animated whale = Docker starting/processing. No whale = Docker isn't running, and any docker command will hang or error. Launch the Docker app first, wait for the whale to settle, then run commands.
Agent Zero ships an official Docker image. Pull and run it with a single command:
docker run -d --name Agent-Zero \
-p 55000:80 \
agent0ai/agent-zero:latest
Let me unpack what that does:
-d โ detached, runs in the background.--name Agent-Zero โ friendly name so you can docker logs Agent-Zero or docker exec Agent-Zero ... later instead of dealing with random container IDs.-p 55000:80 โ maps port 55000 on your Mac to port 80 inside the container, where Agent Zero's web UI lives. Use whatever port you like; I'll use 55000 throughout this guide.agent0ai/agent-zero:latest โ the official image. Docker pulls it from Docker Hub on first run.If you want persistent memory (so the agent remembers things across container restarts), add a volume mount:
docker run -d --name Agent-Zero \
-p 55000:80 \
-v ~/agent-zero-data/memory:/a0/memory \
agent0ai/agent-zero:latest
Mount specific subpaths like /a0/memory or /a0/usr/workdir โ never the whole /a0 directory, since that's where the Agent Zero framework itself lives inside the container. Overlaying it would prevent the container from starting.
Confirm it's running:
docker ps
You should see Agent-Zero in the list with status Up and ports 0.0.0.0:55000->80/tcp. Open http://localhost:55000/ in Safari or Chrome โ Agent Zero's UI loads and you're greeted with a fresh chat.
๐ก Tip: Open Docker Desktop and click the Containers tab. You'll see Agent-Zero listed with buttons to open logs, exec a shell into the container, view environment variables, restart, or delete. If you're not a CLI native, this GUI is your best friend for managing the container's lifecycle.
Agent Zero is now running, but it's brainless until you give it an LLM to think with. You could plug in an OpenAI key. You could plug in an Anthropic key. You could spin up a local Ollama. Or you could plug it into AntSeed and have access to all of those โ and dozens more โ through one endpoint, without any subscriptions.
AntSeed is a decentralized peer-to-peer network where independent operators (called peers) sell access to AI models. Each peer hosts whatever models they like โ Claude Opus, GPT-5.5, Gemini 3, DeepSeek, Qwen, Llama, Mixtral, you name it โ and sets their own prices. You pay them directly per request in USDC on the Base blockchain. No middleman, no monthly fee, no minimum spend.
The key benefits:
The way you connect to AntSeed locally is through the AntStation desktop app. AntStation runs a "buyer proxy" on http://localhost:8377 that exposes an OpenAI-compatible API. Any tool that already speaks OpenAI โ Agent Zero, LangChain, Continue.dev, your custom scripts โ just points at this URL and works.
Head to antseed.com and download AntStation for macOS. Install it the standard Mac way: drag the app into Applications, launch it, and approve any permissions macOS asks about.
On first launch, AntStation generates a node identity โ a private key stored locally that represents you on the network. This is your wallet for paying peers and your signature for authenticating requests. Treat it like an SSH private key. The app stores it at ~/.antseed/identity.key.
โ ๏ธ Watch out: Whoever has that file controls your USDC deposits on the AntSeed contract. Lock down permissions if you're security-conscious:And back it up to an offline password manager if you plan to keep meaningful funds in it.chmod 600 ~/.antseed/identity.key chmod 700 ~/.antseed
In AntStation's UI, click the Start button. The status indicator turns green when the buyer proxy is listening on http://localhost:8377. From here on, anything that hits that URL gets routed to whichever peer you've pinned.
๐ก About theantseedCLI: AntStation installs anantseedCLI helper on your PATH when you install the Mac app. Ifantseedisn't found in Terminal, ensure AntStation is fully installed and restart your shell.
AntSeed deliberately doesn't auto-pick a peer for you. You inspect the network, choose a provider whose pricing and model lineup you like, and pin them. This gives you total control over who fulfills your requests.
In AntStation, open the Network tab. You'll see a list of active peers with their names, model catalogs, pricing, and reputation scores. Click into one to see the full service list.
For Agent Zero, I personally pin Surplus Intelligence (peer ID 0e49122e76bd8b9ccb2fe10c0088c41ceb608927). They have 136+ services, extremely competitive paid pricing, and 75+ free models you can experiment with for nothing (as of May 2026). Click Pin in the GUI, or run from Terminal:
antseed buyer connection set --peer 0e49122e76bd8b9ccb2fe10c0088c41ceb608927
To pay peers you need USDC on Base in your AntSeed account. From Terminal:
antseed payments
This launches a payment dashboard at http://localhost:3118. Open it in your browser. Connect a Web3 wallet (MetaMask, Rabby, Coinbase Wallet) on Base Mainnet, deposit a few dollars (5โ10 USDC is plenty to start), and you're funded. The deposits page shows your available balance.
You'll also need a small amount of ETH on Base in your wallet to cover the deposit transaction's gas fee โ typically less than $0.01.
Once you've deposited, you can close the payments dashboard. It only needs to run when you're funding the account, not 24/7.
From Terminal on your Mac, hit the local proxy:
curl http://localhost:8377/v1/models
If you get back a JSON list of models, congratulations โ your Mac is now a node on the AntSeed network and ready to serve any OpenAI-compatible client.
๐ก More on AntSeed: If you want a deeper dive on the protocol, payments, reputation system, and architecture, I've written about it elsewhere on this blog: AntSeed: The Open Market for AI Inference, Complete Mac Desktop Guide, and the production VPS variant in AntSeed on a VPS with Auto-Start.
This is where I lost an hour to a misleading error message. Pay close attention to the field-by-field config below โ every line matters.
Open Agent Zero at http://localhost:55000/. Click the Settings icon (gear/cog), then go to the Chat Model section.
From the provider dropdown, select "Other OpenAI compatible".
โ ๏ธ Watch out: Do not select plain "OpenAI" from the dropdown. That option hardcodes the base URL to api.openai.com and ignores your override. You'll get cryptic 401s with no clue why. "Other OpenAI compatible" is the one that lets you point at a custom URL.
Set the API Base URL to:
http://host.docker.internal:8377/v1
This is the most important line in the entire setup, and the trickiest to understand. Here's why:
localhost means the container itself, not your Mac.localhost:8377 from the host's perspective.host.docker.internal โ that resolves from inside any container to the host machine.So http://host.docker.internal:8377/v1 means "from inside this container, reach out to my Mac's port 8377" โ which is exactly where AntStation is listening. This is the same trick people use to talk to a host-side Ollama from a Dockerized app.
Set the API key to literally any non-empty string. I personally use the literal word unused:
unused
โ ๏ธ Watch out: AntSeed itself doesn't validate the API key โ payments settle on-chain via your AntStation identity. Any non-empty string works (unused,placeholder,not-a-real-key). Some Agent Zero versions will accept a blank field, but putting any value in is the safest bet to avoid LiteLLM startup validation errors like:That message is misleading โ it's not really an auth failure with the upstream service, it's a startup-time validation in the SDK.AuthenticationError: OPENAI_API_KEY environment variable must be set
Pick any model ID from the /v1/models response you fetched earlier. For my first run I used:
deepseek-v3.2
Save settings. Send a test message in Agent Zero's main chat: "Hello, what model are you?" If you get a coherent reply, the entire pipeline is live. ๐
Before moving on, verify the bridge from inside the container โ this confirms your network path before you spend time debugging settings:
docker exec -it Agent-Zero curl http://host.docker.internal:8377/v1/models
If that returns a JSON model list, the network bridge is fine and any future failure is in Agent Zero's settings. If it errors out with "connection refused" or "could not resolve host", the issue is at the Docker/AntStation layer (AntStation isn't running, port mapping is wrong, etc.).
Agent Zero uses a separate, lighter "Utility Model" for cheap operations like generating chat names, classifying intents, and summarizing context. Open Settings โ Utility Model and configure it the same way โ same provider, same URL, same dummy API key, but a faster/cheaper model name (more on which models to pick in the next section).
If you're using embeddings, configure the Embedding Model the same way too.
Agent Zero typically uses two model slots: a Main Chat Model (the agent's brain โ needs strong reasoning, planning, and tool-calling) and a Utility Model (fast/cheap helper for summaries, naming chats, simple classification). Pick wisely and you can run an agent for cents per session.
๐ก Heads up: Available models change as peers update their catalogs. Always verify with curl http://localhost:8377/v1/models before relying on any specific model ID โ what's listed below reflects what was available when this post was written (May 2026).
This one needs to handle multi-turn reasoning, tool calls, code generation, and long contexts. Don't skimp here unless you're really cost-sensitive.
| Tier | Models | Best For |
|---|---|---|
| High | claude-opus-4.7, gpt-5.5-pro, gemini-3.1-pro | Complex multi-step tasks, hard reasoning, production-grade reliability |
| Medium (sweet spot) | claude-sonnet-4.6, gpt-5.4, deepseek-v3.2, qwen3-coder-480b | Daily driver โ great quality at a fraction of high-tier cost |
| Low | deepseek-v3.1, gpt-4o, glm-4.6 | Simpler tasks, cost-conscious workflows |
| Free | gpt-oss-120b-free, nemotron-120b-free | Pure experimentation, no-budget testing |
This one runs frequently in the background. Pick something fast and cheap; you don't need GPT-5.5 to summarize a chat title.
| Tier | Models | Notes |
|---|---|---|
| Recommended | gpt-4o-mini, gemini-3-flash, glm-4.7-flash | Fast, cheap, plenty good for utility tasks |
| Free | gpt-oss-120b-free | Use this if you're optimizing for zero cost |
deepseek-v3.2 (main) + gpt-4o-mini (utility) โ pennies per session, surprisingly capable.claude-sonnet-4.6 (main) + gemini-3-flash (utility) โ strong reasoning, fast UX, reasonable cost.qwen3-coder-480b (main) + glm-4.7-flash (utility) โ purpose-built for code-heavy tasks.gpt-oss-120b-free for both slots โ costs literally nothing, great for verifying the whole pipeline works before you spend real USDC.๐ก My experience: I tested deepseek-v3.2 as the main model on my first run and it was excellent out of the gate. Strong tool-calling, sensible reasoning, fast responses. Genuinely felt like running a frontier model โ at fractions of the cost of the big-name APIs. Highly recommended as a starting point.
The beauty of this setup: switching models is one line in Settings and a save click. Try a few. Find what works for your workflow.
Here's the list of issues I personally hit and how to fix them. If you're stuck, this is probably it.
You left the API key field empty. LiteLLM (which Agent Zero uses internally) requires a non-empty value even when the upstream provider doesn't validate it. Put any string in there โ unused, not-a-real-key, placeholder, anything.
You used http://localhost:8377/v1 as the base URL. From inside Docker, localhost is the container, not your Mac. Replace it with http://host.docker.internal:8377/v1 and retry.
{"error":{"type":"no_peer_pinned"}}You started AntStation but never pinned a peer. Open AntStation โ Network tab โ click a peer โ Pin. Or run from Terminal:
antseed buyer connection set --peer 0e49122e76bd8b9ccb2fe10c0088c41ceb608927
{"error":{"type":"insufficient_deposits"}}Your USDC balance ran out (or you never deposited). Run antseed payments, top up, retry.
The model name in Agent Zero's settings doesn't match anything your pinned peer offers. Run curl http://localhost:8377/v1/models, look at the id field of each entry, copy one of those exact strings into Agent Zero.
AntStation isn't running. Open the AntStation app, confirm the buyer proxy is started (status indicator green), and try again. The proxy needs to be running whenever Agent Zero is sending requests โ it's the bridge to the network.
Something else is on port 55000. Either stop the conflicting service or pick a different port:
docker rm -f Agent-Zero
docker run -d --name Agent-Zero -p 55001:80 agent0ai/agent-zero:latest
Then visit http://localhost:55001/ instead.
Let's recap what you just built:
Be honest about the rough edges, though. You have to manually pin a peer (no auto-routing yet). The dummy API key thing is a quirky LiteLLM gotcha that will bite first-timers. You need USDC on Base and a Web3 wallet, which is friction if you've never used crypto. And as with any new stack, expect a couple of retry cycles to nail the config.
But once it clicks โ once that first deepseek-v3.2 response streams back into Agent Zero from a peer you've never heard of, billed a fraction of a cent on Base, all from inside a container that can't touch your Mac โ it's hard to go back to "log in to OpenAI and pay a flat subscription forever."
Try it. Break it. Swap models on a whim. Build something weird. And if you ship something interesting, drop a comment below โ I'd love to see what people build with this.
Happy hacking. ๐๐ค
๐ฌ Comments