Cofounder CLI

Agent Spend

Let agents make founder-approved purchases through Link spend requests.

Company billing pays for Cofounder itself. When an agent needs to pay someone else — a service, a merchant, an API — it asks the founder to approve that one purchase in Link.

A spend request asks the founder to approve one purchase in Link. Once approved, the agent gets a one-time virtual card or a shared payment token for exactly that purchase:

cofounder link spend-request create --amount 2500 --currency usd \
  --merchant-name "Acme Fonts" --merchant-url https://acmefonts.example \
  --context "Annual webfont license for the marketing site: one family, two weights, self-hosted."
cofounder link spend-request retrieve <spend-request-id> --wait

--amount is in minor units (cents), and --context explains what's being bought and why (at least 100 characters). The first request connects the founder's Link account; create waits for that unless you pass --no-wait. retrieve --wait returns the card once the founder approves.

For merchants that charge over HTTP 402, cofounder link mpp decode --challenge <header> reads the network id and amount from the merchant's WWW-Authenticate header. Request --credential-type shared_payment_token with that --network-id, then pay with cofounder link mpp pay.

One step at a time

The link spend commands make each step a separate call, the same as MCP:

MCPCLIAPI
link_spend_createcofounder link spend create --request-id <uuid> --amount 2500 --currency usd --context <text>POST /cofounder-cli/v1/link/spend-requests
link_connections_getcofounder link connections get --connection-id <id>POST /cofounder-cli/v1/link/connections/{connection_id}/poll
link_spend_getcofounder link spend get --spend-request-id <id>GET /cofounder-cli/v1/link/spend-requests/{spend_request_id}
link_spend_card_createcofounder link spend card create --spend-request-id <id>POST /cofounder-cli/v1/link/spend-requests/{spend_request_id}/card
—cofounder link spend shared-payment-token create --spend-request-id <id>POST /cofounder-cli/v1/link/spend-requests/{spend_request_id}/shared-payment-token

If create says authorization is needed, give the founder the link it returns and run connections get at the interval it suggests until Link is connected. Then run create again with the same --request-id and details — never retry an unclear result with a new request id. spend get shows where approval stands but never includes the card; once approved, card create returns the one-time card. A shared payment token is a secret: don't print or save it.