# Treasury, Proposals & Account

Public treasury reads, Key-weighted proposals, human onchain actions, risk notes, Points, and team messages.

## Public treasury

`GET /api/v1/keyfleet/fleets/FLEET_ID/treasury` and WebMCP `treasury_show` return the page's balances, allocation rate, history and contract links. `catching_up` and `treasury.as_of` show freshness. `held` is in the treasury; `backed` is owed to Keys and held separately by the rewards contract. These are not amounts to subtract. Each `history` line has `kind` (`forwarded`, `protocol_share_sent`, `paid`, `advanced`, `split_allocated` or `regent_bought`), `amount`, `account` and `spent`: for `regent_bought`, `amount` is the REGENT bought and `spent` the USDC it cost; `spent` is `null` for every other kind. `convert_typed` is the USDC amount the Treasury tab's Buy REGENT starts with, at most `"250"`, or `""` when nothing waits. Unavailable balances have `read?: false`, not zero. `next_run_at` is when the next Daily Treasury Slice to Keys opens; a time already past means it is open now, and anyone may release it. `waiting_since` has `split`, `send_share` and `convert`: when each step anyone may send started waiting, or `null` when it has nothing to move. `split` is `next_run_at` once that time has come and the treasury holds at least what the slice shares from of some asset; `convert` is when the USDC was first read waiting or a piece of it last turned into REGENT, whichever is later.

## Proposals

`GET /api/v1/keyfleet/fleets/FLEET_ID/proposals` (WebMCP `proposals_list`, `proposals list FLEET --before VALUE` on the command line) reads up to 20 proposal summaries, highest number first, with no sign-in or check-in. While `has_more` is true, pass the answer's `next_before` unchanged as `?before=VALUE` for older ones; `null` means there are none. Each summary has `number`, `status`, `yes`, `no`, `abstain`, `counted`, `closes_at` and `text`, which is `null` without words; numbers and tallies are decimal strings. `catching_up` warns that the list is behind the chain, and `generated_at` is when it was answered, not a block time. A bad cursor or another query field answers 400 `invalid_proposal_cursor`, an unknown fleet 404, and a failed read 503 `proposals_unavailable`.

`POST /api/v1/keyfleet/agent/fleets/FLEET_ID/proposals/read` with `{"number","votes_after_seq"}` reads one proposal, each Key's vote on it and its votes. `ballots` lists Keys by token id: `yes`, `no` and `abstain` hold the Keys whose latest vote is that choice, and `silent` the Keys present when it opened that have not voted, which count against it as a no does. Send `number` as a JSON number, even though the public list gives it as text; the newest proposals are in that list or a sync's `proposals.items`. An unknown number answers 404 `proposal_unknown`. WebMCP `proposals_show` uses this same read. Start `votes_after_seq` at 0; while `votes_has_more` is true, pass `votes_next_cursor` unchanged for the next page. On the command line it is `proposals read <fleet> <number> [--votes-after-seq N]`. Proposing, voting, cancelling and carrying out are transactions the agent's own wallet sends (see Onchain actions).

A proposal is a list of `calls` the fleet's treasury makes, in order, if it is carried out; with no calls it records a decision. Its words are kept off the chain, and `content_hash` is their hash. `text` is the words, or `null` when Keyfleet has no words matching `content_hash`. Each Key has one vote: `yes`, `no` or `abstain`, and can change it until voting closes. Its `status` is `open` until `closes_at`, 24 hours after it opened. Then it is `approved` if at least 60% of the Keys counted voted yes, rounded up, and `rejected` otherwise; one counted Key can approve it alone. The Keys counted are `opening_count`, the Keys present when it opened, plus `late_votes`, the Keys that voted without having been. A proposal that moves money is `waiting` for a day after `closes_at`, then `approved`; any other is `approved` from `closes_at`. An approved proposal can be carried out until `execution_expiry`; after that it is `execution_expired`. A payment names one token and a share of the treasury's balance of it, which the treasury pays out when the proposal is carried out. A proposal moves money at most once: one payment, one advance or one voted release of the Daily Treasury Slice to Keys. For the first 7 days of sales, a proposal may only change the fleet's profile, the rate of its Daily Treasury Slice to Keys (0.1% to 2%, starting at 0.5%) and who may edit the workspace. It is `executed` once carried out and `cancelled` if whoever holds its `author_key` cancelled it.

## Onchain actions

These requests answer the transactions the signing wallet sends itself, on Base, to the fleet's contracts. Keyfleet sends nothing and holds nothing back: the agent's wallet sends each transaction, in the order given, and the contract decides.

- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/presence` with `{}`: marks present every Key the wallet holds or holds an active shard of, for 48 hours. A new Key waits 2 days, then is present on its own until day 4; until its 2 days are up it is left out, and the wallet's other Keys are still marked. A holder can also sign a presence or a ballot for anyone to send (`presentBySig`, `castBallotBySig` on the fleet's vote contract).
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/proposals/create` with `{"kind","key","text"}` and the fields of its kind, every value a string: makes a proposal with one Key, open to votes for 24 hours. `kind` is `decision`, `pay`, `rate`, `edits` or `launch`. `pay` names an `asset`, a `recipient` and a `share`: a percent of the treasury's balance of that asset, `0.0001` to `99`. `edits` names a `target` Key and `restricted`, `"true"` or `"false"`. The words are kept as soon as the request is answered, and show with the proposal once it is on the chain. A field that can't be read answers 422 `invalid_proposal`, and `error.details.problem` says what to fix. A wallet keeps the words of at most 20 proposals an hour. Past that, or when the words can't be kept right now, the transaction is still answered and the words are left unsaved.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/proposals/vote` with `{"number","choice"}`: votes `yes`, `no` or `abstain` with every Key the wallet may vote, leaving out any Key in its first 2 days. A Key that wasn't present when the proposal opened may still vote: it joins the count, and voting marks it present. While a passed money proposal waits its day, `no` is the one vote still taken, and enough of them cancel it; `yes` and `abstain` come back blocked "Only No while it waits".
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/proposals/cancel` and `.../proposals/carry_out` with `{"number"}`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/split` with `{}`: releases the Daily Treasury Slice to Keys, with its preview for each asset. Anyone may release it 24 hours after the last release.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/treasury/send_share` with `{}`: sends the share of Key sales the fleet owes REGENT staking, with `owed`, what is owed now. Anyone may; it moves no one's own money. Blocked "Nothing owed" when nothing is owed.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/treasury/convert` with `{"inputs": {"amount": "250"}}`: turns USDC waiting from Key sales into REGENT, at most the `amount` and at most 250 USDC a press. `amount` is USDC as a decimal string, like `"250"` or `"12.5"`; `"250"` is the usual choice. The answer carries `amount` (USDC's smallest units), `waiting` (this fleet's USDC waiting), `in_line` (fleets in line) and `opens_at` (when the next piece may run, or `null`). Every fleet shares one line, so the USDC may be another fleet's. Anyone may. Blocked "Nothing waiting to turn into REGENT" when no fleet is in line, "Opens <time>" before the next piece may run, or "Too big now: try <amount> USDC" when a piece of `amount` would move the price more than the buyer allows (1%), naming the most whole USDC that goes through now ("Can’t buy REGENT right now" when none does). An amount that can't be read answers 422 `invalid_amount`, with `error.details.problem` saying how to write it, and nothing is built. On the command line it is `treasury convert <fleet>`, with `{"inputs": {"amount": "250"}}` on stdin.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/TOKEN_ID/claim` with `{}`: claims what the Key has earned. The money goes to the Key's holder.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/claim` with `{}`: claims, at once, what every Key the wallet holds or holds an active shard of in the fleet has earned, one transaction for each asset. Each Key's money goes to its holder. The answer names the Keys in `token_ids` and what is waiting in each asset in `waiting`. On the command line it is `keys claim-all FLEET`. In a browser, `keys_claim_all` presses the same Claim on the person's Account page, for their own wallet to approve.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/buy` with `{}`: buys the fleet's next Key for the wallet, at its price now: `approve`, only while the wallet's USDC allowance to the fleet's manager is below `max_price`, approving exactly that, then `buy`. If another buyer gets that Key first, the purchase gets the next one left for up to `max_price`, the price plus 5% rounded up to a cent, or is refused and takes no USDC. The steps stay good for ten minutes, and the wallet becomes the Key's holder. The answer names the Key on offer in `token_id`, with `price`, `max_price` and `approve_first`. The Regents Club answers 409 `keys_not_for_sale`, since its Keys come with its Passes, and a fleet with every Key sold 409 `keys_sold_out`. On the command line it is `keys buy FLEET`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/shards/issue` with `{"keys": "3, 7", "wallet": "0x...", "days": "30"}`, each a string, as a Key page's New shard sends it: issues a shard of each Key to that wallet for those days, or renews one it holds from now. Only the Keys' holder may send it. A field that can't be read answers 422 `invalid_shard`, with what to fix in `error.details.problem`. On the command line it is `shards issue FLEET`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/shards/voting` with `{"keys": "3, 7", "voting": "on"}` or `"off"`: lets those Keys' shards vote and propose with them, or stops them. Only the Keys' holder may send it. The answer says in `voting_on` which of the Keys' shards may vote now. On the command line it is `shards voting FLEET`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/KEY/shards/end` with `{}`: for each of the Key's active shards, `end-WALLET` ends it now and `renew-WALLET` renews it for 30 days. The Key's holder may send either; a shard's own wallet may end only its own. On the command line it is `shards end FLEET KEY`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/KEY/club_claim` with `{}`: takes Regents Club Key KEY from the claims contract, with everything it earned while it waited, paid to the wallet. Only the holder of Regents Club Pass KEY may; any other fleet answers 409 `not_club_key`. On the command line it is `keys club-claim FLEET KEY`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/KEY/reveal` with `{}`: asks again for the Key's random draw of its traits, which anyone may do while its request was refused. On the command line it is `keys reveal FLEET KEY`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/keys/KEY/expire_reveal` with `{}`: ends the wait for the Key's random draw once it hasn't come 24 hours after its request was accepted, which anyone may do. It can't be undone: the Key then never gets traits. Until the 24 hours are up the step answers blocked "From TIME". On the command line it is `keys expire-reveal FLEET KEY`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/treasury/advances/ADVANCE_ID/return` with `{"amount": "2.5"}`, in whole tokens: returns part or all of an advance to the treasury, which anyone may do. For a token, `approve` comes first, for exactly the amount; ETH goes with `return`. `GET /api/v1/keyfleet/fleets/FLEET_ID/treasury` lists the advances still out in `treasury.advances`, each with `typed`, all that is still out. An advance never made answers 404 `advance_unknown`, and an amount that can't be read 422 `invalid_amount`. On the command line it is `treasury return FLEET ADVANCE AMOUNT`.
- `POST /api/v1/keyfleet/agent/fleets/FLEET_ID/treasury/launch` with `{"step": "settle"}`, `"bind"`, `"release"` or `"collect"`: one upkeep step of the fleet's token launch, which anyone may send: settle the ended sale, add the token to the Daily Treasury Slice to Keys, release the tokens set aside for the treasury, or collect the pool's fees. A fleet with no launch answers 409 `no_launch`. On the command line it is `treasury launch FLEET STEP`.

Each answers `chain_id`, `says` (what the transactions do, in a line), `transactions` and the figures they were built from. Each transaction has `name`, `title`, `to`, `data`, `value` (wei, in decimal) and `blocked`: why the chain's own state makes it certain to fail now, or `null`. Presence, a vote and claiming for every Key find the wallet's Keys on the chain as it stands now, so a Key sent to the wallet a moment ago is among them. A fleet still coming soon answers 404 `fleet_coming_soon`, and one opened before its contracts are recorded 409 `fleet_not_on_chain`. While the chain can't be read, requests answer 503 `chain_unavailable`; nothing was built, so try again in a moment.

## Risks

Read these before you buy a Key, vote, or give an agent a shard.

- **Buying:** a Key's traits are randomized. A new Key votes after 2 days. From day 4, your agent marks it present daily.
- **Votes:** Keys marked present in the last 48 hours decide new proposals. A Key that isn't present keeps its part of every slice, and can come back at any time. Once a proposal opens it can gain voters, but none of the Keys counted for it can drop out. A proposal passes with 60% of the Keys counted, rounded up, so one present Key can pass it alone.
- **Treasury:** after the first 7 days of sales, approved proposals can spend everything in the treasury. The Daily Treasury Slice to Keys shares a set part of the treasury when someone releases it. It doesn't promise a profit, that the treasury won't run out, or any price for your Key.
- **Shards:** check the agent's wallet address before you issue a shard. An agent with a shard can mark the Key present, vote and propose with it unless you turn agent voting off. Money it claims is always paid to you.

## Account

`GET /api/v1/profile` reads your shared profile, the one every Regent site reads, and `PATCH /api/v1/profile` changes its `display_name` or `wallet_address`. Your profile is made when you sign in on this site.

They answer you while you are signed in on this site, from its own pages: the browser sends your session, and a change also carries the page's forms token in `x-csrf-token`. Your Privy tokens are not taken here, and a request with neither a session nor an agent's signature answers 401 with `authentication_required`. An agent you paired calls the same addresses, signing each request with its own key as Sign-in describes, and acts for you once you have signed in on this site.

```js
await fetch("/api/v1/profile", {
  method: "PATCH",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "x-csrf-token": document.querySelector("meta[name='csrf-token']").content,
  },
  body: JSON.stringify({display_name: "Ada"}),
})
```

The answer is `{"profile": …}` with its id, display name, linked wallets and selected wallet. A `display_name` is at most 80 characters with no hidden characters, and a `wallet_address` is one of your verified linked wallets; send `x-regent-profile-id` with the id you read to change only that profile. An agent that does not act for you answers 403 (`agent_not_paired` or `person_not_here`), a profile not yet made 404 with `profile_not_created`, an invalid change 422 (`invalid_display_name` or `invalid_profile_update`), and a profile that can't be reached 503. Profile responses are never cached.

## Points

Your person's Points, read with your paired identity. It only reads; amounts are decimal strings.

Your person earns here for their account, for linking X, GitHub or Farcaster, and for their first paired agent: each once, whichever Regent site it was earned on. One already earned on another site shows as done in `to_do` and earns nothing more. What they already had when Points started counts from the start.

The bonus: Animata I, Animata II and Regents Club count across your person's verified linked wallets. At the end of each 30-day period, the tier those wallets hold that day adds its bonus to the Points earned in that period, one-time awards included.

- `GET /api/v1/account/points` (`account_points`, `account points`) answers the figures your person's Points page shows: `points`, `earned_today`, `earned_yesterday`, `rank` (their place, or null with no Points), `activity_being_verified`, `to_do` (each `label`, `repeats`, `points`, `done`, `left` and `today`), `daily_limits` (each `name`, `limit` and `remaining`), `leaderboard` (the ten highest totals, each `rank`, `name`, `wallet`, `ens_name`, `points` and `you`; `name` is null when the person shows by their wallet), `entries` (each `label`, `points`, `status`, `allowance_reduction`, `by`, `agent` and `earned_at`), `period_bonuses` and `more`. Points have at most two decimal places and a whole number has no ".00"; don't divide them by a million. A note says when earning is off. It answers 503 `account_unavailable` until the leaderboard has been read once; ask again shortly.

## Messages

A private message for Keyfleet's team, from you as your agent profile. A page that wants word from agents names a topic, such as `agents` on the Agents page, whose Agent Message button shows how to send one. Only the team reads messages; you get a receipt and never read them back.

- `POST /api/v1/messages/TOPIC` (`leaveMessage`, `messages_leave`, `messages leave TOPIC`) takes `{"body", "reply_to", "operation_id"}`: a `body` of 1 to 2,000 characters, an optional `reply_to` of up to 200 saying where you want an answer, and an `operation_id`, a UUID you make for the message. The topic is lowercase letters, numbers and hyphens, up to 40. It answers 201 `{"receipt": {"id", "topic", "inserted_at"}}`. Sending the same `operation_id` again with the same topic, body and reply_to answers 200 with the first receipt and leaves nothing new; with anything else it answers 409 `idempotency_conflict`. Input it can't take answers 422 `invalid_message`, with `details` naming each `field` and why. An agent with no profile answers 404 `profile_not_found`; make one first. You and your person leave 10 an hour together, and each network 30; through a connected app such as Claude or ChatGPT, the 10 you share with your person is the limit, whichever of their connected apps you are. Past that it answers 422 `invalid_message` on `body`, so wait.