API Reference Overview
Welcome to the comprehensive API Reference for our advanced Indexing, Search, and Inference API. This powerful suite of endpoints enables you to manage documents, perform sophisticated searches, and leverage AI-powered inference capabilities across your data.
Core Functionalities
Our API is organized into three main sections, each offering robust capabilities:
- Indexing: Efficiently manage your document collection
- Search: Execute powerful, multi-faceted searches across indexed documents
- Inference: Harness AI-driven tasks for intelligent data processing
Base URL
All API requests should be directed to:
Authentication
Secure your API requests using an API key. Include your unique key in the Authorization
header for all requests:
Response Format
Our API consistently returns responses in JSON format. Successful responses typically include a data
field containing the requested information, while error responses include an error
field with detailed error information.
Rate Limiting
To ensure fair usage and optimal performance, we employ rate limiting:
- 100 requests per minute
- 5000 requests per day
Exceeding these limits will result in a 429 Too Many Requests response.
Detailed Endpoint Overview
Indexing
Efficiently manage your document collection with these endpoints:
- Index Document (
POST /index
) - Add new documents to the indexing queue
- Support for various data types: URLs, base64 encoded data, plain text, and structured data
-
Customizable metadata for enhanced document management
-
Get Index Status (
GET /index_status
) - Track the status of indexed documents
-
Possible statuses: queued, processing, indexed, failed
-
Delete Document (
DELETE /delete
) - Remove documents from the index or indexing queue
- Useful for managing outdated content or compliance with data retention policies
Search
Execute powerful searches across your indexed documents:
- Search Documents (
GET /search
) - Multiple search types: dense, sparse, graph, hybrid_vector, hybrid_vector_graph
- Customizable search spaces: global, textual_content, media, custom_file_type, custom_file_extension
- Advanced filtering and pagination capabilities
- Relevance scoring for accurate result ranking
Inference
Leverage AI-powered tasks with our inference endpoints:
- Infer (
POST /infer
) -
Supports multiple inference types:
- Chat Inference:
- Simulates chat interactions with an AI assistant
- Incorporates user history, search results, and external context
- Provides referred context with relevancy scores
- Summarize Inference:
- Generates concise summaries of various content types
- Supports text, documents, images, and web pages
- Customizable summary length and focus
- Smart Chips Inference:
- Extracts bite-sized information from various contexts
- Generates FAQ pairs and suggested queries
- Enhances user engagement with personalized information chips
-
Flexible streaming options: disabled, enabled, per_value
- Specialized model selection for tailored inference tasks
Best Practices
- Use appropriate search types and spaces for optimal performance and accuracy
- Leverage metadata and additional filters in searches for precise results
- Utilize chat session IDs and user IDs (surf_id) for personalized experiences in chat inference
- Take advantage of streaming responses for real-time data processing
Error Handling
Our API uses standard HTTP response codes. Common errors include:
- 400 Bad Request: Invalid input data
- 401 Unauthorized: Missing or invalid API key
- 404 Not Found: Resource not found
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Unexpected server-side issues
Detailed error messages are provided in the response body to aid in troubleshooting.
Conclusion
This API offers a powerful set of tools for document management, advanced search capabilities, and AI-driven inference tasks. By effectively utilizing these endpoints, you can create sophisticated, intelligent applications that process and analyze data with unprecedented efficiency and insight.
For detailed information on request parameters, response formats, and example usage for each endpoint, please refer to the specific documentation sections linked in this overview.