Overview
The Shieldbase External API provides a comprehensive set of endpoints for integrating AI capabilities into your applications. This API supports:- Models Management - List available AI models
- File Upload & Indexing - Upload documents for semantic search
- Library Management - Browse and manage uploaded files
- Semantic Search - Hybrid BM25 + vector search across your content
- Chat Streaming - Real-time AI conversations via SSE
- Headless Agents - Blocking agentic task execution
All endpoints are mounted at
/external-docs and require API key authentication.
Interactive documentation is available at /external-docs/docs (Scalar UI).Authentication
All API endpoints (except/external/keys/*) require three headers:
Getting API Keys
- Login to your Shieldbase account at https://app.sbai.cloud/
- Navigate to Settings → API
- Click “Generate” to create your API credentials
- Save them securely - the API key is only shown once!
Base URLs
Quick Start
1. Set Environment Variables
2. Test Connection
Endpoints
Models
List Available Models
GET /external/models Returns all AI models available in the system with real-time availability status. Example Request:Upload
Upload Files to Library
POST /external/upload Upload files asynchronously. Files are queued for indexing and become searchable once processing completes. Supported file types:pdf, doc, docx, xls, xlsx, csv, json, txt, html, ppt, pptx, zip, md, sql, yml, yaml, png, jpg, jpeg, gif, webp
Max file size: 1 GB per file
Example Request:
Libraries
List Library Files
GET /external/libraries Retrieve paginated list of library files with advanced filtering options. Query Parameters:
Example Request:
Search
Semantic + Keyword Search
POST /external/search Combine keyword matching (BM25) with semantic similarity (vector search) for best results. Payload Fields:
Example Request:
Chat (Streaming)
Create New Conversation
POST /external/conversations Create a new conversation and receive real-time AI responses via SSE streaming. Payload Fields:additional_metadata Options:
Example Request:
Continue Existing Conversation
POST /external/conversations/ Send a follow-up message to an existing conversation and stream the AI reply. Example Request:Use the
conversation_id from the conversation_created event to continue the thread.Agents (Headless Execution)
Run Agentic Task
POST /external/agents/run Headless agentic execution - perfect for automation, scripts, and webhooks. Payload Fields:
Example Request:
/external/agents/run vs /external/conversations:
Privacy & Data Redaction
Redacting Sensitive Information
To protect sensitive data in prompts and responses, you can enable automatic redaction of:- PII (Personally Identifiable Information): Names, emails, phone numbers, addresses
- Financial Data: Credit card numbers, bank account numbers
- Credentials: API keys, passwords, tokens
- Custom Patterns: Define your own regex patterns for domain-specific data
- Input:
"John Doe, john@example.com, 555-1234" - Processed:
"[REDACTED_NAME], [REDACTED_EMAIL], [REDACTED_PHONE]"
Rate Limits
100 requests per minute per API key
X-RateLimit-Limit: Total requests allowed per minuteX-RateLimit-Remaining: Requests remaining in current windowX-RateLimit-Reset: Unix timestamp when the limit resets
Error Handling
All errors follow this format:Testing Script
Save this astest-external-api.sh:
Additional Resources
- Interactive API Docs - Explore the API with Scalar UI (dark mode, modern layout)
- OpenAPI Spec - Download the OpenAPI specification
- Support - Contact our support team
- Status Page - Check API status and uptime
Coming Soon
- Python SDK
- JavaScript/TypeScript SDK
- Go SDK
- Webhook support for async notifications
- GraphQL endpoint
- Batch processing API