Skip to content

Search as Code (SaC) Review

Search as Code (SaC) is a new search architecture for AI agents that generates Python code to directly compose search primitives, bypassing multi-turn tool calling.

shipped Jun 2, 2026aifreemium
Search as Code (SaC) - AI tool for search code. Professional illustration showing core functionality and features.
1Search as Code (SaC) was officially launched by Perplexity AI on June 1, 2026, as a new search architecture for AI agents.
2It enables AI models to generate and execute Python code within a secure sandbox to assemble tailored retrieval pipelines on-demand.
3The Sonar API, which incorporates SaC, is priced at $0.00025 per 1k input tokens and $0.0025 per 1k output tokens.
4SaC exposes search stack components as programmable primitives, offering fine-grained control over retrieval, ranking, filtering, and fanouts.

Stork Quadrant

Dead Man Walking· 9/100

An LLM can do most of what this tool's UI promises. No moat, no agent presence.

This is a concept article from Perplexity, not a standalone tool — and the concept itself is already being eaten alive. LLMs with web search access already do programmable search decomposition natively. The 'search as code' framing is clever but describes behavior that frontier models exhibit without any additional product layer. No moat here.

Claude Sonnet 4.6, scored 2026-06-02

Defensibility · 0/100

  • Physical-world coupling
  • Regulatory moat
  • Network liquidity
  • Proprietary refreshing data
  • High-trust catastrophic workflows
  • Multi-party coordination
  • Brand / community / taste

An LLM alone could replace

  • Generate search queries from natural language intent
  • Decompose a complex research question into sub-queries
  • Synthesize results from multiple sources into a structured answer
  • Write code that orchestrates search API calls

Agent-Readiness · 20/100

  • Verified MCP
  • Listed on agent surfacesanthropic_directory, cursor
  • Usage-based pricing
  • Headless agent auth
  • Public OpenAPI
  • Active changelog
  • llms.txt

How to defend

Perplexity's only real move is to become the search API that agents call — own the index, own the freshness, own the structured data layer — and stop competing on the UI or the framing. The article is marketing; the product needs proprietary crawl data and a coordination layer that makes it the default search primitive in agent frameworks.

  • Ship an MCP server and list it on Stork — biggest single point gain (+25).
  • Add a usage-based or per-call tier; per-seat-only pricing dies when agents replace seats (+15).
  • Expose API-key auth with a self-serve sandbox tier; remove sales-call gates (+15).
  • Publish an OpenAPI spec at /openapi.json or /.well-known/openapi (+10).
  • Publish a public changelog and ship in the last 90 days — silence reads as abandonment (+10).

Search as Code (SaC) at a Glance

Best For
product-hunt
Pricing
freemium
Key Features
Search as Code (SaC) was officially launched by Perplexity AI on June 1, 2026, as a new search architecture for AI agents. · It enables AI models to generate and execute Python code within a secure sandbox to assemble tailored retrieval pipelines on-demand. · The Sonar API, which incorporates SaC, is priced at $0.00025 per 1k input tokens and $0.0025 per 1k output tokens.
Alternatives
Exa AI Search API, Parallel AI Search, Cloudflare AI Search, Brave Search API
</>Embed "Featured on Stork" Badge
Badge previewBadge preview light
<a href="https://www.stork.ai/en/search-as-code-sac" target="_blank" rel="noopener noreferrer"><img src="https://www.stork.ai/api/badge/search-as-code-sac?style=dark" alt="Search as Code (SaC) - Featured on Stork.ai" height="36" /></a>
[![Search as Code (SaC) - Featured on Stork.ai](https://www.stork.ai/api/badge/search-as-code-sac?style=dark)](https://www.stork.ai/en/search-as-code-sac)

overview

What is Search as Code (SaC)?

Search as Code (SaC) is a new search architecture tool developed by Perplexity AI that enables AI agents and developers building AI systems to generate and execute Python code to assemble tailored retrieval pipelines. It bypasses traditional multi-turn tool calling interfaces by exposing search stack components as programmable primitives. This architecture moves beyond monolithic search services, allowing AI models to directly program and control the search stack. The generated Python code is executed within a secure sandbox, providing AI agents with fine-grained control over individual search steps such as retrieval, ranking, filtering, fanouts, and rendering. This approach is designed to improve the efficiency and capability of AI agents in complex, open-ended information retrieval tasks, enabling them to design bespoke search pipelines spanning thousands of operations and optimize them in-flight.

quick facts

Quick Facts

AttributeValue
DeveloperPerplexity AI
Business ModelFreemium (Usage-based)
PricingSonar API: $0.00025 per 1k input tokens; Sonar Pro: $0.003 per 1k input tokens; Agent API: Varies by provider
PlatformsAPI
API AvailableYes
EU AI Act CategoryLimited
API Documentationhttps://docs.perplexity.ai/

features

Key Features of Search as Code (SaC)

Search as Code (SaC) provides a robust set of features designed to empower AI agents with advanced search capabilities, moving beyond traditional fixed search pipelines. These features enable dynamic, programmable control over information retrieval processes.

  • 1Enables models to generate and execute Python code within a secure sandbox for search operations.
  • 2Exposes search stack components as programmable primitives within an SDK.
  • 3Allows AI models direct control over individual search steps, including retrieval, ranking, filtering, fanouts, and rendering.
  • 4Bypasses traditional multi-turn tool calling interfaces for search operations, streamlining agent workflows.
  • 5Provides efficient access to intermediate state, such as candidate lists and ranking signals, for iterative refinement.
  • 6Facilitates the assembly of tailored retrieval pipelines on-demand for specific information needs.
  • 7Supports the design of bespoke search pipelines spanning thousands of retrieval operations.
  • 8Optimizes search pipelines in-flight and consumes only the most useful information as model context.
  • 9Incorporates search innovations like sub-document retrieval, context efficiency, and semantic understanding.

use cases

Who Should Use Search as Code (SaC)?

Search as Code (SaC) is primarily designed for AI agents and developers who require fine-grained, programmatic control over information retrieval processes for complex and dynamic tasks. Its architecture is particularly beneficial for scenarios demanding highly customized search strategies.

  • 1**AI Agents**: For constructing tailored retrieval pipelines to address complex, open-ended tasks over extended periods.
  • 2**Developers Building AI Systems**: To allow AI models to directly program and control the search stack, bypassing multi-turn function calling interfaces.
  • 3**Researchers and Analysts**: For in-depth research and information gathering, enabling the design of bespoke search pipelines that can be optimized in-flight.
  • 4**Companies in Sensitive Domains**: Deployers using Perplexity AI in areas like HR, legal, or internal decision-making, who need to ensure data transparency and conduct Data Protection Impact Assessments (DPIAs).
  • 5**Organizations Requiring Cost-Performance Optimization**: For establishing a new cost-performance frontier for agentic search by providing fine-grained control over resource consumption.

pricing

Search as Code (SaC) Pricing & Plans

Search as Code (SaC) is offered through Perplexity AI's freemium model, with pricing primarily usage-based across its API tiers. The pricing structure is designed to scale with cumulative API spending, unlocking higher rate limits as usage increases. Perplexity AI offers tiered rate limits for its Agent, Search, Embeddings, and Sonar APIs. For example, the Agent API ranges from 1 QPS (Tier 0) to 17 QPS (Tier 3), while the Search API maintains a sustained rate limit of 50 QPS with a burst capacity of 50 requests. Users can monitor their current usage tier via the API Platform console.

  • 1**Sonar API**: Input tokens are priced at $0.00025 per 1k tokens ($0.25 per 1 million tokens); Output tokens are priced at $0.0025 per 1k tokens ($2.50 per 1 million tokens).
  • 2**Sonar Pro**: Input tokens are priced at $0.003 per 1k tokens ($3 per 1 million tokens); Output tokens are priced at $0.015 per 1k tokens ($15 per 1 million tokens).
  • 3**Agent API**: Pricing varies by provider and model, with direct provider rates and no markup from Perplexity AI.

competitors

Search as Code (SaC) vs Competitors

Search as Code (SaC) differentiates itself in the competitive landscape by offering a programmable search architecture that empowers AI agents to generate and execute code for dynamic retrieval pipelines, contrasting with traditional fixed search models and even advanced AI search tools.

1

Exa is a web search engine built from scratch for AI workflows, optimized for relevance, freshness, and semantically-driven results rather than click-based ranking.

Similar to SaC, Exa provides structured, up-to-date information for AI agents and RAG systems, acting as a retrieval layer. While SaC emphasizes programmable primitives for dynamic pipeline assembly, Exa focuses on delivering highly relevant and semantically understood results tailored for AI consumption.

2
Parallel AI Search

Parallel is an AI-native web search and research API designed as infrastructure for AI systems to search, retrieve, verify, and reason over live web information.

Parallel, like SaC, targets AI agents as its primary users, providing a different kind of web infrastructure for AI systems. It aims to go deeper into how AI agents interact with the web, offering a foundational layer for complex reasoning, which aligns with SaC's goal of evolving search to programmable primitives.

3
Cloudflare AI Search

Cloudflare AI Search offers a plug-and-play search primitive with hybrid search capabilities and built-in storage, allowing dynamic instance creation and management via API for agents.

Cloudflare AI Search directly positions itself as a 'search primitive' for agents, enabling developers to dynamically create and manage search instances, which closely mirrors SaC's concept of programmable primitives. It simplifies the infrastructure needed for agents to access and search data, similar to how SaC aims to provide building blocks for agentic search.

4

Brave Search API provides direct, structured API access to its independently built web index, offering flexibility and customization for RAG pipelines and AI systems.

The Brave Search API offers a foundational retrieval API for AI products, emphasizing control over ranking and summarization, and providing structured results. This aligns with SaC's goal of moving beyond monolithic search by offering customizable building blocks, though Brave's focus is on its independent index and structured output rather than the dynamic assembly of search pipelines through code generation.

Frequently Asked Questions

+What is Search as Code (SaC)?

Search as Code (SaC) is a new search architecture tool developed by Perplexity AI that enables AI agents and developers building AI systems to generate and execute Python code to assemble tailored retrieval pipelines. It bypasses traditional multi-turn tool calling interfaces by exposing search stack components as programmable primitives.

+Is Search as Code (SaC) free?

Search as Code (SaC) operates on a freemium model through Perplexity AI's API. While there might be a free tier for basic usage, advanced features and higher rate limits are usage-based. For example, the Sonar API costs $0.00025 per 1k input tokens, and the Sonar Pro API costs $0.003 per 1k input tokens, with output tokens priced separately.

+What are the main features of Search as Code (SaC)?

Key features of Search as Code (SaC) include enabling AI models to generate and execute Python code within a secure sandbox for search, exposing search stack components as programmable primitives, allowing direct control over individual search steps (retrieval, ranking, filtering), bypassing multi-turn tool calling, and providing efficient access to intermediate search states for iterative refinement.

+Who should use Search as Code (SaC)?

Search as Code (SaC) is intended for AI agents and developers building AI systems that require fine-grained, programmatic control over information retrieval. It is particularly useful for complex, open-ended tasks, in-depth research, and orchestrating search operations through model-generated Python code to improve efficiency and capability in information retrieval.

+How does Search as Code (SaC) compare to alternatives?

Search as Code (SaC) differentiates itself by offering a programmable search architecture where AI agents generate code to control search primitives, unlike traditional search engines that provide static results or older AI search systems with fixed pipelines. Compared to competitors like Exa AI Search API or Parallel AI Search, SaC focuses on the dynamic assembly of search pipelines through code generation, providing a more fundamental level of control over the search process for AI agents.

For builders

This page is doing a job for someone else’s tool.

AI agents read it. Buyers find it. Backlinks accrue. Your tool can have one too — live in 24 hours, indexed by Claude, ChatGPT, and Perplexity, queryable via MCP.