Perplexityapi
December 3, 2026·Source

Code Mode in the Perplexity Agent API

The agent now writes a short script to run several tools at once, instead of calling them one at a time. For developers.

Code Mode in the Perplexity Agent API announcement image
  • The script processes results and returns only the final output to the model
  • Works with any enabled tool, including web search, page fetch, people search, finance data, and sandbox files
  • On by default at the high, xhigh, and ultra effort levels; custom requests add programmatic_tool_calling
  • Perplexity reports a 31% lower task cost at xhigh effort on its own research test

Best for

Research tasks that need many searches and lookups before an answer.

When to use it

Your agent runs are slow or expensive because of repeated tool calls.

Who benefits

Developers building on the Perplexity Agent API.

Join the newsletter to get ahead with AI.

I share strategies, new modules, free guides, and tools to get you better at using AI in your work.

Leading a team? See team programs →