{"type":"rich","version":"1.0","provider_name":"Transistor","provider_url":"https://transistor.fm","author_name":"This Week in NET","title":"Code Mode: Giving AI Agents an Entire API in 1,000 Tokens (With Demos)","html":"<iframe width=\"100%\" height=\"180\" frameborder=\"no\" scrolling=\"no\" seamless src=\"https://share.transistor.fm/e/14a252fe\"></iframe>","width":"100%","height":180,"duration":2547,"description":"In this episode of This Week in NET, host João Tomé is joined by Matt Curry to break down Code Mode: a way to give AI agents access to the entire Cloudflare API (2,500+ endpoints) using two tools and roughly ~1,000 tokens of context.  ￼\n\nInstead of exposing thousands of individual tools (which quickly becomes expensive and brittle), Code Mode lets the model write JavaScript to search and execute against a compact API context. The result is massive compression, lower cost, and better performance.\n\nWe also include demos showing how agents can query real infrastructure, navigate multiple accounts, and build things like multiplayer experiences using Durable Objects and WebSockets.\n\n⏱️ Timestamps \n0:53 — Intro: agents, MCP, tokens, and what Code Mode means\n2:53 — Why exposing 2,500+ endpoints as tools doesn’t scale\n6:49 — How Code Mode works: generate an SDK and let the model write code\n9:57 — Demo: querying deployed Workers and infrastructure\n14:37 — Multiplayer with Durable Objects (live demo “wow” moment)\n24:32 — Compression stats: 2 million tokens → ~1,000 tokens\n27:26 — Code Mode SDK v2 and wrapping your own APIs\n31:52 — The Sandbox: running untrusted code safely\n38:03 — What’s next: progressive disclosure and MCP evolution\n\nMentioned blog posts:\nCode Mode: give agents an entire API in 1,000 tokens","thumbnail_url":"https://img.transistorcdn.com/JEk1CAhFcWIBJOFKIzKfdvQ-zUX6aXTuOCJVJJHruOk/rs:fill:0:0:1/w:400/h:400/q:60/mb:500000/aHR0cHM6Ly9pbWct/dXBsb2FkLXByb2R1/Y3Rpb24udHJhbnNp/c3Rvci5mbS9jYThl/MjA0YjY3NjRjMzE4/NTdlZTdjMzFjNjll/YTM1YS5wbmc.webp","thumbnail_width":300,"thumbnail_height":300}