Introducing the Agent API — A Managed Runtime for Agentic Workflows

The Agent API is now live at POST /v1/agent.

It’s a single endpoint for building agentic workflows with integrated search, tool execution, and multi-model orchestration. Swap between the latest frontier models, configure presets, tool access, step limits, and token budgets — all from one endpoint.

Presets

Skip the configuration and use a curated preset:

Preset Best For
fast-search Quick factual lookups
pro-search Balanced multi-step research
deep-research Deep multi-source analysis
advanced-deep-research Institutional-grade research
from perplexity import Perplexity

client = Perplexity()
response = client.responses.create(
    preset="pro-search",
    input="Compare current open-source LLM evaluation benchmarks."
)
print(response.output_text)

Key Features

  • Multi-provider models — OpenAI, Anthropic, Google, xAI, and Perplexity’s own Sonar, all at direct provider pricing with no markup
  • Built-in toolsweb_search ($0.005/call) and fetch_url ($0.0005/call) for real-time web grounding
  • Custom function calling — Define your own tools to connect the model to your databases, APIs, and business logic
  • Model fallback chains — Pass a list of models and we’ll try them in order
  • Structured outputs — JSON Schema enforcement for predictable downstream parsing
  • OpenAI compatible — The /v1/responses path is accepted as an alias, so the OpenAI SDK works out of the box by pointing base_url to https://api.perplexity.ai/v1

OpenAI SDK Compatibility

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_PERPLEXITY_API_KEY",
    base_url="https://api.perplexity.ai/v1"
)

response = client.responses.create(
    model="openai/gpt-5.1",
    input="What are the latest developments in AI?"
)
print(response.output_text)

Get Started