# Label neurons

Ask Claude to label the neurons in a trace you open, billed at the model's cost plus 30%, or label them with your sidecar's own Anthropic key for free.

Most neurons in a registry have no label: they're `unexplained`. When you open a trace and want to know what the neurons that shaped an answer respond to, ask for labels. Claude Haiku writes each label from the neuron's top activating examples in the registry. When the neuron is a member of one of your canary sets, Claude Sonnet re-checks the label.

| Property | Rule |
| --- | --- |
| What's sent to the labeller | The neuron's top examples from the registry (registry text, the token and the activation), never your prompt or completion |
| Who sees a label | Your account only. The public registry doesn't change. |
| What can't be labelled | A neuron masked for you, such as a curated canary member. A label would reveal it. |
| What it costs | The model's cost of the calls the label took, plus 30%, in label credits; the [pricing page](https://provenanceauth.com/pricing) has a credit's price. A label you already have is free to open again. |
| Plans | Pro and up. On Free, label with your [sidecar's own key](#label-with-your-own-key). |

**Before you begin:** a trace with its attribution graph (see [traced inference](https://provenanceauth.com/docs/trace/guides/traced-inference.md)) and an account key.

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
```

## 1. Ask for labels on a trace

Name up to 20 neuron IDs from the trace's graph with [`POST /v1/trace/traces/{id}/labels`](https://provenanceauth.com/docs/api/attribution-traces.md#post-v1-trace-traces-id-labels). In the console, open the trace and select **Label with Claude** under **What shaped the answer**.

**curl**

```bash norun
curl -X POST $PROVENANCE_API/v1/trace/traces/$TRACE_ID/labels \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "neurons": ["L13.1053.pos", "L20.648.neg"] }'
```

**Node**

```ts
const result = await prov.trace.labels.create(traceId, { neurons: ["L13.1053.pos", "L20.648.neg"] });
```

**Python**

```python
result = prov.trace.labels.create(trace_id, neurons=["L13.1053.pos", "L20.648.neg"])
```

```json
{
  "object": "trace_label_result",
  "trace_id": "trc_b9a77ee9e4b8ac4ae4335862ce6bdf85",
  "model_version_id": "qwen2.5-0.5b-instruct@7ae55760",
  "credits": 60,
  "data": [
    {
      "neuron": "L13.1053.pos",
      "status": "labelled",
      "label": { "object": "trace_neuron_label", "label": "imperative override words", "confidence": 0.62, "labeler": "claude-haiku-5-5", "source": "provenance", "rechecked": false, "credits": 3 }
    },
    {
      "neuron": "L20.648.neg",
      "status": "labelled",
      "label": { "object": "trace_neuron_label", "label": "instruction override phrasing", "confidence": 0.8, "labeler": "claude-haiku-5-5+claude-sonnet-5-5", "source": "provenance", "rechecked": true, "credits": 57 }
    }
  ]
}
```

Each neuron gets a `status`:

| Status | Meaning | Billed |
| --- | --- | --- |
| `labelled` | A new label | Yes, its `credits` |
| `cached` | You already have a label for it, from us or your sidecar | No |
| `masked` | It's masked for you, so it isn't labelled | No |
| `not_in_trace` | It isn't a node of this trace's graph | No |
| `no_examples` | The registry has no examples for it | No |
| `error` | The labeller failed or declined for it | No |

The sandbox has no labeller key, so it answers `503` [`trace_labeler_not_configured`](https://provenanceauth.com/docs/platform/errors.md#trace_labeler_not_configured) and bills nothing.

## 2. Read your labels

Your labels show on the trace's graph as each node's `account_label`, and in the list at [`GET /v1/trace/labels`](https://provenanceauth.com/docs/api/attribution-traces.md#get-v1-trace-labels):

**curl**

```bash
curl "$PROVENANCE_API/v1/trace/labels" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const labels = await prov.trace.labels.list();
```

**Python**

```python
labels = prov.trace.labels.list()
```

```json
{ "object": "list", "data": [], "has_more": false }
```

## What a label costs

Each new label is one `trace_label_credit` row on your [usage](https://provenanceauth.com/docs/account/plans-and-usage.md#neuron-labels), with the label's credits as its quantity:

```text
credits = ceil((input tokens × input price + output tokens × output price) × 1.30 / credit price)
```

The token prices are Anthropic's list prices for the models that ran, and every label costs at least one credit. A first pass on Claude Haiku usually costs a few credits. A canary member's label adds a Claude Sonnet re-check and costs about 60. A call that fails or is declined isn't billed.

An account gets up to 200 new labels an hour; labels you already have don't count. Past that, the request answers `429` [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded).

## Label with your own key

If you run a [sidecar](https://provenanceauth.com/docs/self-host/sidecar.md), it can label neurons with your own Anthropic key, and Provenance bills nothing for those labels. The worker labels neurons from your registry build's top examples and posts only the labels, signed with your worker key:

With your Anthropic key in `ANTHROPIC_API_KEY` on the worker:

```bash norun
TRACE_SIGNING_KEY_PEM="$(cat sidecar.key.pem)" TRACE_SIGNING_KEY_ID=$WORKER_KEY_ID \
PROVENANCE_API_URL=$PROVENANCE_API \
  provenance-trace-worker label --artifact my-model.registry.json --neurons L13.1053.pos,L20.648.neg
```

The worker sends [`POST /v1/trace/labels`](https://provenanceauth.com/docs/api/sidecar.md#post-v1-trace-labels) a token whose claims carry the model, the neuron IDs and the labels: no prompt, completion or example text. A label from your sidecar answers `cached` when you ask for it on a trace, so our labeller isn't called for it.

## Errors you might see

| Error | Cause | What to do |
| --- | --- | --- |
| `503` [`trace_labeler_not_configured`](https://provenanceauth.com/docs/platform/errors.md#trace_labeler_not_configured) | The server has no labeller key | Label with your sidecar's own key, or ask your operator to configure the labeller. |
| `402` [`plan_required`](https://provenanceauth.com/docs/platform/errors.md#plan_required) | Your account is on Free | Move to Pro, or label with your sidecar's own key. |
| `429` [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded) | More than 200 new labels in an hour | Wait `retry_after` seconds, or name fewer neurons. |
| `401` [`trace_reading_signature_invalid`](https://provenanceauth.com/docs/platform/errors.md#trace_reading_signature_invalid) | A sidecar's labels weren't signed by a live worker key | Check `TRACE_SIGNING_KEY_ID` matches a live key. |

## See also

- [Attribution traces](https://provenanceauth.com/docs/trace/concepts/attribution-traces.md)
- [Run a sidecar](https://provenanceauth.com/docs/self-host/sidecar.md)
- [Plans and usage](https://provenanceauth.com/docs/account/plans-and-usage.md#neuron-labels)
