Skip to main content
Cookbooks

Cookbooks

Nineteen runnable recipes. Each one is a working agent that solves one real commerce problem end to end, with the refusals you will actually hit.

1 min read
View MarkdownEdit on GitHub
@codespar/sdkv0.16.0

Every cookbook is a single runnable file, not pseudo-code. Copy it, put your csk_test_ key in the environment, and run it: a test key resolves to a sandbox project, so the whole flow completes without provider OAuth and without moving real money.

Each one also documents the order its handlers run in, what already exists when a refusal arrives, and which refusal a retry can fix. That is usually the part you need at 2am.

Start here

Your agent spends

The agent is the buyer. It moves money out of a wallet it governs, inside an allowance someone signed.

Your agent collects

The agent is the merchant. It issues what someone else pays, then invoices and ships against it.

Govern what it may do

The recipes that put a bound on an agent before it spends, and let you prove afterwards what it did.

Run it in production

Patterns for operating agents, whichever side yours is on.

For output that never touches an upstream, declare per-session fixtures with cs.create({ mocks: {...} }). Test Mode has the strict-mode contract and the envelope reference.

Next steps

Cookbooks | CodeSpar