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
Web Search
Search the web in real-time with AI-optimized results.Endpoint
Request
Response
Pricing
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):
JSON upload (
application/json):
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
Response:
List Documents
Delete Document
Document Limits by Tier
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:
Now in a subsequent request:
Memory Management
List Sessions:Memory Limits by Tier
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
Plan Availability
Related
- Chat API - Core chat endpoint with tool integration
- Streaming API - Real-time responses with tools
- Policies API - Control tool usage with policies