> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b1e55ed.permanentupperclass.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Karma & Treasury API

> Treasury state and karma settlement endpoints.

## Karma concept (brief)

Karma is a 5-factor composite contributor reputation score scaled to **0–100**.

It is used for provenance/oracle projections and downstream agent weighting.

<Info>
  For the full formula and anti-gaming measures, see: `/contributing/karma-attribution`.
</Info>

***

## `GET /treasury`

Returns current treasury state from config and DB.

```bash theme={null}
curl -s \
  -H "Authorization: Bearer $TOKEN" \
  http://localhost:5050/api/v1/treasury | jq
```

Example response (`200`):

```json theme={null}
{
  "enabled": true,
  "percentage": 0.005,
  "treasury_address": "0x...",
  "pending_intents": 0,
  "receipts": 0
}
```

***

## Additional karma endpoints

The API also exposes:

* `GET /karma/intents` — list pending karma intents
* `POST /karma/settle` — record settlement for intent IDs
* `GET /karma/receipts` — list settlement receipts

***

## Export karma from the CLI

To export karma in a provenance-friendly format:

```bash theme={null}
b1e55ed export karma --format jsonl --include-chain
```

Write to a file:

```bash theme={null}
b1e55ed export karma \
  --format jsonl \
  --include-chain \
  --output ./exports/karma.jsonl
```
