Documentation
Build with Captain
Everything you need to integrate Captain's knowledge search API into your applications. Get started in minutes with our SDKs and comprehensive documentation.
Quick Start
Get up and running with Captain in just a few minutes.
01
Get your API key
Sign up for a free account and get your API key from the dashboard.
export CAPTAIN_API_KEY="your_api_key_here"02
Install the SDK
Install the Captain SDK using your preferred package manager.
npm install @captain/sdk
# or
pip install captain-sdk03
Index your data
Connect your data sources or upload files directly.
import { Captain } from '@captain/sdk'
const captain = new Captain(process.env.CAPTAIN_API_KEY)
await captain.index({
source: 's3://your-bucket/documents',
name: 'my-knowledge-base'
})04
Search your data
Query your indexed data with natural language.
const results = await captain.search({
query: "What is our refund policy?",
index: "my-knowledge-base",
limit: 5
})
console.log(results)API Reference
Core endpoints for the Captain API. All endpoints require authentication via API key.
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/index | Create a new index or add documents to an existing index |
| GET | /v1/search | Search across your indexed documents |
| DELETE | /v1/index/:id | Delete an index and all its documents |
| GET | /v1/index/:id/status | Get the status of an indexing job |
| POST | /v1/embed | Generate embeddings for text or images |
Official SDKs
Use our official SDKs for the best developer experience.
JavaScript/TypeScript
@captain/sdk
v2.1.0
Python
captain-sdk
v2.1.0
Go
github.com/captain/go-sdk
v2.1.0
Ruby
captain-sdk
v2.1.0