{"version":1,"type":"story","url":"https://digestai.news/story/perplexity-adds-code-mode-to-agent-api-cuts-benchmark-cost-by-up-to-53","json":"https://digestai.news/story/perplexity-adds-code-mode-to-agent-api-cuts-benchmark-cost-by-up-to-53.json","markdown":"https://digestai.news/story/perplexity-adds-code-mode-to-agent-api-cuts-benchmark-cost-by-up-to-53.md","slug":"perplexity-adds-code-mode-to-agent-api-cuts-benchmark-cost-by-up-to-53","headline":"Perplexity adds Code Mode to Agent API, cuts benchmark cost by up to 53%","summary":"Perplexity released Code Mode in its Agent API on December 2, 2026. The feature lets models replace repeated tool‑call round‑trips with JavaScript programs that run enabled tools in parallel and filter results before they reach the model context. The company reports benchmark cost reductions of up to 53% and higher research scores compared to earlier presets.\n\nIn experiments on the first 100 of 500 WANDR tasks, the new mode achieved 47.7% soft recall at $0.38 per task, 2.9 percentage points above the baseline. Background execution returns partial output after 10 seconds, allowing agents to pursue other research branches while scripts run in the background. Median duration fell 12.5%, from 28.9 to 25.3 minutes, and the 95th percentile dropped 40.9%.\n\nThe change requires a programmatictoolcalling object in the tools array of a POST /v1/agent request and programmatic in the allowedcallers array of each tool. Code Mode is enabled by default in the latest high, xhigh and ultra effort levels and can be used in custom Agent API requests.","keyPoints":["Code Mode cuts benchmark cost by up to 53% by running tools in parallel","Soft recall reached 47.7% at $0.38 per task, 2.9 points above baseline","Median duration fell 12.5%, 95th percentile dropped 40.9%"],"whyItMatters":"The feature can reduce compute costs and speed up research agents, making advanced AI tools more efficient for developers and enterprises.","category":{"slug":"agents","name":"Agents & Tools","url":"https://digestai.news/category/agents"},"entities":{"companies":["Perplexity"],"models":[],"people":[]},"firstPublishedAt":"2026-12-02T20:32:07Z","updatedAt":"2026-12-02T20:32:07Z","sourceCount":1,"hasPrimarySource":false,"sources":[{"outlet":"Unite.AI","title":"Perplexity Adds Code Mode to Agent API for Parallel Tool Calls","url":"https://unite.ai/perplexity-adds-code-mode-to-agent-api-for-parallel-tool-calls","publishedAt":"2026-12-02T20:32:07Z","type":"press","primary":false,"lead":true}],"sourceNotes":null,"discussions":[],"thread":{"title":"Perplexity launches Monitor API for continuous web tracking via webhook","url":"https://digestai.news/thread/perplexity-launches-monitor-api-for-continuous-web-tracking-via-webhook","storyCount":2},"cite":{"text":"Digest AI, \"Perplexity adds Code Mode to Agent API, cuts benchmark cost by up to 53%\", 2 December 2026, https://digestai.news/story/perplexity-adds-code-mode-to-agent-api-cuts-benchmark-cost-by-up-to-53","publisher":"Digest AI","title":"Perplexity adds Code Mode to Agent API, cuts benchmark cost by up to 53%","datePublished":"2026-12-02T20:32:07Z","url":"https://digestai.news/story/perplexity-adds-code-mode-to-agent-api-cuts-benchmark-cost-by-up-to-53"},"generatedBy":"Written by Digest AI's editorial model from the linked sources; the sources are the record.","license":"Headlines, digests and key points are written by Digest AI and may be quoted with a link to the story page. Linked articles belong to their publishers. Terms: https://digestai.news/terms#reuse"}