The Orchata API is a RESTful API that provides full access to all platform features. Use it to build applications that create, search, and manage knowledge bases.Documentation Index
Fetch the complete documentation index at: https://orchata.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
| Environment | Base URL |
|---|---|
| Production | https://api.orchata.ai |
| Development | http://localhost:4748 |
Authentication
All API endpoints (except health checks) require authentication via theOai-Api-Key header.
Get your API key from the Orchata dashboard → Settings → API Keys.
Response Format
All responses are JSON. Successful responses return the requested data directly:Error Handling
Errors return appropriate HTTP status codes with a JSON body:Common Status Codes
| Status | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Missing or invalid API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limited |
500 | Internal Server Error |
Pagination
List endpoints support pagination via query parameters:Page number (1-indexed)
Items per page (max: 100)
Metadata Filtering
List endpoints for spaces and documents support filtering by custom metadata. Pass a JSON-encoded object as themetadata query parameter:
@> containment operator) - the resource’s metadata must contain all the key-value pairs you specify, but may also have additional keys.
| Endpoint | Metadata Usage |
|---|---|
GET /spaces | Filter spaces by metadata |
POST /spaces | Attach metadata when creating |
PATCH /spaces/:id | Update space metadata |
GET /documents | Filter documents by metadata |
POST /query | Filter query results by document metadata |
API Endpoints Overview
Spaces
| Method | Endpoint | Description |
|---|---|---|
GET | /spaces | List all spaces |
POST | /spaces | Create a space |
GET | /spaces/:id | Get a space |
PATCH | /spaces/:id | Update a space |
DELETE | /spaces/:id | Archive a space |
Documents
| Method | Endpoint | Description |
|---|---|---|
GET | /spaces/:spaceId/documents | List documents |
POST | /spaces/:spaceId/documents | Upload document |
GET | /spaces/:spaceId/documents/:id | Get document |
PATCH | /spaces/:spaceId/documents/:id | Update document |
DELETE | /spaces/:spaceId/documents/:id | Delete document |
Queries
| Method | Endpoint | Description |
|---|---|---|
POST | /query | Semantic search |
POST | /query/smart | Smart space discovery |
Rate Limiting
The API implements rate limiting to ensure fair usage:| Tier | Requests/minute |
|---|---|
| Free | 60 |
| Pro | 300 |
| Enterprise | Custom |
SDK & Tools
MCP Server
Connect AI assistants via Model Context Protocol.
TypeScript SDK
Type-safe SDK for Node.js, Deno, Bun, and browsers with AI SDK integration.