Skip to main content
Product

Between intent and settled money,there is a runtime.

CodeSpar takes an agent's intent and runs everything the money needs: a signed mandate, a policy decision, the right rail, the fiscal document and a sealed receipt. Commerce checkout or payroll run, it is the same four moving parts.

Works with the agent frameworks teams already build on

ClaudeOpenAIVercel AI SDKLangChainCrewAILlamaIndexMastraAutoGenMCP
Live architecturePlatform
agent → ledger · five gates
Agent
Claude · OpenAI · Vercel AI · any MCP client
Intent· natural language
SDK · Session
Commerce meta-tools, framework-agnostic
discover
checkout
pay
invoice
ship
notify
Orchestration
Five gates before any rail is touched
policy
mandate
route
execute
audit
MCP servers
Every commerce API, MIT · on npm
payments
fiscal
logistics
messaging
erp
Rails
Real providers, real money
Pix
Stripe
Circle
WhatsApp
Omie
Ledger
Hash chain · replayable · auditor-ready
sealed receipt

The four moving parts

Mandate. Route. Settle. Audit.

Not four products. One runtime, four guarantees on every transaction it touches.

Mandate engine

Every agent acts under a signed, revocable authorization: this agent, for this principal, up to this budget. Mandates are HMAC-signed, scoped by policy, and die the moment they are revoked.

Policy router

Intent comes in, a rail comes out: Pix, boleto, card or USDC, picked by policy and live conditions in under a second. The agent never learns a provider API and never touches a raw key.

Settlement correlation

The runtime matches every confirmation back to the transaction that caused it. The receipt binds payee, price, the Pix endToEndId and the fiscal document into one verifiable record.

Audit ledger

Hash-chained and append-only, with the NF-e attached. When the CFO asks who authorized a payment and under which budget, the answer is one record, not log-file archaeology.

Watch your agent work

One intent. The right rails. Settled.

Real outcomes, not just chat. Pick a commerce intent and watch the agent run the actual CodeSpar meta-tools — charge, pay, invoice, ship, KYC — across the LATAM provider catalog.

Claudevia CodeSpar

Cobra R$240 da Maria pelo pedido #1042, manda o Pix no WhatsApp dela e emite a nota.

Found order #1042 — 2× Tênis SKU-ABX, R$240. I'll charge via Pix, drop the QR in Maria's WhatsApp, then issue the NF-e.

codespar_chargeAsaas
codespar_notifyZ-API
codespar_invoiceNFe.io

Charged R$240 via Pix, dropped the QR into Maria's WhatsApp, and issued NF-e #4471 — in one turn.

Reply…governed · idempotent · audited
CodeSpar SDK

Give your AI agents
commerce superpowers

One SDK. Payments, invoices, shipping, notifications, ERP. Across Latin America. Five lines to run the Complete Loop.

agent-checkout/session.ts
session.ts×
mandate.ts
policy.ts
1import { codespar } from "@codespar/sdk";
2 
3// One session. Every commerce primitive.
4const session = await codespar.create({
5 preset: "brazilian",
6});
7 
8await session.send(
9 "Charge R$ 150 via Pix and issue the NF-e"
10);
11 
12// ✓ 58s · sealed · receipt rcp_8f2a91
TerminalRunning
$ npm run dev
session created · user_123 · brazilian preset
policy OK · mandate signed · route Pix
R$ 150,00 charged · NF-e 00421 issued
audit sealed · rcp_8f2a91 · 58s total
01

Session-first DX

One line to create a session. One line to send a message. Your agent gets payments, invoicing, shipping, messaging, ERP, and banking in a single call.

01
const session = await codespar.create(
  "user_123",
  { preset: "brazilian" }
);

const result = await session.send(
  "Charge R$150 via Pix and issue the NF-e"
);
02

Commerce Meta-Tools, Not the Raw Catalog

A full LATAM commerce catalog spans more than a hundred MCP servers and well over a thousand raw tools. CodeSpar collapses them into a small set of commerce meta-tools that pick the best provider per call. Your agent sees clear categories, not noise.

02
codespar_discover            // tool search across catalog
codespar_charge              // inbound charges (Pix, card)
codespar_pay                 // outbound transfers + policy
codespar_invoice             // NF-e, NFS-e, CFDI, Factura
codespar_ship                // labels, quotes, tracking
codespar_notify              // WhatsApp, SMS, email
codespar_crypto_pay          // crypto payments
codespar_kyc                 // identity verification
codespar_manage_connections  // wizard for new providers
03

Managed Auth

OAuth, API keys, token refresh, lifecycle management. Connect once per provider. The SDK handles credentials, refresh, and storage.

03
// API key auth
await session.authorize("asaas", {
  token: "..."
});

// OAuth2 flow
const url = codespar.authManager
  .getConnectUrl("stripe");
04

Framework Agnostic

Works with Claude, OpenAI, Vercel AI SDK, or any MCP client. Swap models based on cost or capability. Your tools and auth carry over.

04
// Claude Agent SDK
import { getTools } from "@codespar/claude-agent-sdk";

// OpenAI
import { getTools } from "@codespar/openai";

// Vercel AI SDK
import { getTools } from "@codespar/vercel-ai";

// Or use MCP directly
const { url, headers } = session.mcp;
The Complete Loop

From intent to ledger.One function call.

Your agent says it once. CodeSpar orchestrates all six providers, confirms every result, and seals the transaction in an immutable ledger. No callbacks, no cron jobs, no reconciliation spreadsheet.

01
Charge
R$ 150 · Pix
02
Invoice
NF-e 00421
03
Ship
Melhor Envio
04
Notify
WhatsApp delivered
05
Sync ERP
Omie synced
06
Reconcile
Ledger sealed
agent-checkout.ts
const result = await session.send(
  "Charge R$ 150 via Pix, issue the NF-e, dispatch with Melhor Envio,
   notify on WhatsApp, and post it all to Omie."
);
Running…receipt: rcp_8f2a91
The stack

What sits underneath.Rails, primitives, protocols.

Three groups. Every integration is opt-in and swappable — same meta-tool, different provider underneath.

Rails
Money movement primitives
  • Instant payments
    Pix BCB · SPEI · Transferencias 3.0
  • Cards
    Stripe · Zoop · PagSeguro · Cielo · Asaas
  • Stablecoins
    Circle USDC · Mercado Bitcoin · Bitso
  • Bank transfers
    Stark Bank · Open Finance · BCB
Commerce primitives
Invoice, ship, notify, sync
  • Fiscal docs
    NFe.io · Focus NFe · Conta Azul
  • Logistics
    Melhor Envio · Correios · VTEX
  • Messaging
    Evolution · Z-API · Twilio · Zenvia
  • ERP
    Omie · Bling · Tiny
Agent protocols
Agent-native payment standards
  • Stripe ACP
    Agent checkout inline in chat
  • Google UCP
    Unified commerce protocol
  • x402
    HTTP 402 · machine-to-machine
  • AP2
    Agent-to-agent scoped spend
How you pay

Open source is free.You pay when transactions settle.

MCP servers and the SDK are MIT-licensed and published on npm. Orchestration is usage-based — $0.10 per settled transaction, plus 0.5% on cross-border FX. No minimums. No setup fee.

See the whole thing running.

Open the Sandbox and run a real transaction in under a minute. Or book a demo and we walk you through it end-to-end.

Product · The runtime for agent money movement | CodeSpar