agent_create
Create agent responses with Perplexity's Agent API, supporting multi-step reasoning, web search, URL fetching, and custom function tools.
Instructions
Create an agent response using the Perplexity Agent API (POST /v1/agent). Supports multi-step agentic reasoning with web search, URL fetching, and custom function tools. Either model, models, or preset must be provided.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Input string or array of message objects ({role, content}). | |
| model | No | Model in provider/model format, e.g. 'openai/gpt-5.4'. | |
| tools | No | Tools available to the agent (web_search, fetch_url, function). | |
| models | No | Fallback chain of models (max 5). Takes precedence over model. | |
| preset | No | Preset configuration. | |
| max_steps | No | Maximum number of agentic steps (1-10). | |
| reasoning | No | Reasoning configuration object with optional 'effort' field. | |
| instructions | No | System-level instructions for the agent. | |
| response_format | No | Structured output format: {type: 'text'|'json_object'|'json_schema', json_schema?: {...}} | |
| max_output_tokens | No | Maximum tokens in the response. | |
| language_preference | No | ISO 639-1 language code, e.g. 'en', 'fr', 'es'. |