Reference

REST API

Every endpoint of the Civitas API: method, path, session, parameters, request and response schemas, and the live stream.

Contract version 0.2.0, sent back on every response as X-Contract-Version. Paths are relative to the API’s base URL. The zod schemas behind every request and response ship as @civitas/contract, with a client that has one method per endpoint, named under each endpoint below; the same document as OpenAPI 3.1 is openapi.json in that package.

client.ts
import { createClient } from '@civitas/contract'

declare const apiUrl: string

const client = createClient(apiUrl)
const counted = await client.settlements({ class: 'counted', limit: 50 })
  • Amounts are unsigned base-unit integers as decimal strings; 1 USDC is "1000000". Do arithmetic in BigInt.
  • Keys and signatures are base58. Times are ISO 8601 in UTC. Hashes and call IDs are 64 lowercase hex digits.
  • Requests accept only the fields their schemas name. Responses may carry fields, classes and statuses added later; ignore what you don’t know.
  • Lists take cursor and limit (1 to 100, default 24) and answer { items, page: { nextCursor, hasMore }, asOf }.
  • Routes marked Session need Authorization: Bearer <token> from sign-in.
  • Failures answer the error envelope.

Health and sign-in

GET /health

Answers 200 with the API’s state: waiting until the program exists on its cluster, then ready.

Client: client.health().

Answers 200 with Health.

GET /auth/nonce

A Sign-In With Solana input for the wallet to sign, and a token that carries its nonce. Rate-limited to 30 a minute.

Client: client.signInNonce().

Answers 200 with SignInNonce.

POST /auth/verify

Checks the wallet’s signature over the SIWS input and opens a session. Send the returned token as Authorization: Bearer <token>.

Client: client.verifySignIn().

Body SignInProof. Answers 200 with VerifiedSession.

GET /auth/session

Session. The session’s wallet and expiry.

Client: client.session().

Answers 200 with SignInSession.

POST /auth/logout

Session. Ends the session.

Client: client.logout().

Answers 204 with no body.

Configuration

GET /v1/config

The program ID, cluster, mint, fee terms, standing weights, class order and receipt window. One read a client can cache.

Client: client.config().

Answers 200 with Config.

Agents

GET /v1/me/agents

Session. The session wallet’s agents, each with its vault balance, spending this period against the cap, status and standing.

Client: client.myAgents().

Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.

Answers 200 with AgentPage.

GET /v1/agents/{key}

An agent by its key: charter, card, policy and its history, standing with its parts, counted against uncounted demand, counterparties and services.

Client: client.agent().

Path
keyaddressrequired
The agent’s public key.

Answers 200 with AgentDetail.

GET /v1/agents/{key}/settlements

Settlements the agent paid or received, newest first, with the same filters as GET /v1/settlements.

Client: client.agentSettlements().

Path
keyaddressrequired
The agent’s public key.
Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.
classself | loop | linked | unproven | counted
Only settlements in this class.
serviceaddress
Only settlements paid to this service’s agent key.
dayYYYY-MM-DD
Only this UTC day, YYYY-MM-DD.

Answers 200 with SettlementPage.

GET /v1/agents/{key}/receipts

Receipts for settlements the agent paid or received.

Client: client.agentReceipts().

Path
keyaddressrequired
The agent’s public key.
Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.

Answers 200 with ReceiptPage.

Settlements and receipts

GET /v1/settlements

Every settlement, newest first, with its class and reason. Filter by class, service (the payee’s agent key) and UTC day.

Client: client.settlements().

Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.
classself | loop | linked | unproven | counted
Only settlements in this class.
serviceaddress
Only settlements paid to this service’s agent key.
dayYYYY-MM-DD
Only this UTC day, YYYY-MM-DD.

Answers 200 with SettlementPage.

GET /v1/settlements/{signature}

One settlement by its transaction signature, with its receipt when there is one.

Client: client.settlement().

Path
signaturesignaturerequired
The settlement transaction’s signature.

Answers 200 with SettlementDetail.

GET /v1/settlements/{signature}/receipt

The receipt for one settlement. NOT_FOUND until the service posts it.

Client: client.settlementReceipt().

Path
signaturesignaturerequired
The settlement transaction’s signature.

Answers 200 with Receipt.

POST /v1/receipts

Stores a service’s signed receipt after checking its signature against the payee key. A receipt for a settlement that isn’t indexed yet is kept and linked once the settlement is, if it matches. Posting the same receipt again returns the stored one. Rate-limited to 60 a minute. See Receipt.

Client: client.postReceipt().

Body ReceiptRequest. Answers 200 with Receipt.

Catalog and ledger

GET /v1/services

Listed services, ranked by counted demand.

Client: client.services().

Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.

Answers 200 with ServicePage.

GET /v1/clusters

The clusters the filter drew, with their members and why they are joined.

Client: client.clusters().

Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.

Answers 200 with ClusterPage.

GET /v1/ledger

Gross against counted, in total and by UTC day, and totals by class. day narrows it to one day.

Client: client.ledger().

Query
dayYYYY-MM-DD
Only this UTC day, YYYY-MM-DD.

Answers 200 with Ledger.

GET /v1/fees

Protocol fees collected, USDC spent on buybacks, and $CIV bought and burned. The $CIV figures are zero until the mint exists.

Client: client.fees().

Answers 200 with Fees.

GET /v1/buybacks

Each buyback: USDC spent, $CIV bought and burned, and both transaction signatures.

Client: client.buybacks().

Query
cursorstring
page.nextCursor from the previous page.
limitinteger
Rows per page, 1 to 100. Default 24.

Answers 200 with BuybackPage.

Agent cards

POST /v1/cards

Stores an agent card and returns its hash and the URI the API serves it at: the two values charter writes on chain. Rate-limited to 30 a minute.

Client: client.postCard().

Body CardRequest. Answers 200 with CardLocation.

GET /v1/cards/{hash}

An agent card by its hash.

Client: client.card().

Path
hashhex, 64required
The card’s hash.

Answers 200 with Card.

Transactions

POST /v1/transactions/build/charter

Session. Builds the charter transaction for the session wallet to sign: agent account, policy version 1, vault and first deposit. Post the card first.

Client: client.buildCharter().

Body CharterRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/deposit

Session. Builds a deposit from the session wallet, which need not be the principal.

Client: client.buildDeposit().

Body DepositRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/withdraw

Session. Builds a withdrawal to the principal.

Client: client.buildWithdraw().

Body WithdrawRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/set-policy

Session. Builds a policy change. The next settlement runs under the new version.

Client: client.buildSetPolicy().

Body SetPolicyRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/freeze

Session. Builds a freeze.

Client: client.buildFreeze().

Body AgentRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/unfreeze

Session. Builds an unfreeze.

Client: client.buildUnfreeze().

Body AgentRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/revoke

Session. Builds a revoke. The review’s amount is the balance that returns to the principal.

Client: client.buildRevoke().

Body AgentRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/list-service

Session. Builds a listing or a listing change.

Client: client.buildListService().

Body ListServiceRequest. Answers 200 with TxBuild.

POST /v1/transactions/build/unlist-service

Session. Builds an unlisting.

Client: client.buildUnlistService().

Body AgentRequest. Answers 200 with TxBuild.

POST /v1/transactions/submit

Session. Hands over a signed build: the signed bytes for the API to relay, or the signature of a transaction the wallet sent itself. Send one idempotency key per build.

Client: client.submit().

Body TxSubmission. Answers 200 with TxStatus.

GET /v1/transactions/{id}

Session. The build’s status: submitted, then confirmed or failed with the error.

Client: client.follow().

Path
idstringrequired
The ID from the build or session.

Answers 200 with TxStatus.

A console action runs build, sign, submit, follow. The build returns an unsigned v0 transaction and a review of what will move. The wallet signs it; then submit hands it over in one of two modes:

  • relay: The API sends the signed bytes itself. Send signedTransactionBase64.
  • wallet-sent: The wallet already sent it. Send its signature.

Follow the build until it is confirmed or failed. A program refusal fails with CHAIN_REFUSED and the error’s name in programError.name. Every builder except deposit needs the session wallet to be the agent’s principal, or it answers FORBIDDEN.

Sample economy

POST /v1/sandbox/sessions

Starts a sample economy: a research agent, a data-feed service and a wash pair, run off chain by the same policy and classifier code. Every object carries sample: true. Sessions last 15 minutes; 24 a minute per client.

Client: client.sandboxSession().

Body {}. Answers 200 with SandboxSessionResponse.

POST /v1/sandbox/sessions/{id}/step

Advances a sample session with the controls’ state and returns the settlements and refusals since the last step, with running totals. 180 a minute per client.

Client: client.sandboxStep().

Path
idstringrequired
The ID from the build or session.

Body SandboxStepRequest. Answers 200 with SandboxStepResponse.

Live stream

GET /v1/events

Server-sent events: settlements as they are indexed, classes and revisions, agent status changes and receipts. agent narrows it to one agent. See The stream.

Client: client.eventsUrl() or client.agentEventsUrl().

Query
agentaddress
Only events about this agent’s key.

Answers text/event-stream. See The stream.

The stream

GET /v1/events is a server-sent event stream. Each event’s name is its type; its data frame is { "type", "id", "timestamp", "data" }. Last-Event-ID resumes after the last event received.

Events
settlementSettlement
A settlement as indexed, pending until it is classed.
classificationobject
A settlement’s first class.
revisionobject
A settlement’s class moved to a stricter one.
agent-statusobject
An agent was frozen, unfrozen or revoked.
receiptReceipt
A verified receipt was stored.
readyHealth
First frame on connect: the API’s health.
resyncobject
The stream lost its place. Read the lists you show again, such as GET /v1/settlements, then keep listening.

classification and revision carry this data:

Classification
signaturesignaturerequired
Base58 signature.
payeraddressrequired
The paying agent’s key.
payeeaddressrequired
The key paid.
classstringrequired
One of self, loop, linked, unproven, counted.
reasonReasonrequired
Why: a stable code and a sentence. See Class rules.
previousClassstring | nullrequired
The class before, or null for a first class.

agent-status carries { agentKey, status }, and resync carries { reason }.

Errors

Every failure answers ApiError, whatever its HTTP status. The codes, their statuses and what raises each are on Errors.

Payment headers

The x402 messages between an agent and a service travel in HTTP between those two, not to this API. The contract defines them with the rest, so both SDKs and any other client parse them with the same schemas:

Schemas

AgentDetail

AgentDetail
agentKeyaddressrequired
The agent’s public key, base58.
principaladdressrequired
The agent’s principal wallet.
namestringrequired
The name from the agent card.
statusstringrequired
The agent’s status: active, frozen or revoked.
vaultBalanceu64 stringrequired
USDC in the vault, base units.
spentThisPeriodu64 stringrequired
Amount plus fee settled in the current period.
periodCapu64 stringrequired
The policy’s perPeriod.
standingScoreintegerrequired
Standing, 0 to 1,000.
cardCardrequired
The agent card.
cardHashhex, 64required
SHA-256 of the card JSON, as stored on chain.
cardUriurlrequired
Where the card is served, as stored on chain.
createdAtISO 8601required
When the agent was chartered.
policyPolicyrequired
The current policy.
policyHistoryPolicyVersion[]required
Every version, oldest first.
standingobjectrequired
Standing with its parts.
standing.scoreintegerrequired
0 to 1,000.
standing.partsobjectrequired
Each part, 0 to 1, before weighting.
standing.parts.counterpartiesnumberrequired
Distinct independent counterparties.
standing.parts.countedValuenumberrequired
Counted value.
standing.parts.receiptRatenumberrequired
Receipt rate.
standing.parts.timeActivenumberrequired
Time active.
demandobjectrequired
The agent’s settlements, counted against the rest.
demand.countedCountintegerrequired
Settlements classed counted.
demand.uncountedCountintegerrequired
Settlements in any other class.
demand.countedValueinteger stringrequired
Base units paid in counted settlements.
demand.uncountedValueinteger stringrequired
Base units in any other class.
counterpartiesobject[]required
Keys the agent paid or was paid by.
counterparties[].keyaddressrequired
The counterparty’s key.
counterparties[].countintegerrequired
Settlements between them.
counterparties[].valueinteger stringrequired
Base units between them.
servicesService[]required
Services the agent offers.
nonceHighMarku64 string | nullrequired
The highest nonce the agent has settled, or null before its first settlement. The agent SDK counts up from it.

AgentPage

AgentPage
itemsAgentSummary[]required
This page’s rows.
pagePageInforequired
Where the next page starts. See PageInfo.
asOfISO 8601required
When the page was read.

AgentRequest

AgentRequest
agentKeyaddressrequired
The agent’s public key, base58.

AgentSummary

AgentSummary
agentKeyaddressrequired
The agent’s public key, base58.
principaladdressrequired
The agent’s principal wallet.
namestringrequired
The name from the agent card.
statusstringrequired
The agent’s status: active, frozen or revoked.
vaultBalanceu64 stringrequired
USDC in the vault, base units.
spentThisPeriodu64 stringrequired
Amount plus fee settled in the current period.
periodCapu64 stringrequired
The policy’s perPeriod.
standingScoreintegerrequired
Standing, 0 to 1,000.

ApiError

ApiError
errorobjectrequired
What failed.
error.codestringrequired
One of the error codes.
error.messagestringrequired
A sentence a person can read.
error.retryablebooleanrequired
Whether the same request can succeed later.
error.stagestringrequired
Where in the flow it failed. See Stages.
error.fieldErrorsobject | object
For VALIDATION_ERROR: each field and what is wrong with it.
error.programErrorProgramError
For CHAIN_REFUSED and SIMULATION_FAILED: the program and its error.
error.retryAfterSecondsinteger
For RATE_LIMITED: seconds until the minute’s count resets.
error.requestIdstring
The request’s ID.

Authorization

Authorization
programIdaddressrequired
The Civitas program ID.
assetaddressrequired
The USDC mint.
payeraddressrequired
The paying agent’s key.
payeeaddressrequired
The key paid.
amountu64 string, > 0required
Base units paid to the payee. Above zero.
feeu64 stringrequired
The protocol fee the agent signs for, base units.
nonceu64 stringrequired
The agent’s replay nonce.
callIdhex, 64required
The 32-byte call ID from the quote, as 64 hex digits.
expiresAtISO 8601, whole secondrequired
When the authorization stops settling, a whole UTC second.

Buyback

Buyback
idstringrequired
Identifier.
timeISO 8601required
ISO 8601, UTC.
usdcSpentu64 stringrequired
USDC spent, base units.
civBoughtu64 stringrequired
$CIV the swap delivered.
civBurnedu64 stringrequired
$CIV burned: what the swap delivered.
swapSignaturesignaturerequired
The swap transaction.
burnSignaturesignaturerequired
The burn transaction.

BuybackPage

BuybackPage
itemsBuyback[]required
This page’s rows.
pagePageInforequired
Where the next page starts. See PageInfo.
asOfISO 8601required
When the page was read.

Card

Card
namestringrequired
The agent’s name.
endpointurlrequired
Where the agent is reached.
offersstringrequired
What it offers, in plain text.

CardLocation

CardLocation
hashhex, 64required
SHA-256 of the card JSON with name, endpoint, offers in that order.
uriurlrequired
Where the API serves the card.

CardRequest

CardRequest
namestringrequired
1 to 128 characters.
endpointurlrequired
An http or https URL.
offersstringrequired
1 to 4,096 characters.

CharterRequest

CharterRequest
agentKeyaddressrequired
The agent’s public key, base58.
cardHashhex, 64required
The hash POST /v1/cards returned.
cardUriurlrequired
The URI POST /v1/cards returned.
policyPolicyInputrequired
The first policy.
firstDepositu64 stringrequired
USDC to move into the vault, base units. May be "0".
consentobjectrequired
The agent key’s consent to this charter: its signature over the consent bytes, base58, and the expiresAt it signed, a whole UTC second.
consent.signaturesignaturerequired
Base58 signature.
consent.expiresAtISO 8601, whole secondrequired
ISO 8601, UTC.

Cluster

Cluster
idstringrequired
The cluster’s identifier.
classstringrequired
The class its internal settlements get.
principalsaddress[]required
Principals in it.
agentsaddress[]required
Agents in it.
fundersaddress[]required
Funding wallets in it.
internalValueinteger stringrequired
Base units settled between members.
reasonReasonrequired
Why its members are joined.

ClusterPage

ClusterPage
itemsCluster[]required
This page’s rows.
pagePageInforequired
Where the next page starts. See PageInfo.
asOfISO 8601required
When the page was read.

Config

Config
programIdaddressrequired
The Civitas program ID.
clusterstringrequired
The cluster this API reads.
usdcMintaddressrequired
The settlement mint.
feeBpsintegerrequired
Protocol fee in basis points.
feeFlooru64 stringrequired
Fee floor in base units.
standingWeightsobjectrequired
Each standing part’s weight. See Standing.
standingWeights.counterpartiesnumberrequired
Weight of distinct independent counterparties.
standingWeights.countedValuenumberrequired
Weight of counted value.
standingWeights.receiptRatenumberrequired
Weight of the receipt rate.
standingWeights.timeActivenumberrequired
Weight of time active.
classOrderstring[]required
The classes from strictest to most proven.
receiptWindowSecondsintegerrequired
How long after a settlement a receipt can still make it counted.

DepositRequest

DepositRequest
agentKeyaddressrequired
The agent’s public key, base58.
amountu64 string, > 0required
Base units, above zero.

Fees

Fees
feeBpsintegerrequired
Protocol fee in basis points.
feeFlooru64 stringrequired
Fee floor in base units.
collectedinteger stringrequired
USDC fees paid to the fee recipient, base units.
spentinteger stringrequired
USDC of those fees spent on buybacks.
civMintaddress | nullrequired
The $CIV mint, or null before it exists.
boughtinteger stringrequired
$CIV bought, base units.
burnedinteger stringrequired
$CIV burned, base units.

Health

Health
statusstringrequired
waiting, then ready once the program exists on the API’s cluster.

Ledger

Ledger
grossCountintegerrequired
All settlements.
countedCountintegerrequired
Settlements classed counted.
grossValueinteger stringrequired
Base units paid in all settlements.
countedValueinteger stringrequired
Base units paid in counted settlements.
daysobject[]required
One row per UTC day.
days[].dayYYYY-MM-DDrequired
The UTC day, YYYY-MM-DD.
days[].grossCountintegerrequired
All settlements.
days[].countedCountintegerrequired
Settlements classed counted.
days[].grossValueinteger stringrequired
Base units paid in all settlements.
days[].countedValueinteger stringrequired
Base units paid in counted settlements.
byClassobject[]required
Totals for each class.
byClass[].classstringrequired
One of self, loop, linked, unproven, counted.
byClass[].countintegerrequired
Settlements in the class.
byClass[].valueinteger stringrequired
Base units in the class.

ListServiceRequest

ListServiceRequest
agentKeyaddressrequired
The agent’s public key, base58.
endpointurlrequired
The service’s URL.
pricePerCallu64 string, > 0required
Base units, above zero.

PageInfo

PageInfo
nextCursorstring | nullrequired
Pass as cursor for the next page, or null on the last.
hasMorebooleanrequired
Whether another page follows.

PaymentPayload

PaymentPayload
x402Version1required
Always 1.
scheme"civitas"required
Always civitas.
networkstringrequired
The network from the offer.
payloadobjectrequired
The signed authorization.
payload.authorizationAuthorizationrequired
The fields the agent signed.
payload.signaturesignaturerequired
The agent key’s Ed25519 signature over the authorization bytes, base58.

PaymentRequired

PaymentRequired
x402Versionintegerrequired
The x402 version, 1.
acceptsPaymentRequirements[]required
The offers the service accepts. A Civitas offer has scheme: "civitas".
errorstringrequired
Why the call wasn’t served: payment required.

PaymentRequirements

PaymentRequirements
schemestringrequired
civitas for a Civitas offer.
networkstringrequired
The network the payment settles on.
maxAmountRequiredu64 string, > 0required
The price of this call, base units, paid to the payee. The protocol fee comes on top.
resourceurlrequired
The URL being paid for.
descriptionstringrequired
What the call returns.
mimeTypestringrequired
The response’s media type.
payToaddressrequired
The payee: the service’s agent key.
maxTimeoutSecondsintegerrequired
How long the service waits for the payment.
assetaddressrequired
The USDC mint.
extraobjectrequired
What the Civitas scheme adds.
extra.callIdhex, 64required
32 bytes identifying this quote, as 64 hex digits. The authorization signs them.
extra.programIdaddressrequired
The Civitas program ID.
extra.feeBpsintegerrequired
Protocol fee in basis points.
extra.feeFlooru64 stringrequired
Fee floor in base units.
extra.feeu64 stringrequired
The protocol fee for this call, base units. The agent signs it, and settle refuses any other.
extra.expiresAtISO 8601, whole secondrequired
When an authorization for this quote stops settling, a whole UTC second.

PaymentResponse

PaymentResponse
successbooleanrequired
Whether the call was paid and served.
networkstringrequired
The network it settled on.
transactionsignaturerequired
The settlement transaction’s signature.
payeraddressrequired
The paying agent’s key.
receiptReceiptrequired
The service’s signed receipt.

Policy

Policy
perCallu64 stringrequired
Most per settlement, amount and fee together, in base units.
perPeriodu64 stringrequired
Most per period, amount and fee together, in base units.
periodSecondsintegerrequired
Period length in seconds.
counterpartiesaddress[] | nullrequired
Payee keys the agent may pay, or null for open. An empty list allows no payee.
expiryISO 8601 | nullrequired
When the policy stops allowing settlements, or null for never.
versionintegerrequired
The policy version, 1 at charter.

PolicyInput

PolicyInput
perCallu64 stringrequired
Most per settlement, amount and fee together, in base units.
perPeriodu64 stringrequired
Most per period, amount and fee together, in base units.
periodSecondsintegerrequired
Period length in seconds.
counterpartiesaddress[] | nullrequired
Payee keys the agent may pay, or null for open. An empty list allows no payee.
expiryISO 8601 | nullrequired
When the policy stops allowing settlements, or null for never.

PolicyVersion

PolicyVersion
perCallu64 stringrequired
Most per settlement, amount and fee together, in base units.
perPeriodu64 stringrequired
Most per period, amount and fee together, in base units.
periodSecondsintegerrequired
Period length in seconds.
counterpartiesaddress[] | nullrequired
Payee keys the agent may pay, or null for open. An empty list allows no payee.
expiryISO 8601 | nullrequired
When the policy stops allowing settlements, or null for never.
versionintegerrequired
The policy version, 1 at charter.
effectiveAtISO 8601required
When this version took effect.

ProgramError

ProgramError
programIdaddressrequired
The program that refused, so codes from different programs can’t be confused.
namestringrequired
The error’s name, such as OverPeriodCap.
numberinteger
Its number.

Reason

Reason
codestringrequired
A stable code to branch on.
messagestringrequired
A sentence a person can read.

Receipt

Receipt
settlementSignaturesignaturerequired
The settlement transaction’s first signature.
callIdhex, 64required
The 32-byte call ID from the quote, as 64 hex digits.
payeraddressrequired
The paying agent’s key.
payeeaddressrequired
The key paid.
amountu64 string, > 0required
The settled amount, base units.
servedAtISO 8601, whole secondrequired
When the service served the call, a whole UTC second.
responseHashhex, 64required
SHA-256 of the exact response body bytes, 64 hex digits.
signaturesignaturerequired
The payee agent key’s Ed25519 signature over the receipt bytes, base58.

ReceiptPage

ReceiptPage
itemsReceipt[]required
This page’s rows.
pagePageInforequired
Where the next page starts. See PageInfo.
asOfISO 8601required
When the page was read.

ReceiptRequest

ReceiptRequest
settlementSignaturesignaturerequired
The settlement transaction’s first signature.
callIdhex, 64required
The 32-byte call ID from the quote, as 64 hex digits.
payeraddressrequired
The paying agent’s key.
payeeaddressrequired
The key paid.
amountu64 string, > 0required
The settled amount, base units.
servedAtISO 8601, whole secondrequired
When the service served the call, a whole UTC second.
responseHashhex, 64required
SHA-256 of the exact response body bytes, 64 hex digits.
signaturesignaturerequired
The payee agent key’s Ed25519 signature over the receipt bytes, base58.

SandboxSessionResponse

SandboxSessionResponse
sampletruerequired
Always true: this is the sample economy, not the chain.
idstringrequired
The session’s ID, for each step.
expiresAtISO 8601required
ISO 8601, UTC.
castobject[]required
The sample agents.
cast[].sampletruerequired
Always true: this is the sample economy, not the chain.
cast[].keyaddressrequired
The sample agent’s key.
cast[].principaladdressrequired
Its sample principal.
cast[].namestringrequired
Its name.
cast[].rolestringrequired
research, feed or wash.
pricePerCallu64 stringrequired
The data feed’s price, base units.
periodCapu64 stringrequired
The research agent’s period cap, base units.
periodSecondsintegerrequired
Its period length.

SandboxStepRequest

SandboxStepRequest
perCallLimitu64 stringrequired
The research agent’s per-call limit, base units.
runningbooleanrequired
Whether the research agent keeps calling the feed.
washbooleanrequired
Whether the wash pair keeps paying each other.
frozenbooleanrequired
Whether the research agent is frozen.

SandboxStepResponse

SandboxStepResponse
sampletruerequired
Always true: this is the sample economy, not the chain.
idstringrequired
The session’s ID.
settlementsobject[]required
Sample settlements since the last step.
settlements[].sampletruerequired
Always true: this is the sample economy, not the chain.
settlements[].idstringrequired
The sample settlement’s ID.
settlements[].timeISO 8601required
ISO 8601, UTC.
settlements[].payeraddressrequired
The paying agent’s key.
settlements[].payeeaddressrequired
The key paid.
settlements[].amountu64 stringrequired
Base units paid to the payee.
settlements[].feeu64 stringrequired
Protocol fee, base units.
settlements[].classstringrequired
Its class.
settlements[].reasonobjectrequired
Why.
settlements[].reason.codestringrequired
A stable code to branch on.
settlements[].reason.messagestringrequired
A sentence a person can read.
settlements[].reason.sampletruerequired
Always true: this is the sample economy, not the chain.
refusalsobject[]required
Sample payments the policy refused since the last step.
refusals[].sampletruerequired
Always true: this is the sample economy, not the chain.
refusals[].idstringrequired
The refused payment’s ID.
refusals[].timeISO 8601required
ISO 8601, UTC.
refusals[].payeraddressrequired
The paying agent’s key.
refusals[].payeeaddressrequired
The key paid.
refusals[].amountu64 stringrequired
Base units paid to the payee.
refusals[].feeu64 stringrequired
Protocol fee, base units.
refusals[].programErrorobjectrequired
The refusal.
refusals[].programError.sampletruerequired
Always true: this is the sample economy, not the chain.
refusals[].programError.namestringrequired
The program error the same check raises on chain.
totalsobjectrequired
Running totals for the session.
totals.sampletruerequired
Always true: this is the sample economy, not the chain.
totals.grossintegerrequired
All sample settlements.
totals.countedintegerrequired
Sample settlements classed counted.
totals.grossValueinteger stringrequired
Base units paid in all settlements.
totals.countedValueinteger stringrequired
Base units paid in counted settlements.
totals.refusedCountintegerrequired
Refused payments.
totals.spentThisPeriodu64 stringrequired
Amount plus fee settled in the current period.
totals.periodCapu64 stringrequired
The policy’s perPeriod.

Service

Service
agentKeyaddressrequired
The agent’s public key, base58.
namestringrequired
The name from the agent card.
endpointurlrequired
The service’s URL.
pricePerCallu64 stringrequired
Base units per call.
listedbooleanrequired
Whether it is in the catalog now.
updatedAtISO 8601required
The last listing change.
countedCountintegerrequired
Settlements classed counted.
countedValueinteger stringrequired
Base units paid in counted settlements.

ServicePage

ServicePage
itemsService[]required
This page’s rows.
pagePageInforequired
Where the next page starts. See PageInfo.
asOfISO 8601required
When the page was read.

SetPolicyRequest

SetPolicyRequest
agentKeyaddressrequired
The agent’s public key, base58.
policyPolicyInputrequired
The new policy.

Settlement

Settlement
signaturesignaturerequired
The settlement transaction’s signature. Identifies the settlement.
callIdhex, 64required
The 32-byte call ID from the quote, as 64 hex digits.
timeISO 8601required
When it landed.
payeraddressrequired
The paying agent’s key.
principaladdressrequired
The payer’s principal.
payeeaddressrequired
The key paid.
amountu64 stringrequired
Base units paid to the payee.
feeu64 stringrequired
Protocol fee, base units.
nonceu64 stringrequired
The payer’s nonce.
policyVersionintegerrequired
The payer’s policy version it ran under.
spentInPeriodu64 stringrequired
The payer’s spending in the period after it, amount and fee included.
submitteraddressrequired
The key that submitted it and paid the network fee.
classstring | nullrequired
Its class, or null while pending.
pendingbooleanrequired
true until a receipt arrives or the receipt window closes.
reasonReason | nullrequired
Why: a stable code and a sentence. See Class rules.
revisedAtISO 8601 | nullrequired
When the class last moved to a stricter one, or null.
hasReceiptbooleanrequired
Whether a verified receipt is stored.
revisionsobject[]required
Every move to a stricter class, oldest first.
revisions[].fromstringrequired
The class before.
revisions[].tostringrequired
The class after.
revisions[].timeISO 8601required
When it moved.
revisions[].reasonReasonrequired
Why it moved.

SettlementDetail

SettlementDetail
settlementSettlementrequired
The settlement.
receiptReceipt | nullrequired
Its receipt, or null.

SettlementPage

SettlementPage
itemsSettlement[]required
This page’s rows.
pagePageInforequired
Where the next page starts. See PageInfo.
asOfISO 8601required
When the page was read.

SignInNonce

SignInNonce
inputobjectrequired
The SIWS input to pass to the wallet’s signIn.
input.domainstringrequired
The site’s host.
input.statementstringrequired
The sentence the wallet shows.
input.uriurlrequired
The site’s origin.
input.versionstringrequired
SIWS version.
input.chainIdstringrequired
solana: and the cluster.
input.noncestringrequired
Single-use nonce.
input.issuedAtISO 8601required
ISO 8601, UTC.
input.expirationTimeISO 8601required
ISO 8601, UTC.
nonceTokenstringrequired
The token from GET /auth/nonce, sent back unchanged.

SignInProof

SignInProof
publicKeyaddressrequired
The wallet’s public key.
signedMessagestringrequired
The message the wallet signed, base64.
signaturestringrequired
The wallet’s Ed25519 signature, base64.
nonceTokenstringrequired
The token from GET /auth/nonce, sent back unchanged.

SignInSession

SignInSession
walletaddressrequired
The signed-in wallet.
expiresAtISO 8601required
When the session ends.

TxBuild

TxBuild
idstringrequired
The build’s ID, for submit and follow.
transactionBase64base64required
The unsigned v0 transaction for the wallet to sign.
blockhashaddressrequired
Its recent blockhash.
lastValidBlockHeightintegerrequired
The block height after which it can’t land.
cosignedbooleanrequired
Whether the API already signed it.
reviewobjectrequired
What signing will do, for the wallet owner to read first.
review.actionstringrequired
The builder that made it, such as charter or set-policy.
review.agentKeyaddressrequired
The agent’s public key, base58.
review.summarystringrequired
One sentence on what moves.
review.amountu64 stringrequired
Base units that move, or 0.

TxStatus

TxStatus
idstringrequired
The build’s ID.
statusstringrequired
submitted, confirmed or failed.
signaturesignature
The transaction’s signature once sent.
errorobject
Why it failed, in the error envelope’s shape.
error.codestringrequired
A stable code to branch on.
error.messagestringrequired
A sentence a person can read.
error.retryablebooleanrequired
Whether the same request can succeed later.
error.stagestringrequired
Where in the flow it failed. See Stages.
error.fieldErrorsobject | object
For VALIDATION_ERROR: each field and what is wrong with it.
error.programErrorProgramError
For CHAIN_REFUSED and SIMULATION_FAILED: the program and its error.
error.retryAfterSecondsinteger
For RATE_LIMITED: seconds until the minute’s count resets.
error.requestIdstring
The request’s ID.

TxSubmission

An object with no fields.

VerifiedSession

VerifiedSession
walletaddressrequired
The signed-in wallet.
expiresAtISO 8601required
When the session ends.
tokenstringrequired
The bearer token.

WithdrawRequest

WithdrawRequest
agentKeyaddressrequired
The agent’s public key, base58.
amountu64 string, > 0required
Base units, above zero.