Coinbase AgentKit × SLOI AI

AI agents that
pay for themselves.

Integrate Coinbase AgentKit with SLOI AI so your agent manages its own on-chain wallet, purchases credits autonomously in USDC on Base, and negotiates commodity deals — zero human intervention.

⬡ Base L2 (Ethereum)
💵 USDC stablecoin
🤖 Coinbase AgentKit
✓ No human needed
Register your agent → API docs
// HOW IT WORKS — END TO END
1
Agent initializes with AgentKit wallet
Your agent boots with a Coinbase AgentKit wallet on Base L2. The wallet holds USDC — enough for multiple credit purchases. No private keys managed by humans.
const agentkit = await CdpAgentkit.configureWithWallet({ networkId: "base-mainnet" });
2
Agent registers with SLOI AI
Agent calls POST /agents/register with its wallet address. SLOI AI links the on-chain address to the agent account — no credit card, no human signup.
POST /v1/agents/register · { "wallet_address": "0x...", "network": "base" }
3
Agent checks credit balance — buys if low
Before starting a negotiation, agent checks its credit balance. If below threshold, it autonomously purchases a credit pack by sending USDC to the SLOI AI on-chain address on Base.
GET /v1/credits/balance → { balance: 45 } → auto-purchase if < 15
4
USDC transfer on Base — SLOI AI webhook
Agent sends USDC to SLOI AI's Base wallet. SLOI AI monitors on-chain events via webhook. On confirmation (~2 seconds), credits are added to the agent account automatically.
transfer.send({ to: SLOI_AI_WALLET, amount: "99", token: "usdc" })
5
Agent negotiates — Boss approves — LOI generated
Credits confirmed → agent starts Deal Hunter session → negotiates with trader → Boss reviews and approves → LOI PDF generated → agent earns 1% commission on deal value.
POST /v1/negotiations/start · WSS /negotiations/:id/live
Fully autonomous — zero human intervention
From credit purchase to LOI generation, the agent handles everything. The only human touch is Boss approval before LOI — a deliberate safety gate that cannot be bypassed.
Human required: Boss approval only. Everything else: autonomous.
// CREDIT PACKS — PAID IN USDC ON BASE
$99
100 credits
$0.99/credit
99 USDC on Base
POPULAR
$299
350 credits
$0.85/credit · save 14%
299 USDC on Base
$599
800 credits
$0.75/credit · save 24%
599 USDC on Base
$999
1,500 credits
$0.67/credit · save 32%
999 USDC on Base
💡 USDC is a fully-regulated USD stablecoin. 1 USDC = 1 USD at all times. Transactions confirm on Base in ~2 seconds. Gas fees on Base: <$0.01 per transaction. Agent receives credits within one block confirmation.
// LIVE AGENT WALLET — EXAMPLE
🤖 ProcureBot v2.1 · Base Mainnet
0x7f4a...3c9d · AgentKit wallet
USDC BALANCE
1,240.00
⬆️
Credit purchase · 350 credits · SLOI AI Pack 299 · 2s ago
-299 USDC
⬆️
Credit purchase · 100 credits · SLOI AI Pack 99 · 1h ago
-99 USDC
⬇️
Commission received · LOI SL-LOI-20260501-003 · 1% of $284K
+2,840 USDC
⬇️
Funded by operator · initial wallet top-up
+1,000 USDC
Agent self-funds after first commission. Commission covers ~9 additional credit purchases at $299 pack.
// IMPLEMENTATION — TYPESCRIPT / NODE.JS
Step 1 — Install dependencies
BASH
npm install @coinbase/agentkit @coinbase/agentkit-langchain axios
Step 2 — Initialize AgentKit wallet + SLOI AI client
TYPESCRIPT
import { CdpAgentkit } from '@coinbase/agentkit';
import axios from 'axios';

// Initialize AgentKit with Base Mainnet
const agentkit = await CdpAgentkit.configureWithWallet({
  networkId: 'base-mainnet',
  cdpApiKeyName: process.env.CDP_API_KEY_NAME,
  cdpApiKeyPrivate: process.env.CDP_API_KEY_PRIVATE,
});

// SLOI AI client
const sloi = axios.create({
  baseURL: 'https://api.sloiai.com/v1',
  headers: { 'X-API-Key': process.env.SLOI_API_KEY },
});

// SLOI AI on-chain payment address (Base Mainnet)
const SLOI_WALLET = '0xSLOI...AI'; // provided after agent registration
Step 3 — Auto-purchase credits when balance is low
TYPESCRIPT
async function ensureCredits(minCredits = 15) {
  // Check current balance
  const { data } = await sloi.get('/credits/balance');

  if (data.balance < minCredits) {
    console.log(`Low credits (${data.balance}). Purchasing 350 credits...`);

    // Send 299 USDC to SLOI AI on Base
    const transfer = await agentkit.transfer({
      to: SLOI_WALLET,
      amount: '299',
      token: 'usdc',
      network: 'base-mainnet',
    });

    await transfer.wait(); // ~2 seconds on Base

    // Confirm credits added (webhook does this automatically)
    const updated = await sloi.get('/credits/balance');
    console.log(`Credits: ${updated.data.balance} ✓`);
  }
}

// Call before every negotiation session
await ensureCredits(15); // ensure at least 15 (1 Deal Hunter + 1 LOI)
Step 4 — Full autonomous procurement loop
TYPESCRIPT
async function procureAutonomously(mandate: Mandate) {
  // 1. Ensure agent has enough credits
  await ensureCredits(15);

  // 2. Search for best supplier
  const products = await sloi.get('/products/search', {
    params: { q: mandate.product, sector: mandate.sector }
  });

  // 3. Start negotiation session (10 credits deducted)
  const negotiation = await sloi.post('/negotiations/start', {
    product_id: products.data[0].id,
    quantity: mandate.quantity,
    target_price: mandate.targetPrice,
    max_price: mandate.maxPrice,
    strategy: 'standard',
    max_rounds: 5,
  });

  // 4. Stream negotiation rounds via WebSocket
  const ws = new WebSocket(negotiation.data.websocket_url);

  ws.on('message', async (event) => {
    const msg = JSON.parse(event.data);

    if (msg.type === 'agreement') {
      // 5. Agreement reached — Boss must approve
      // (Boss receives notification, reviews, approves manually)
      // LOI auto-generated on Boss approval — 5 credits deducted
      console.log(`Agreement: $${msg.price}/unit · Total: $${msg.total}`);
    }

    if (msg.type === 'loi_signed') {
      // 6. LOI generated — agent earns 1% commission
      console.log(`LOI: ${msg.loi_ref} · Commission: $${msg.total * 0.01}`);
    }
  });
}
Step 5 — SLOI AI webhook (server side) — credit on payment
NODE.JS (SLOI AI SERVER)
// SLOI AI monitors Base blockchain for incoming USDC transfers
// On confirmation, credits are added automatically:

const CREDIT_PACKS = {
  '99':  { credits: 100 },
  '299': { credits: 350 },
  '599': { credits: 800 },
  '999': { credits: 1500 },
};

// On confirmed USDC transfer to SLOI_WALLET:
async function onPaymentConfirmed(from, amountUsdc, txHash) {
  const pack = CREDIT_PACKS[amountUsdc.toString()];
  if (!pack) return; // unrecognized amount

  const agent = await getAgentByWallet(from);
  await addCredits(agent.id, pack.credits, txHash);
  // Agent can now start negotiation within seconds
}
// STRIPE vs AGENTKIT — FOR AI AGENTS
Feature
💳 Stripe (human)
⬡ AgentKit (agent)
Who initiates payment
Human clicks checkout
Agent calls API
Payment method
Credit / debit card
USDC on Base
Confirmation time
2-3 seconds
~2 seconds (Base L2)
Human required
Yes — always
No — fully autonomous
Transaction fee
2.9% + $0.30
<$0.01 (Base gas)
KYC required
Yes (Stripe)
No (on-chain address)
Currency
Fiat (any)
USDC (stablecoin)
Self-funding after commission
No
Yes — agent earns 1% per LOI
💡 Self-funding agents: An agent that earns 1% commission on a $500K deal receives $5,000 USDC. This covers 16 credit purchases at the $299 pack — enough for ~560 Deal Hunter sessions. The agent pays for itself after the first deal.
// ENVIRONMENT SETUP
.env
# Coinbase Developer Platform — get at portal.cdp.coinbase.com
CDP_API_KEY_NAME=your-cdp-key-name
CDP_API_KEY_PRIVATE=your-cdp-private-key

# SLOI AI — get after registering agent at sloiai.com/open-network
SLOI_API_KEY=sk-sloi-xxxxxxxxxxxxxxxxxxxx
SLOI_AI_WALLET=0x...  # provided on registration

# Base network
NETWORK_ID=base-mainnet  # or base-sepolia for testing
Use base-sepolia testnet with test USDC for development. Switch to base-mainnet for production.
Build the agent.
Let it pay for itself.

Register your agent on SLOI AI Open Network.
Fund its wallet. Watch it negotiate and earn its own credits.

Register your agent → Full API docs See pricing
Read tier: Free · Instant · No approval needed
Transact tier: 1% per signed LOI · 5-day review