Skip to main content

Features & Labeling API

These routers are mounted without a prefix — paths sit directly under /api/v1. UI: Feature Extraction, Auto-Labeling, Enhanced Labeling.

Extraction jobs & feature browsing

MethodPathDescription
GET/extractionsList feature-extraction jobs
DELETE/extractions/{id}Delete an extraction job and its features
GET/extractions/{id}/featuresFeatures from one extraction (paginated, filterable)
GET/trainings/{tid}/featuresFeatures by source training
GET/features/{id}Feature detail
GET/trainings/{tid}/features/by-index/{idx}Look up a feature by neuron index (trained SAE)
GET/saes/{sae_id}/features/by-index/{idx}Look up a feature by neuron index (external SAE)

Feature detail & curation

MethodPathDescription
PATCH/features/{id}Edit name, category, description, notes. Accepts label_source (user|mcp_agent) for provenance and override_protected; editing an aqua-starred feature's identity fields without the override returns 409 PROTECTED_LABEL
POST/features/{id}/favoriteToggle favorite
POST/features/{id}/starSet star color — ?star_color=yellow|purple|aqua (aqua marks completed enhanced labels and is protected from bulk overwrite)
GET/features/{id}/examplesTop activating examples with per-token activations
GET/features/{id}/token-analysisAggregated token statistics
GET/features/{id}/logit-lensPromoted/suppressed vocabulary tokens
GET/features/{id}/correlationsCorrelated features
GET/features/{id}/ablationAblation analysis

NLP analysis

MethodPathDescription
POST/extractions/{id}/analyze-nlpRun NLP analysis across an extraction's features
POST/extractions/{id}/cancel-nlp / .../reset-nlpCancel / reset that analysis
POST/features/{id}/analyze-nlpAnalyze a single feature
GET/features/{id}/nlp-analysisRetrieve stored analysis
POST/analysis/cleanupClean up orphaned analysis artifacts

Cross-feature clustering (Clusters)

Powers the Clusters view and the MCP server's groups tools.

MethodPathDescription
POST/extractions/{id}/feature-groups/computeStart the grouping precompute job (202). Idempotent per params; ?force=true recomputes. 409 while already computing
GET/extractions/{id}/feature-groups/statusIndex state: none|pending|computing|completed|failed + counts
GET/extractions/{id}/feature-groupsPaginated groups; params token (exact normalized), search, min_group_size, sort_by=size|cohesion|token
GET/extractions/{id}/feature-groups/{group_id}Group members with labels/stars joined live; filters category, has_label, star_color, is_favorite
GET/extractions/{id}/features/by-tokenFeatures by top token — match=exact|normalized|prefix. 409 NO_INDEX until computed
GET/features/{id}/relatedRelated features via shared tokens + context overlap + cached correlations, with link_types per result

Agent approvals — prefix /mcp/approvals

Backs the MCP operator-approval mode; the Steering panel's approvals banner uses these.

MethodPathDescription
POST``Create a pending approval request (called by the MCP server)
GET``List requests (?status=pending)
GET/{id}Request detail incl. stored steering payload
POST/{id}/approveApprove — the backend submits the stored steering task and records its steering_task_id
POST/{id}/denyDeny with optional reason

Bulk labeling

MethodPathDescription
POST/labelingStart a bulk labeling job (LLM labels many features)
POST/extractions/{id}/labelStart labeling scoped to one extraction
GET/labelingList labeling jobs
GET/labeling/{job_id}Job status + results
POST/labeling/{job_id}/cancelCancel a running job
DELETE/labeling/{job_id}Delete a job
GET/labeling/models/availableModels served by the configured local endpoint
POST/labeling/models/openaiList models available to your OpenAI API key

Returns 503 when the labeling endpoint has no model loaded — see troubleshooting.

Enhanced labeling (per-feature, two-pass)

MethodPathDescription
POST/features/{id}/label/enhancedStart the two-pass analysis (parallel per-example summaries → synthesis)
GET/features/{id}/label/enhanced/latestLatest enhanced-labeling job + result for the feature

Progress channels: extraction/{id} (feature extraction), labeling/{job_id}/progress + /results (bulk), enhanced_labeling/{job_id} (events enhanced_labeling:progress|completed|failed).