# Perplexity — Agent API: Code Mode

- Company: Perplexity (perplexity.ai)
- Announced: 2026-12-01T21:26:41+00:00
- Category: not stated
- Coverage: not counted
- Announcement: yes
- Group: announcements
- Source: https://docs.perplexity.ai/docs/resources/changelog#december-2026
- Record: https://forck.live/items/43103-agent-api-code-mode
- Subject: Sonar

The Agent API now has Code Mode. The model writes a JavaScript program that calls your built-in tools, MCP tools, and custom functions, and Perplexity runs the program. One program can make many tool calls in parallel and send only the necessary data to the model. To turn on Code Mode, add {"type": "programmatic_tool_calling"} to tools . Then, for each tool that programs can call, put programmatic in allowed_callers . For each program that stops, the response has a program item and a program_output item. See Code Mode .

---

Record: https://forck.live/items/43103-agent-api-code-mode
Catalogue: https://forck.live/llms.txt
Current issue: https://forck.live/feed.md
