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.

Some Stripe checkouts hide an "I am an AI agent" checkbox. Ticking it shows a link_pay_token field and a data-stripe-merchant-account id. On those pages, an agent with browser automation can skip the card form: request --credential-type link_pay_token --merchant-account-id <acct_id>. Once the founder approves, run cofounder link spend link-pay-token create right before paying, put the token in the link_pay_token field, and submit when the customer's saved Link card replaces the card form. The token is valid for up to 30 minutes. If the page has no such field, use a card request.

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
link_spend_link_pay_token_createcofounder link spend link-pay-token create --spend-request-id <id>POST /cofounder-cli/v1/link/spend-requests/{spend_request_id}/link-pay-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.