API Documentation

Full OpenAPI spec is available at /api/openapi

POST/api/upload

Get a Vercel Blob client upload token. Upload directly from the browser.

POST/api/jobs

Create an analysis job from a Blob URL. Returns job_id immediately (202).

GET/api/jobs

List all analysis jobs. Filter by ?status=succeeded

GET/api/jobs/:id

Get full job details including transcript, tribe_result, narrative.

GET/api/jobs/:id/heatmap

Redirect to cortical activation heatmap PNG.

POST/api/jobs/:id/narrative

Regenerate narrative with a focus (attention/emotion/memory/language/general).

DELETE/api/jobs/:id

Delete job and associated Blob files.

POST/api/mcp

MCP Streamable HTTP endpoint. Use with Claude Desktop or any MCP client.

GET/api/mcp/sse

Legacy SSE MCP transport for older clients.

GET/api/health

Health check — returns status of database, blob, LLM configs.

GET/POST/DELETE/api/keys

Manage API keys for agent/programmatic access.

MCP Tools Available

analyze_mediaSubmit a URL for brain analysis
get_job_statusCheck processing progress
get_resultsRetrieve full analysis results
get_engagement_timelineGet per-timepoint engagement scores
list_jobsList recent analyses
generate_custom_narrativeRe-generate narrative with specific focus