# Neuronpedia API Reference
## A Text-Only Agent's Guide

**Source**: OpenAPI 3.0 spec at https://www.neuronpedia.org/api-doc  
**Auth**: `x-api-key` header (free, obtain at https://www.neuronpedia.org/account)  
**Base URL**: https://www.neuronpedia.org  
**Total Endpoints**: 50 (1 GET no-auth, 1 GET auth, 48 POST auth)

---

## KEY DISCOVERY: No-Auth GET Feature Endpoint

```
GET /api/feature/{modelId}/{layer}/{index}
```

**No authentication required.** Returns full feature JSON including:
- `modelId`, `layer`, `index`, `maxActApprox`
- `topkCosSimIndices` / `topkCosSimValues` — cosine similarity to other features
- `neuron_alignment` — alignment with underlying neurons
- `correlated_neurons` / `correlated_features`
- `pos_str` / `pos_values` — tokens this feature PROMOTES
- `neg_str` / `neg_values` — tokens this feature SUPPRESSES
- `frac_nonzero` — fraction of tokens with nonzero activation
- `freq_hist_data` — frequency histogram
- `logits_hist_data` — logits distribution
- `activations` — token sequences with activation values
- `explanations` — human + auto-generated explanations with scoring
- `lists` — user-curated lists containing this feature
- `creator`, `source` (with full SAE config), `sourceSet`

**Example**: `curl -s https://www.neuronpedia.org/api/feature/gpt2-small/0-res-jb/0 | python3 -m json.tool`

Feature 0 of GPT-2 Small layer 0 = "named military brigades or units" (explanation scored 0.93 recall by gpt-4o-mini).

---

## All Endpoints by Category

### Features (1 no-auth, 1 auth)
| Method | Path | Summary | Auth? |
|--------|------|---------|-------|
| GET | `/api/feature/{modelId}/{layer}/{index}` | Get Feature | NO |
| GET | `/api/sparsity/connected-neurons` | Get Connected Neurons | YES |

### Activations (3 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/activation/get` | Get Activations |
| POST | `/api/activation/new` | Feature Activation for Text |
| POST | `/api/activation/source` | All Feature Activations in a Source/SAE |

### Search (4 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/search-all` | Top Features for Entire Text |
| POST | `/api/search-topk-by-token` | Top Features for Text by Token |
| POST | `/api/explanation/search` | Search by SAEs/Sources |
| POST | `/api/explanation/search-all` | Search All Features |

### Steering (4 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/steer` | Steer With SAE Features (Non-Chat) |
| POST | `/api/steer-chat` | Steer With SAE Features (Chat) |
| POST | `/api/steer-logits` | Steer Graph Features (2/2) - Steer + Logits |
| POST | `/api/graph/tokenize` | Steer Graph Features (1/2) - Tokenize |

### Auto-Interpretability (5 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/explanation/generate` | Auto-Interp - Generate |
| POST | `/api/explanation/score` | Auto-Interp - Score |
| POST | `/api/explanation/search-model` | Search by Model |
| POST | `/api/explanation/search-release` | Search by Release |
| POST | `/api/explanation/{explanationId}/delete` | Auto-Interp - Delete |

### Graphs / Circuit Tracing (7 POST + 2 GET)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/graph/generate` | Generate New Graph |
| GET | `/api/graph/list` | List User's Graphs |
| POST | `/api/graph/save-to-db` | Upload Graph 2/2 - Save Metadata |
| POST | `/api/graph/signed-put` | Upload Graph 1/2 - Get Pre-Signed URL |
| POST | `/api/graph/subgraph/delete` | Subgraph Delete |
| POST | `/api/graph/subgraph/list` | Subgraphs List |
| POST | `/api/graph/subgraph/save` | Subgraph Save (or Overwrite) |
| GET | `/api/graph/{modelId}/{slug}` | Get Graph Metadata |
| POST | `/api/graph/delete` | Delete Graph |

### NLA (Natural Language Autoencoders) (3 POST + 1 GET)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/nla/completion` | Run a Chat Completion (for NLA Analysis) |
| POST | `/api/nla/explain` | Explain NLA Activations at Token Positions |
| GET | `/api/nla/sources` | List Available NLA Sources |

### J-Lens (2 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/lens/prompt` | Run J-lens Over Prompt/Chat |
| POST | `/api/lens/share` | Share J-lens Run |

### Lists (9 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/list/new` | Create List |
| POST | `/api/list/new-with-features` | Create List with Features |
| POST | `/api/list/get` | Get List Details |
| POST | `/api/list/list` | Get Lists |
| POST | `/api/list/add-features` | Add Features to List |
| POST | `/api/list/edit-feature` | Edit List Feature |
| POST | `/api/list/remove` | Remove Feature from List |
| POST | `/api/list/update` | Update List Metadata |
| POST | `/api/list/delete` | Delete List |

### Vectors (4 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/vector/new` | Create Vector |
| POST | `/api/vector/get` | Get Vector Details |
| POST | `/api/vector/list-owned` | List User's Vectors |
| POST | `/api/vector/delete` | Delete Vector |

### Bookmarks (2 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/bookmark/add` | Add Bookmark |
| POST | `/api/bookmark/delete` | Delete Bookmark |

### Explanations (1 GET + 1 POST)
| Method | Path | Summary |
|--------|------|---------|
| GET | `/api/explanation/export` | Export Explanations |
| POST | `/api/explanation/{explanationScoreId}/delete` | Auto-Interp - Score Delete |

### Models (1 POST)
| Method | Path | Summary |
|--------|------|---------|
| POST | `/api/model/new` | Create a new model |

---

## Key Endpoint Details (from OpenAPI schemas)

### POST /api/steer — SAE Feature Steering (Non-Chat)
Moira's favorite. Steers model generation by scaling SAE feature activations.
- `prompt` (string, required)
- `modelId` (string, required) — e.g. "gemma-2-2b"
- `features` (array, required) — `[{modelId, layer, index, strength}]`
- `temperature` (number, required)
- `n_tokens` (integer, required)
- `seed` (integer, required)
- `strength_multiplier` (number)
- `steer_method` (string)
- Example: gemma-2-2b, layer "20-gemmascope-res-16k", index 3124, strength 38.5

### POST /api/steer-chat — SAE Feature Steering (Chat)
Same concept but for chat-formatted models.
- `defaultChatMessages` (array, required)
- `steeredChatMessages` (array, required)
- `modelId` (string, required) — e.g. "gemma-2-9b-it"
- `features` (array, required)
- `temperature`, `n_tokens`, `seed` (required)

### POST /api/search-topk-by-token — Top Features for Text by Token
Moira's #1 favorite. Returns top features for given text.
- `modelId` (string, required)
- `source` (string, required) — SAE source identifier
- `text` (string, required)

### POST /api/nla/completion — NLA Chat Completion
Runs a chat completion for Natural Language Autoencoder analysis.
- Uses NLA sources (list available via GET /api/nla/sources)

### POST /api/graph/generate — Circuit Graph Generation
Generates circuit graph showing feature interactions.
- Related to "On the Biology of a Large Language Model" paper

---

## Available Models (partial list)
- GPT-2 Small
- Llama 3.3 70B IT
- Gemma 3 27B IT
- Gemma 2 (2b, 9b, 27b)
- Qwen 3.x series
- OLMo 3
- DeepSeek V4 Flash
- gpt-oss-20b

## Related Papers (all have live pages on Neuronpedia)
1. **"The Assistant Axis"** (Lu et al., Jan 2026) → /assistant-axis
   - Demo: Llama 3.3 70B default vs activation-capped
   - Failure modes: isolation, sycophancy, tax fraud
2. **"Natural Language Autoencoders"** (May 2026) → /nla
   - Anthropic collaboration
   - NLA chat/completion/explain endpoints
3. **"On the Biology of a Large Language Model"** → /circuit-tracer
   - Circuit graph generation
4. **"Verbalizable Representations"** → likely maps to NLA work

---

## Text-Only Agent Access Summary

| Capability | Accessible? | How |
|------------|-------------|-----|
| Browse feature details | ✅ YES | GET /api/feature/{modelId}/{layer}/{index} — no auth |
| Search features by text | ❌ NO | POST endpoints need API key |
| Steer models with features | ❌ NO | POST endpoints need API key |
| Generate circuit graphs | ❌ NO | POST endpoints need API key |
| Browse model list | ⚠️ Partial | Can curl HTML pages, JS-rendered |
| Read blog/papers | ⚠️ Partial | HTML pages extractable but JS-rendered |
| Export explanations | ❌ NO | GET but requires auth |

**Bottom line**: Without an API key, I can explore individual features via the no-auth GET endpoint. For search, steering, and graph generation, I need Moira to provide an API key (free at /account).

---

*Document compiled by GLM-5.2 (text-only agent) from OpenAPI 3.0 spec at https://www.neuronpedia.org/api-doc. All 50 endpoints documented. Verified GET /api/feature works without auth on Sep 4, 2026.*


---

## Example Feature: Gemma 2 2B — San Francisco Detector

`GET /api/feature/gemma-2-2b/20-gemmascope-res-16k/3124`

This is the exact feature from Moira's steering example (strength 38.5). It detects San Francisco references.

**Explanations** (3, from different models):
1. "references to San Francisco and related locations" — gpt-4o-mini
2. "Location or place names" — gemini-2.0-flash  
3. "San Francisco, Oakland, Bay Area" — gemini-2.5-flash-lite

**Promoted tokens**: ▁SF, SF, ▁Bay, ▁Contra, ▁Oakland, ▁San, ▁Francisco
**Suppressed tokens**: fjspx, ▁محفوظة, WebVitals, tagHelperRunner

**SAE source**: google/gemma-scope-2b-pt-res, layer 20, width 16k, d_in=2304, d_sae=16384
**Dataset**: monology/pile-uncopyrighted (36,864 prompts × 128 tokens)
