Tools API
The Tools Library provides agentic capabilities for your AI applications. Add web search, document retrieval (RAG), and conversation memory with a single API.Available Tools
| Tool | Description | Availability |
|---|---|---|
| Web Search | Real-time web search with AI-optimized results | All tiers |
| Documents/RAG | Upload and query documents with semantic search | Pro+ |
| Memory | Persistent conversation context across sessions | Pro+ |
Web Search
Search the web in real-time with AI-optimized results.Endpoint
Request
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | Search query |
max_results | integer | 5 | Maximum results to return (1-10) |
search_depth | string | ”basic” | Search depth: basic or advanced |
include_domains | string[] | - | Only include results from these domains |
exclude_domains | string[] | - | Exclude results from these domains |
Response
Pricing
| Tier | Cost per Search |
|---|---|
| Starter | $0.015 |
| Pro | $0.012 |
| Growth | $0.011 |
| Team | $0.01 |
Documents / RAG
Upload documents and query them with semantic search. Use documents as context in chat requests for Q&A, structured extraction, and more.Upload Document
File Upload (Recommended)
Send the file directly usingmultipart/form-data:
JSON Upload (Base64)
Alternatively, send base64-encoded content in a JSON body:Parameters
File upload (multipart/form-data):
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The file to upload (PDF, TXT, MD). Max 20 MB. |
collection_id | string | No | Collection to organize the document into |
metadata | string | No | JSON string of custom key-value metadata |
application/json):
| Parameter | Type | Required | Description |
|---|---|---|---|
filename | string | Yes | Original filename (used for display and format detection) |
content | string | Yes | Base64-encoded file content, or plain text for .txt/.md files |
content_type | string | No | MIME type: application/pdf, text/plain, text/markdown |
collection_id | string | No | Collection to organize the document into |
metadata | object | No | Custom key-value metadata for filtering |
Response
id from the response — you’ll need it to reference this document in /v1/chat requests.
Document Status:
processing- Being chunked and embeddedready- Available for searchfailed- Processing failed (checkerror_message)
Use with Chat API
Once a document isready, pass its id as document_id in a /v1/chat request to use it as context:
document_id with schema_id for structured data extraction. See Document Context in Chat API for full details.
Query Documents
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | Search query |
collection_id | string | none | Filter to a specific collection |
top_k | integer | 5 | Maximum results |
threshold | number | 0.3 | Minimum similarity score (0-1) |
List Documents
Delete Document
Document Limits by Tier
| Tier | Documents | Storage | Collections |
|---|---|---|---|
| Pro | 500 | 1 GB | 10 |
| Growth | 5,000 | 10 GB | 50 |
| Team | 50,000 | 100 GB | 500 |
| Enterprise | 500,000 | 1 TB | 5,000 |
Memory / Context
Persist conversation context across sessions. The AI remembers previous interactions without you managing conversation history.Using Memory with Chat
Addsession_id to your chat requests to enable memory:
| Parameter | Type | Description |
|---|---|---|
session_id | string | Unique session identifier |
memory.enabled | boolean | Enable memory for this request |
memory.include_last_n | integer | Include last N messages from memory |
Memory Management
List Sessions:Memory Limits by Tier
| Tier | Memory Tokens | Sessions | Retention |
|---|---|---|---|
| Pro | 100,000 | 100 | 30 days |
| Growth | 500,000 | 1,000 | 90 days |
| Team | 2,000,000 | 10,000 | 1 year |
| Enterprise | 10,000,000 | 100,000 | 2 years |
Auto-Summarization
When a session approaches its token limit, Perf automatically:- Summarizes older messages
- Preserves recent messages intact
- Continues conversation with summary + recent context
Combining Tools
Tools work together seamlessly. For example, search the web, store relevant information in documents, and use memory to maintain context:Pricing Summary
| Tool | Pricing Model |
|---|---|
| Web Search | Per search ($0.01-0.015) |
| Documents | Per embedding token |
| Memory | Included in tier |
Plan Availability
| Feature | Starter | Pro | Growth | Team | Enterprise |
|---|---|---|---|---|---|
| Web Search | Yes | Yes | Yes | Yes | Yes |
| Documents/RAG | - | Yes | Yes | Yes | Yes |
| Memory | - | Yes | Yes | Yes | Yes |
Related
- Chat API - Core chat endpoint with tool integration
- Streaming API - Real-time responses with tools
- Policies API - Control tool usage with policies