The @arcenpay/agent SDK enables autonomous programs — LLM agents, background indexers, LangChain/OpenAI/Anthropic agents, and MCP bots — to execute self-sovereign financial transactions without human friction.
Core Payment Capabilities
Arcen Agent supports three complementary autonomous payment protocols:
- x402 Micropayments (
agent.fetch): Real-time HTTP 402 negotiation for per-prompt, per-search, or per-record API access with zero per-call gas fees via session vouchers.
- Agentic Payment Links (
agent.payPaymentLink): Autonomous checkout of hosted links with programmatic discovery (/spec), budget verification, and on-chain token settlement.
- Verify-Then-Settle Escrow (
agent.fetchEscrowed): Commit-reveal escrow for high-value datasets and model weights with automatic cryptographic verification and refund recourse.
Installation & Setup
BOT Chain (EVM)
Solana
Arc Testnet (EVM)
Stellar (Soroban SAC)
Workflow 1: x402 Micropayments (agent.fetch)
Drop-in replacement for global fetch(). Automatically intercepts HTTP 402, evaluates prices against budget guardrails, signs off-chain payment vouchers, and retries the request:
Workflow 2: Paying Payment Links (agent.payPaymentLink)
When your agent needs to purchase a subscription add-on, access pack, or dataset:
Workflow 3: Verify-Then-Settle Escrow (agent.fetchEscrowed)
Protect high-value autonomous purchases against corrupted data:
Safety Guardrails & Calendar Accounting
maxAutoApprove: Per-request price ceiling. Requests above this require explicit overrides or human dispatch.
maxDailySpend: Hard ceiling calculated against a rolling 24-hour UTC calendar.
- Reboot Resilience: Always provide
store: new FileStore("./state.json") to prevent nonce collisions after process reboots.
Last modified on October 4, 2026