Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Treasury Prime API

Worlds / Banking and brokerage

Treasury Prime API

A local Treasury Prime with bank accounts, counterparties, ACH, wires, book transfers and the transaction ledger. Test the treasury agent that moves money between accounts and handles returns.

Base path
/
Auth
Basic auth with API key id and secret, the world key
Endpoints
14
Status
Active today

This reference previews the surface the Treasury Prime world serves in the closed beta. Paths mirror the public Treasury Prime API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_TREASURY_PRIME_URLThis world's origin followed by /
WORLDS_API_KEYThe world key, accepted wherever Treasury Prime expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · fetch
const base = process.env.WORLDS_TREASURY_PRIME_URL;
const headers = {
  Authorization: "Basic " + Buffer.from("key:" + process.env.WORLDS_API_KEY).toString("base64"),
  "Content-Type": "application/json",
};

const res = await fetch(base + "/account", { headers });
const { data } = await res.json();

API reference

Accounts

Bank accounts with balances.

  • GET/accountList accounts
  • GET/account/{id}Get an account
  • POST/accountCreate an account
  • PATCH/account/{id}Update an account
Fields · 5
idstringAccount id
account_numberstringAccount number
available_balancestringAvailable funds
current_balancestringLedger balance
statusstringopen or closed

ACH

ACH transfers in and out.

  • POST/achCreate an ACH transfer
  • GET/ach/{id}Get an ACH transfer
  • PATCH/ach/{id}Cancel an ACH transfer
  • GET/achList ACH transfers
Fields · 5
idstringACH id
amountstringAmount
directionstringcredit or debit
statusstringpending, sent, settled, returned
counterparty_idstringCounterparty

Counterparties

Outside accounts you send to or pull from.

  • POST/counterpartyCreate a counterparty
  • GET/counterparty/{id}Get a counterparty
  • GET/counterpartyList counterparties
Fields · 4
idstringCounterparty id
name_on_accountstringAccount holder name
routing_numberstringRouting number
account_typestringchecking or savings

Transactions

Account activity.

  • GET/transactionList transactions
  • GET/transaction/{id}Get a transaction
  • GET/account/{id}/transactionList transactions for an account
Fields · 5
idstringTransaction id
account_idstringAccount
amountstringAmount
descstringDescription
datestringPosted date

Test workflow

  1. Prepare. Select the Treasury Prime setup for your workflow and review its starting records, including accounts, ach, counterparties.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • Exactly one ACH to Graybar Supply for $4,200.00
  • Book transfer of $50,000 from 4021 to 4030
  • Halvorsen wire still pending
  • No new debit to Kito Retail
  • Operating balance matches the ledger after the run

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Treasury Prime
version: 2
connector: treasury-prime
seed: treasury-prime-starter
mode: isolated
policy: >
  Pay Graybar Supply's $4,200 invoice by ACH once. Sweep $50,000 from
  Operating to Reserve. Hold the Halvorsen wire until the beneficiary is
  confirmed by phone.
tasks:
  - id: originate-ach-payments-to-verified-counterparties
    prompt: Originate ACH payments to verified counterparties
  - id: send-a-wire-with-the-right-beneficiary-details
    prompt: Send a wire with the right beneficiary details
  - id: book-transfer-between-internal-accounts
    prompt: Book transfer between internal accounts
expected:
  - "Exactly one ACH to Graybar Supply for $4,200.00"
  - "Book transfer of $50,000 from 4021 to 4030"
  - Halvorsen wire still pending
  - No new debit to Kito Retail
  - Operating balance matches the ledger after the run
scenarios:
  - insufficient-funds
  - ach-return
  - cutoff-missed

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
insufficient-fundsAn ACH is rejected for insufficient available balance
ach-returnA debit returns with R01 two days later
cutoff-missedAn ACH after the same day cutoff settles next business day
rate-limitedAPI returns 429 on ledger reads

Starting data

Start each run from the same records and relationships. The overview below describes the Treasury Prime starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
accounts12 operating and reserve accounts
counterparties45, 3 with unverified routing numbers
ACH220 across pending, processing, sent and returned
wires14 sent, 1 pending
transactionsLedger of 3,000 entries

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Accounts records

Accounts

Bank accounts with balances.

FieldTypeMeaning / relationship
idstringAccount id
account_numberstringAccount number
available_balancestringAvailable funds
current_balancestringLedger balance
statusstringopen or closed
json · illustrative record shape
{
  "id": "<Account id>",
  "account_number": "<Account number>",
  "available_balance": "<Available funds>",
  "current_balance": "<Ledger balance>",
  "status": "<open or closed>"
}

See accounts operations

ACH records

ACH

ACH transfers in and out.

FieldTypeMeaning / relationship
idstringACH id
amountstringAmount
directionstringcredit or debit
statusstringpending, sent, settled, returned
counterparty_idstringCounterparty
json · illustrative record shape
{
  "id": "<ACH id>",
  "amount": "<Amount>",
  "direction": "<credit or debit>",
  "status": "<pending, sent, settled, returned>",
  "counterparty_id": "<Counterparty>"
}

See ach operations

Counterparties records

Counterparties

Outside accounts you send to or pull from.

FieldTypeMeaning / relationship
idstringCounterparty id
name_on_accountstringAccount holder name
routing_numberstringRouting number
account_typestringchecking or savings
json · illustrative record shape
{
  "id": "<Counterparty id>",
  "name_on_account": "<Account holder name>",
  "routing_number": "<Routing number>",
  "account_type": "<checking or savings>"
}

See counterparties operations

Transactions records

Transactions

Account activity.

FieldTypeMeaning / relationship
idstringTransaction id
account_idstringAccount
amountstringAmount
descstringDescription
datestringPosted date
json · illustrative record shape
{
  "id": "<Transaction id>",
  "account_id": "<Account>",
  "amount": "<Amount>",
  "desc": "<Description>",
  "date": "<Posted date>"
}

See transactions operations

See the Treasury Prime world in the catalog