Start from a preset
A preset is a Perplexity maintained bundle of Agent API settings that packages together a model, search config, reasoning steps, system prompt, and available tools. Perplexity updates the underlying configurations as evaluations improve, and your calls receive the updates without needing to adjust your code. What if the chosen preset doesn’t quite meet all of your needs? Imagine, for instance, that you found a preset configuration that almost perfectly meets your needs, with the exception of one or two fields that you’d like to tune. You can pass your preset by name and then modify only the fields that need adjustment. All the other preset fields will continue to use their defaults.Check the prerequisites
You need Python 3.10 or newer, theperplexityai library installed, and an API key exported as PERPLEXITY_API_KEY. Create the key at console.perplexity.ai/group/keys. If you have never called the API before, run through the Perplexity API quickstart first.
Run a basic example
Every example in this tutorial uses thelow preset unless noted. Start by calling it with nothing but a prompt.
low preset supplies the model, search config, reasoning steps, system prompt, and available tools. Your request adds only the input.
Customize a preset in two moves
Two techniques cover almost every real customization: override a top-level field, and adjust options for one tool. The last section shows how to inspect what ran.1. Override one parameter
Override a parameter when the preset almost fits but one field needs to change. Pass that field on the request; every other field keeps its default value.low documents a low max_steps default (check the current presets documentation for the current value). Raise the ceiling when a task needs more reasoning or tool-use iterations:
2. Adjust options for one tool
Adjust tool options when the preset’s tool set is right for the job but one tool needs tuning. Pass a partial entry for that tool and the preset’s other tools stay attached.low invokes fetch_url by default when a prompt names a URL. Pass a partial web_search override and fetch_url still runs:
perplexityai==0.43.3:
web_search, but fetch_url is what actually ran because the prompt asked to read a URL and fetch_url is the tool for that job. The evidence is usage.tool_calls_details: fetch_url appears there even though the request never passed a fetch_url entry. That is tool merging. To also tune fetch_url, add a fetch_url entry to tools alongside web_search.
Put both moves together: an evidence-based rollout decision
Let’s tie these concepts together. Suppose the performance lead for a CPU-bound service is deciding whether to pilot Python 3.14’s free-threaded build.low is a good base, but this task needs more reasoning room (an override) and deeper context from two specific technical pages (a tool merge).
A representative live run on August 19, 2026 with
perplexityai==0.43.3 produced this brief (response.output_text):
Inspect what actually ran
You need a way to check what the API actually served. Readresponse.model for the backing model, response.usage.tool_calls_details for the tools that ran, and response.usage.cost.total_cost for the billed amount. The response does not expose the effective system prompt, max_steps, reasoning, or the full inherited tool set, so treat this as inspection of the observed run rather than of the preset’s configuration.
perplexityai==0.43.3:
Summary
Presets give you a maintained Agent API configuration you can call by name. Override one field to change one thing without losing the other defaults. Merge tool options to tune a tool while keeping the preset’s other available tools attached. Readresponse.model and response.usage.tool_calls_details to inspect your calls.