# Perplexity Ultra - Grounded JSON Extraction (`chriskelch77/perplexity-ultra`) Actor

Turn grounded web research into validated JSON with schema enforcement, source merging, confidence scoring, and batch processing.

- **URL**: https://apify.com/chriskelch77/perplexity-ultra.md
- **Developed by:** [Chris](https://apify.com/chriskelch77) (community)
- **Categories:** AI, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 research requests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## 📦 Perplexity Ultra V1.0

### 🚀 Turn Web Research Into Validated JSON

Most AI tools give you text you still have to parse.

**Perplexity Ultra gives you structured, validated JSON you can use directly in your application.**

It combines grounded search, schema validation, JSON repair, and confidence scoring into a single API.

---

### 🧠 What this is

Perplexity Ultra is a **production-ready API for grounded research and structured data extraction using Perplexity**.

It is not just a wrapper.

It adds:

* query planning
* validation
* repair
* observability

So you can safely use grounded AI in real applications.

---

### 🚀 What this solves

Working with grounded LLMs in production is hard:

* responses are inconsistent
* JSON often breaks
* citations are messy or missing
* costs can spike unexpectedly
* debugging failures is painful

Perplexity Ultra handles these problems for you.

---

### 🤔 Why not just use Perplexity directly?

Perplexity is powerful, but raw responses are not production-ready:

* JSON often breaks
* outputs are inconsistent
* citations are messy
* retries and failures are hard to handle
* costs can spike without control

Perplexity Ultra adds a reliability layer:

* multi-query planning
* structured extraction with schema validation
* automatic JSON repair
* source merging and deduplication
* confidence scoring and metadata
* batch execution on Apify

---

### ⭐ Core Feature: Structured Extraction

The core capability of Perplexity Ultra is:

#### `POST /v1/extract`

It turns grounded web research into structured JSON:

* runs multiple search queries
* merges and filters sources
* extracts structured data using your schema
* validates the output
* repairs broken JSON when needed
* returns confidence and metadata

#### This is ideal for:

* competitor datasets
* market research pipelines
* enrichment workflows
* structured AI backends

---

### 🧪 Example Use Case

**Input:**

````

Find 10 competitors of Notion for mid-market teams

````

**Output:**

Structured JSON containing:

* company names
* websites
* categorized data
* sources and confidence

Instead of parsing messy text, you get clean, validated data ready to store, filter, or display in your application.

---

### 🧩 Core capabilities

#### 🔍 Grounded research

* Multi-query execution (not just one search)
* Source merging and deduplication
* Citation-aware responses
* Works across multiple Perplexity models

---

#### 🧾 Structured extraction

* Convert web-grounded data into JSON
* JSON Schema validation (AJV)
* Automatic cleanup of:

  * markdown wrappers
  * extra prose
  * malformed JSON
* Optional secondary repair pass for hard failures

---

#### 🛡 Reliability layer

* Deterministic JSON repair (fast, regex-based)
* Retry + fallback across models
* Explicit failure responses (no silent corruption)

---

#### 💰 Cost & control

* Per-request and per-run budget limits
* Query count limits
* Concurrency control (rate-safe execution)
* Cost estimation per request

---

#### ⚡ Performance

* Exact response caching (100% reuse)
* Prefix caching for repeated prompts
* Multi-tenant cache isolation

---

#### 🔐 Security & privacy (basic guardrails)

* Optional PII masking (emails, phone numbers)
* Log redaction for sensitive payloads
* BYOK (bring your own API key)

---

#### 🧪 Observability

Every response includes metadata:

* latency
* estimated cost
* model used
* validation result
* confidence score

Optional debug mode stores:

* raw upstream responses
* repaired JSON
* validation errors

---

#### 📊 Batch processing (Apify native)

* Process datasets row-by-row
* Automatic retries
* Dead-letter dataset for failures
* Webhook on completion

---

### 📡 API Overview

#### Endpoints

| Endpoint               | Description                              |
| ---------------------- | ---------------------------------------- |
| `POST /v1/research`    | Grounded research + synthesis            |
| `POST /v1/extract`     | Structured JSON extraction (recommended) |
| `POST /v1/verify`      | Claim verification                       |
| `POST /v1/compare`     | Entity comparison                        |
| `POST /v1/search-plan` | Preview query plan (no cost)             |
| `POST /v1/batch`       | Dataset processing                       |
| `GET /v1/health`       | Health check                             |

---

### ⚙️ Presets

Presets define execution behavior.

| Preset                 | Behavior                          |
| ---------------------- | --------------------------------- |
| `ultra-fast-research`  | Low latency, minimal queries      |
| `ultra-smart-research` | Balanced depth + cost             |
| `ultra-extract`        | Optimized for structured output   |
| `ultra-verify`         | Evidence-focused validation       |
| `ultra-deep`           | High-depth research (higher cost) |
| `ultra-batch`          | Stable batch processing           |
| `custom`               | Full manual control               |

---

### ✏️ Example: Structured Extraction

#### Request

```json
POST /v1/extract
{
  "query": "Find 10 competitors of Notion for mid-market teams",
  "preset": "ultra-extract",
  "schema": {
    "type": "object",
    "properties": {
      "companies": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "website": { "type": "string" }
          },
          "required": ["name"]
        }
      }
    },
    "required": ["companies"]
  }
}
````

***

#### Response

```json
{
  "data": {
    "structured": {
      "companies": [
        {
          "name": "ClickUp",
          "website": "https://clickup.com"
        }
      ]
    },
    "sources": [
      {
        "url": "https://example.com",
        "domain": "example.com"
      }
    ],
    "validation": {
      "valid": true,
      "errors": []
    },
    "confidence": {
      "confidence": 0.82,
      "grade": "high"
    }
  },
  "meta": {
    "requestId": "req_123",
    "preset": "ultra-extract",
    "queryCount": 4,
    "sourceCount": 12,
    "latencyMs": 3201,
    "repairCount": 1,
    "validationPassed": true
  }
}
```

***

### ⚠️ Important notes

- This API **reduces hallucinations** by grounding responses in search results, but does not guarantee perfect factual accuracy
- Structured output is **validated against your schema**, but may fail if the data cannot be reliably extracted
- Confidence scores are **heuristics**, not guarantees

***

### 🧭 When to use this vs raw Perplexity

#### Use Perplexity Ultra when you need:

- structured JSON output
- reliable, repeatable results
- production-ready pipelines
- cost control
- debugging visibility
- batch processing

#### Use raw Perplexity when you need:

- quick, ad-hoc queries
- interactive exploration

***

### 🧱 Architecture (simplified)

```text
Request
  → Normalizer
  → Preset Resolver
  → Query Planner
  → Perplexity Adapters
  → Source Normalization
  → Extraction / Synthesis
  → Validation + Repair
  → Confidence Scoring
  → Response Envelope
```

***

### 🧪 Best use cases

- competitor research
- market analysis
- vendor comparison
- data enrichment pipelines
- claim verification
- structured dataset generation

***

### 🧩 Deployment

Runs as:

- Apify Actor (batch + server)
- Standby API (Express)

Supports:

- BYOK (Perplexity API key)
- dataset-based workflows
- webhook integrations

***

### 🔌 Works with Perplexity and OpenRouter

Perplexity Ultra supports both:

- native Perplexity API
- Perplexity models through OpenRouter

This gives you:

- provider flexibility
- redundancy and fallback options
- easier integration into existing stacks

All while keeping a consistent interface for grounded research and structured extraction.

***

### 🏁 Summary

Perplexity Ultra turns search-based AI into structured, application-ready data.

Instead of handling:

- broken JSON
- inconsistent outputs
- retries
- cost spikes

you get:

- validated results
- predictable structure
- observability
- control

***

# Actor input Schema

## `mode` (type: `string`):

Choose 'api' to run a Standby server, or 'batch' to process a dataset.

## `perplexityApiKey` (type: `string`):

Your Perplexity (or OpenRouter) API Key. This is stored securely.

## `modelChain` (type: `array`):

If the first model fails, the Actor will automatically retry with the next in the list.

## `policyPreset` (type: `string`):

Apply a predefined configuration profile. ultra-fast minimizes latency, ultra-smart enables repair + debug, ultra-private enforces PII masking and zero data retention, ultra-json enables strict JSON mode.

## `taskClass` (type: `string`):

Hint for the smart routing engine. 'auto' infers the task from the request shape.

## `route` (type: `string`):

Which API route to target (usually chat for Perplexity models).

## `maxCostPerRunUsd` (type: `number`):

Hard budget limit. The Actor will stop processing if this cost is exceeded.

## `maxCostPerRequestUsd` (type: `number`):

Maximum allowed cost for a single API request.

## `timeoutMs` (type: `integer`):

Per-model timeout in milliseconds.

## `latencyTargetMs` (type: `integer`):

Target latency hint for the routing engine. Lower values prefer faster models.

## `maxRetries` (type: `integer`):

Maximum number of retries per request.

## `enableExactCache` (type: `boolean`):

If enabled, identical requests will be served from the internal cache (SHA-256 hash), saving tokens and money.

## `cacheTtlSeconds` (type: `integer`):

How long cached responses remain valid.

## `cacheNamespace` (type: `string`):

Isolate cache entries by namespace. Useful for multi-tenant setups.

## `enablePrefixCache` (type: `boolean`):

Enable advanced prefix-based caching for long prompts.

## `userScopedCache` (type: `boolean`):

Isolate cache by user ID (if provided in request headers).

## `jsonStrictMode` (type: `boolean`):

Automatically strip markdown and repair broken JSON syntax from the AI's output.

## `jsonSchema` (type: `object`):

Validate LLM output against this JSON Schema. Used with JSON strict mode.

## `enableDeterministicRepair` (type: `boolean`):

Try regex-based JSON repair before falling back to model-based repair.

## `maxRepairAttempts` (type: `integer`):

How many times to attempt repair before failing.

## `enableRepairModel` (type: `boolean`):

Use a specialized model to fix JSON that deterministic repair cannot handle.

## `repairModel` (type: `string`):

Model to use for JSON self-healing if deterministic repair fails.

## `enableDebugArtifacts` (type: `boolean`):

Store JSON parse/validation failure details for post-run inspection.

## `piiMasking` (type: `boolean`):

Scrub emails and phone numbers before sending data to the AI provider.

## `zdrOnly` (type: `boolean`):

Only route to providers that support zero data retention policies.

## `redactLogs` (type: `boolean`):

Redact sensitive data from Actor logs.

## `datasetId` (type: `string`):

The Apify Dataset ID containing the rows you want to process.

## `requestTemplate` (type: `object`):

The Perplexity payload template. Use {{fieldName}} to inject data from your dataset.

## `inputMapping` (type: `object`):

Advanced mapping of dataset fields to template variables.

## `sampleSize` (type: `integer`):

Process only the first N rows (useful for testing).

## `deadLetterDatasetId` (type: `string`):

Failed batch rows are pushed to this dataset for inspection.

## `webhookUrl` (type: `string`):

URL to POST a summary to when batch processing completes.

## Actor input object example

```json
{
  "mode": "api",
  "modelChain": [
    "perplexity/sonar",
    "perplexity/sonar-reasoning"
  ],
  "policyPreset": "custom",
  "taskClass": "auto",
  "route": "chat",
  "maxCostPerRunUsd": 5,
  "timeoutMs": 30000,
  "maxRetries": 2,
  "enableExactCache": true,
  "cacheTtlSeconds": 86400,
  "cacheNamespace": "default",
  "enablePrefixCache": true,
  "userScopedCache": true,
  "jsonStrictMode": true,
  "enableDeterministicRepair": true,
  "maxRepairAttempts": 1,
  "enableRepairModel": false,
  "repairModel": "perplexity/sonar",
  "enableDebugArtifacts": true,
  "piiMasking": false,
  "zdrOnly": false,
  "redactLogs": true,
  "sampleSize": 10
}
```

# Actor output Schema

## `results` (type: `string`):

When running in Batch mode, all extracted rows and metadata are saved here.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("chriskelch77/perplexity-ultra").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("chriskelch77/perplexity-ultra").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call chriskelch77/perplexity-ultra --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=chriskelch77/perplexity-ultra",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Perplexity Ultra - Grounded JSON Extraction",
        "description": "Turn grounded web research into validated JSON with schema enforcement, source merging, confidence scoring, and batch processing.",
        "version": "1.0",
        "x-build-id": "RdJB2cecKrgf93hct"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/chriskelch77~perplexity-ultra/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-chriskelch77-perplexity-ultra",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/chriskelch77~perplexity-ultra/runs": {
            "post": {
                "operationId": "runs-sync-chriskelch77-perplexity-ultra",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/chriskelch77~perplexity-ultra/run-sync": {
            "post": {
                "operationId": "run-sync-chriskelch77-perplexity-ultra",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Execution Mode",
                        "enum": [
                            "api",
                            "batch"
                        ],
                        "type": "string",
                        "description": "Choose 'api' to run a Standby server, or 'batch' to process a dataset.",
                        "default": "api"
                    },
                    "perplexityApiKey": {
                        "title": "Perplexity API Key (BYOK)",
                        "type": "string",
                        "description": "Your Perplexity (or OpenRouter) API Key. This is stored securely."
                    },
                    "modelChain": {
                        "title": "Model Fallback Chain",
                        "type": "array",
                        "description": "If the first model fails, the Actor will automatically retry with the next in the list.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "perplexity/sonar",
                            "perplexity/sonar-reasoning"
                        ]
                    },
                    "policyPreset": {
                        "title": "Policy Preset",
                        "enum": [
                            "ultra-fast",
                            "ultra-smart",
                            "ultra-private",
                            "ultra-json",
                            "ultra-batch",
                            "ultra-extract",
                            "ultra-debug",
                            "custom"
                        ],
                        "type": "string",
                        "description": "Apply a predefined configuration profile. ultra-fast minimizes latency, ultra-smart enables repair + debug, ultra-private enforces PII masking and zero data retention, ultra-json enables strict JSON mode.",
                        "default": "custom"
                    },
                    "taskClass": {
                        "title": "Task Class",
                        "enum": [
                            "auto",
                            "chat",
                            "extraction",
                            "classification",
                            "reasoning",
                            "embedding"
                        ],
                        "type": "string",
                        "description": "Hint for the smart routing engine. 'auto' infers the task from the request shape.",
                        "default": "auto"
                    },
                    "route": {
                        "title": "Target API Route",
                        "enum": [
                            "chat",
                            "responses",
                            "embeddings"
                        ],
                        "type": "string",
                        "description": "Which API route to target (usually chat for Perplexity models).",
                        "default": "chat"
                    },
                    "maxCostPerRunUsd": {
                        "title": "Max Cost Per Run (USD)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Hard budget limit. The Actor will stop processing if this cost is exceeded.",
                        "default": 5
                    },
                    "maxCostPerRequestUsd": {
                        "title": "Max Cost Per Request (USD)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Maximum allowed cost for a single API request."
                    },
                    "timeoutMs": {
                        "title": "Timeout (ms)",
                        "minimum": 1000,
                        "type": "integer",
                        "description": "Per-model timeout in milliseconds.",
                        "default": 30000
                    },
                    "latencyTargetMs": {
                        "title": "Latency Target (ms)",
                        "minimum": 100,
                        "type": "integer",
                        "description": "Target latency hint for the routing engine. Lower values prefer faster models."
                    },
                    "maxRetries": {
                        "title": "Max Retries",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of retries per request.",
                        "default": 2
                    },
                    "enableExactCache": {
                        "title": "Enable Exact Response Cache",
                        "type": "boolean",
                        "description": "If enabled, identical requests will be served from the internal cache (SHA-256 hash), saving tokens and money.",
                        "default": true
                    },
                    "cacheTtlSeconds": {
                        "title": "Cache TTL (seconds)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "How long cached responses remain valid.",
                        "default": 86400
                    },
                    "cacheNamespace": {
                        "title": "Cache Namespace",
                        "type": "string",
                        "description": "Isolate cache entries by namespace. Useful for multi-tenant setups.",
                        "default": "default"
                    },
                    "enablePrefixCache": {
                        "title": "Enable Prefix Cache",
                        "type": "boolean",
                        "description": "Enable advanced prefix-based caching for long prompts.",
                        "default": true
                    },
                    "userScopedCache": {
                        "title": "User Scoped Cache",
                        "type": "boolean",
                        "description": "Isolate cache by user ID (if provided in request headers).",
                        "default": true
                    },
                    "jsonStrictMode": {
                        "title": "Enable JSON Self-Healing",
                        "type": "boolean",
                        "description": "Automatically strip markdown and repair broken JSON syntax from the AI's output.",
                        "default": true
                    },
                    "jsonSchema": {
                        "title": "JSON Schema",
                        "type": "object",
                        "description": "Validate LLM output against this JSON Schema. Used with JSON strict mode."
                    },
                    "enableDeterministicRepair": {
                        "title": "Enable Deterministic Repair",
                        "type": "boolean",
                        "description": "Try regex-based JSON repair before falling back to model-based repair.",
                        "default": true
                    },
                    "maxRepairAttempts": {
                        "title": "Max Repair Attempts",
                        "minimum": 0,
                        "type": "integer",
                        "description": "How many times to attempt repair before failing.",
                        "default": 1
                    },
                    "enableRepairModel": {
                        "title": "Enable Repair Model",
                        "type": "boolean",
                        "description": "Use a specialized model to fix JSON that deterministic repair cannot handle.",
                        "default": false
                    },
                    "repairModel": {
                        "title": "Repair Model Name",
                        "type": "string",
                        "description": "Model to use for JSON self-healing if deterministic repair fails.",
                        "default": "perplexity/sonar"
                    },
                    "enableDebugArtifacts": {
                        "title": "Enable Debug Artifacts",
                        "type": "boolean",
                        "description": "Store JSON parse/validation failure details for post-run inspection.",
                        "default": true
                    },
                    "piiMasking": {
                        "title": "Enable PII Masking",
                        "type": "boolean",
                        "description": "Scrub emails and phone numbers before sending data to the AI provider.",
                        "default": false
                    },
                    "zdrOnly": {
                        "title": "Zero Data Retention Only",
                        "type": "boolean",
                        "description": "Only route to providers that support zero data retention policies.",
                        "default": false
                    },
                    "redactLogs": {
                        "title": "Redact Logs",
                        "type": "boolean",
                        "description": "Redact sensitive data from Actor logs.",
                        "default": true
                    },
                    "datasetId": {
                        "title": "Target Dataset ID (Batch Mode Only)",
                        "type": "string",
                        "description": "The Apify Dataset ID containing the rows you want to process."
                    },
                    "requestTemplate": {
                        "title": "Request Template (Batch Mode Only)",
                        "type": "object",
                        "description": "The Perplexity payload template. Use {{fieldName}} to inject data from your dataset."
                    },
                    "inputMapping": {
                        "title": "Input Field Mapping",
                        "type": "object",
                        "description": "Advanced mapping of dataset fields to template variables."
                    },
                    "sampleSize": {
                        "title": "Batch Sample Size",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Process only the first N rows (useful for testing).",
                        "default": 10
                    },
                    "deadLetterDatasetId": {
                        "title": "Dead Letter Dataset ID",
                        "type": "string",
                        "description": "Failed batch rows are pushed to this dataset for inspection."
                    },
                    "webhookUrl": {
                        "title": "Completion Webhook URL",
                        "type": "string",
                        "description": "URL to POST a summary to when batch processing completes."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
