changelogPerplexity AI

Perplexity adds Code Mode to Agent API, cutting benchmark costs by up to 53%

TL;DR

Perplexity introduced Code Mode in its Agent API on December 2, 2026. Models can write JavaScript programs that run enabled tools in parallel instead of making repeated tool-call round-trips. Perplexity reports higher research scores and benchmark cost reductions of up to 53% against its earlier presets.

1 min read
0

Perplexity introduced Code Mode in its Agent API on December 2, 2026. The company reports higher research scores and benchmark cost reductions of up to 53% against its earlier presets, according to Unite.ai.

How Code Mode works

Code Mode lets models replace repeated tool-call round-trips with JavaScript programs. These programs run enabled tools in parallel and filter the results.

In API requests, the feature is identified as programmatic_tool_calling. Scripts run inside an embedded QuickJS WebAssembly runtime within the agent loop.

Reported results

Perplexity reports two outcomes against its earlier presets:

  • Higher research scores
  • Benchmark cost reductions of up to 53%

These figures are Perplexity's own claims. Specific benchmark names and per-benchmark scores are not given in the available summary.

What this means

Code Mode changes how the Agent API handles tool use. Instead of the model calling tools one round-trip at a time, a single JavaScript program can run several enabled tools in parallel and filter their output. Perplexity ties this approach to its reported cost reductions of up to 53% on benchmarks. Developers using the Agent API can opt in through the programmatic_tool_calling identifier in their requests. The 53% figure is the upper bound of Perplexity's reported savings, so actual cost reductions will depend on the workload.

Source: unite.ai ↗

Comments

Loading...