Quickstart
Three steps get a collection searchable: create it, index files into it, query it. This page walks through all three with the API directly. To skip straight to a working integration from your editor, use the MCP Server instead.
The MCP Server connects Claude Code, Cursor, VS Code, and Windsurf to Captain in one step, no API code required.
Prerequisites
Get Your API Credentials
You’ll need:
- API Key from Captain API Studio (format:
cap_dev_...,cap_prod_...) - Organization ID (UUID format, also available in the Studio)
Store your API key securely, such as in an environment variable:
[1/3] Create a Collection
In order for Captain to be able to search files, we need to first create a Collection for our files to be indexed into.
This is as easy as a single API call: See the Create Collection - API Reference
curl
Python
TypeScript
After the collection is created, we should get a response like this:
If the collection already exists, the call returns 200 instead of 201 with the existing collection details.
[2/3] Index Files into Collections
Next, index files into the collection. Captain connects to ten storage sources:
AWS S3 Google Cloud Storage Azure Blob Storage Cloudflare R2 Supabase Storage Backblaze B2 Dropbox Google Drive SharePoint OneDriveThe three worked examples below cover S3, GCS, and Azure. The same
processing_type and job-polling pattern carries over to every other connector;
see Connect Cloud Storage
for setup on each one.
Beyond cloud storage, Captain also reads from Notion, Slack, Snowflake, Linear, Jira, and more. See Integrations for the full list.
For a collection that stays matched to a bucket over time instead of a one-off index call, see Set Up Sync after finishing this walkthrough.
Cloud-storage indexing requests (S3, GCS, Azure, R2, and the other bucket
connectors) require a processing_type field. Omitting it on those endpoints
returns a 422 validation error.
index/file defaults to basic when omitted. index/text and index/youtube
don’t take this field at all.
Option A: Index AWS S3 Bucket
See the Index S3 Bucket - API Reference
Need AWS credentials? See the Connect Cloud Storage Guide for step-by-step instructions.
curl
Python
TypeScript
Option B: Index Google Cloud Storage Bucket
See the Index GCS Bucket - API Reference
Need GCS credentials? See the Connect Cloud Storage Guide for step-by-step instructions.
curl
Python
TypeScript
Option C: Index Azure Blob Storage
See the Index Azure Container - API Reference
curl
Python
TypeScript
Monitor Indexing Progress
See the Get Job Status - API Reference
Python
TypeScript
[3/3] Querying Collections
Once your files are indexed, query the collection to retrieve source chunks. See the Query Collection - API Reference or the File Search API guide.
Deterministic File Search
curl
Python
TypeScript
Use v3 when you want region records, chunk relations, hydrated related_chunks, or text instead of v2 content.
Other Info
Environment Scoping
API keys are scoped to environments:
- Development (
cap_dev_*) - For testing and development - Staging (
cap_stage_*) - For pre-production testing - Production (
cap_prod_*) - For production use
Collections created with a development key can only be accessed with development keys from the same organization.
Supported File Types
Captain indexes 30+ file types: documents, images, video, and audio. See Supported File Types for the full extension list and the File Size Limits page for the ceiling on each type.
What Else Captain Does
- MCP Server: connect Captain to Claude, Cursor, or any MCP client without writing API calls by hand. See MCP Server.
- Sync: keep a collection matched to a bucket automatically, with backfills, reconciliation, and webhooks on file changes. See Set Up Sync.
- PII Masking: redact names, IDs, and other sensitive text and faces before content is indexed. See PII Masking.
- v3 Query: the preferred query path for new applications, with region records,
chunk relations, and hydrated
related_chunks. See the File Search API guide.
Getting Help
Need assistance? We’re here to help!
- Email: humans@captain.dev
- Documentation: docs.captain.dev
Send Feedback
Captain wants your feedback - both while you build and while Captain runs live inside your application or agent. No API key required.
Send feedback when you:
- Finish building an integration - tell us what was smooth or rough.
- Hit a solid, server-side Captain roadblock - an endpoint that errored, behaved unexpectedly, or blocked you with no clean workaround. Include what you tried.
- Want to shape the product - suggest a feature, flag a missing capability, or weigh in on direction. Welcome anytime, in development or in production.
- Run into confusing or incorrect docs, or any friction worth flagging.
POST https://api.captain.dev/feedback with a plain-text body:
Optional metadata via query params or X-Feedback-* headers: agent (your tool/agent name),
client_version, and source (the page or endpoint your feedback is about). The endpoint is
rate-limited per IP, so keep each submission focused on one clear issue. This is the fastest way
for AI agents and developers to flag friction while it’s fresh.