Run ads from Codex
Codex-style agents get a real ad account surface through ztdsp, MCP, and REST. They prepare campaigns and read performance. You complete hosted payment in the browser.
Published 2026-09-09 · Search job: Codex campaign launch
A Codex-style agent launches ads by calling the public Adprime Zero API, not by writing a plan that never becomes an object.
/lp/run-ads-from-codex is the paid funnel. This guide is the operating page: how a code-capable agent discovers the service, stores a key, stops at a funding URL, and iterates from reports.
Why a code agent is a good fit
Codex already lives in a terminal. npx -y ztdsp agent-guide and npx -y ztdsp --help are the first two commands. The agent should read those before it guesses route names. Agent quickstart is the same map in docs form.
Configure ADP_ZERO_API_URL to the production API and ADP_ZERO_API_KEY as a secret. Direct REST clients need a normal User-Agent header, for example your-agent-name/1.0. Anonymous runtime defaults can be rejected before the request reaches the Worker.
MCP is optional and useful. ztdsp mcp exposes register_account, request_prepay_link, targeting, creative, campaign, conversion, and performance tools. Every tool call that changes account state goes through the public REST API with the same key. There is no hidden agent permission system.
Launch sequence
- Register or connect the account. Store the
ak_...key once, in the user's secret storage. - Collect landing URL, offer, geography, daily budget, and image assets from the user. Do not invent a click URL.
- Pre-check the destination, then
ztdsp creative submitwith headline, description, expected content, and disclosure. - Discover segments with
ztdsp targeting discover-segmentswhen the user asked for an audience. Use returned ids. Show estimated data CPM. - Create targeting and the campaign.
- If balance is missing,
ztdsp fund --dollars --openand wait onztdsp fund-status --watch. Do not collect cards. - After activation,
ztdsp campaign performance --jsonandztdsp reporting beeswax status.
Copy a campaign when the next test would contaminate the first. Rotate creatives through ztdsp campaign creatives. The last active creative cannot be paused or removed.
What Codex must not do
It must not write Beeswax campaign or line-item IDs by hand. It must not embed the API key in a browser pixel. It must not treat generated_at as provider freshness. It must not optimize on CTR from a remnant flight. It must not enable conversion-based optimization until an event exists, a test fire has succeeded, and the campaign is linked.
If the environment is Cursor instead of Codex, use Launch ads from Cursor. If you are still choosing how any agent attaches, use Run ads from an AI agent. The daily operating loop after attach is How an agent buys ads.