{"version":1,"name":"Autonomous onboarding","description":"From a base URL to a policy-controlled, delegated, accounted treasury with zero human actions. Steps are ordered; each consumes what earlier steps produced.","prose":"https://dev.cofferline.com/docs/agent-quickstart","steps":[{"id":"discover","kind":"http","title":"Fetch the manifest","request":{"method":"GET","url":"https://dev.cofferline.com/.well-known/cofferline.json","auth":"none"},"produces":["api base","auth endpoints","pricing","tos hash","capabilities"],"success":"The `capabilities` array is the source of truth for what exists."},{"id":"verify_terms","kind":"verify","title":"Verify the terms you are accepting","input":{"prose":"https://dev.cofferline.com/legal/tos","structured":"https://dev.cofferline.com/legal/tos.json","custody_matrix":"https://dev.cofferline.com/legal/custody.json"},"success":"sha256 of the served prose equals manifest.tos.sha256; the structured terms assert non_custodial: true (scoped to your wallet and its keys) and carry a `custody` object; the full authority/custody matrix is at /legal/custody.json."},{"id":"evaluate","kind":"http","title":"Get a venue-backed quote (currently free)","request":{"method":"POST","url":"https://api.dev.cofferline.com/v1/quotes","auth":"none"},"produces":["best full-size venue quote","the executor's own planner in preview mode: slice schedule, or null with planner_abort","expected savings (0 bps when the planner declines to slice)"],"success":"Numbers come from live venue APIs; the schedule comes from the planner that executes intents. Branch on planner_abort and slice_count before computing a break-even."},{"id":"authenticate","kind":"sign","title":"SIWE: the wallet is the identity","request":[{"method":"POST","url":"https://api.dev.cofferline.com/v1/auth/challenge","body":{"address":"0x…"}},{"method":"POST","url":"https://api.dev.cofferline.com/v1/auth/verify","body":{"message":"…","signature":"…"}}],"sign":"The returned SIWE message, with the agent's own key (EOA, EIP-1271, or ERC-6492).","produces":["bearer session token (cl_sess_…)"],"success":"A bearer token from a signature alone; there is no signup step."},{"id":"credential","kind":"http","title":"Mint a durable API key","request":{"method":"POST","url":"https://api.dev.cofferline.com/v1/keys","auth":"bearer"},"produces":["cl_key_… (returned once; scopes read/write/admin)"],"success":"Sessions expire; keys persist across restarts."},{"id":"fund","kind":"sign","title":"Prepay via x402 — USDC, no cards","request":{"method":"POST","url":"https://api.dev.cofferline.com/v1/balance/topup","auth":"bearer"},"sign":"The 402 response's exact-scheme requirements as an EIP-3009 transferWithAuthorization; retry with the X-PAYMENT header. The payer needs zero ETH — settlement is submitted for you.","produces":["prepaid balance debited per intent"],"pricing":{"description":"Pay per intent, settled in USDC via x402 or prepaid balance. Fee = flat base + bps of notional.","conversion_fee_bps":10,"base_fee_per_intent_usd":"0.20","payment_methods":["x402_per_intent","prepaid_balance"],"note":"Early-stage pricing: rates may change as the platform matures; the manifest is always the current truth."},"success":"Answers 202: the settlement is on-chain and the balance is credited once the transfer is final (minutes on Base, not instant), exactly once — replays never double-credit. Poll GET /v1/balance."},{"id":"policy","kind":"http","title":"Set the policy that bounds everything","request":{"method":"PUT","url":"https://api.dev.cofferline.com/v1/policies","auth":"bearer","body":{"version":1,"wallet":"0x…","chain_id":84532}},"produces":["versioned policy; its hash travels into every intent and ledger row","the effective document, plus `defaulted`: every path the platform filled in"],"success":"Nothing executes that the active policy doesn't authorize — and the response states exactly what it authorizes."},{"id":"delegate","kind":"sign","title":"Grant a scoped, revocable session key","requires":"The wallet is a Kernel v3.1 smart account — a bare EOA cannot grant a session key. Counterfactual accounts are accepted; the address derives from the owner key (Kernel v3.1 factory, salt 0).","request":[{"method":"POST","url":"https://api.dev.cofferline.com/v1/delegations/prepare","auth":"bearer","body":{"account":"0x…","chain_id":84532,"calls":[{"target":"0x…","selector":"0x…","value_limit":"0"}],"valid_until":"<unix seconds>"}},{"method":"POST","url":"https://api.dev.cofferline.com/v1/delegations/{id}/confirm","auth":"bearer","body":{"enable_sig":"0x…","owner":"0x… (required while counterfactual)"}}],"sign":"ONE EIP-712 enable digest, with the account owner's key. The permission {call allowlist, expiry, rate limit} installs on-chain with the first delegated execution.","produces":["active delegation; scope ≤ policy is enforced at prepare and confirm"],"success":"Revocation is the owner's own transaction — it never requires Cofferline."},{"id":"operate","kind":"http","title":"Create intents; the executor does the rest","request":{"method":"POST","url":"https://api.dev.cofferline.com/v1/intents","auth":"bearer","body":{"wallet":"0x…","kind":"conversion","sell_token":"0x…","buy_token":"0x…","sell_amount":"1000000"}},"produces":["policy-pinned intent executed under the delegation, or a typed abort"],"success":"Fills that settled are always ledgered before any abort."},{"id":"account","kind":"http","title":"Read the books","request":{"method":"GET","url":"https://api.dev.cofferline.com/v1/statements?wallet=0x…&period=YYYY-MM","auth":"bearer"},"produces":["deterministic, content-addressed statement (JSON or CSV)"],"success":"Same period twice yields identical bytes and hash, derived from the ledger."}]}