Developer Docs
Gateway Live 83 Primitives ← Back to App GitHub Smithery Try Gateway →

x402 Primitives Catalog

The full-stack pay-per-call API for crypto infrastructure. Every endpoint is x402-native — agents and developers pay USDC per request on Base. No API keys, no accounts, no subscriptions.

83 Primitives
14 Categories
USDC on Base
gateway.spraay.app
Quick Start — Make your first x402 call
// Install the x402 client
npm install x402-client

// Make a paid API call — payment is automatic
import { createClient } from "x402-client";

const client = createClient({
  baseUrl: "https://gateway.spraay.app",
  privateKey: process.env.EVM_PRIVATE_KEY,  // Wallet with USDC on Base
});

// Fetch live ETH price — pays $0.005 USDC automatically
const prices = await client.get("/api/v1/prices");
console.log(prices);  // { ETH: 2847.50, ... }

// Batch send USDC to 50 wallets — pays $0.02 USDC
const tx = await client.post("/api/v1/batch", {
  token: "USDC",
  recipients: [{ address: "0x...", amount: "10.00" }, /* ... */]
});
🪪

Identity & Access

2 endpoints
POST x402 KYC/KYB
On-demand identity verification — compliance-gated batch payments
/api/v1/kyc/verify
$0.08 USDC

Parameters

  • wallet_address string — Address to verify
  • level string — "basic" | "enhanced" | "kyb"
  • chain string — Target chain (default: "base")
Status: Coming SoonLatency: ~2s

Example

const result = await client.post(
  "/api/v1/kyc/verify", {
    wallet_address: "0xAb5...",
    level: "basic"
  }
);
// { verified: true, score: 92,
//   flags: [], expires: "2025-..." }
POST x402 Auth/SSO
Pay-per-session authentication proxy for third-party services
/api/v1/auth/session
$0.01 USDC

Parameters

  • provider string — Service to authenticate with
  • wallet_address string — Wallet for session binding
  • ttl number — Session duration in seconds
Status: Coming SoonLatency: ~500ms

Example

const session = await client.post(
  "/api/v1/auth/session", {
    provider: "github",
    wallet_address: "0xAb5...",
    ttl: 3600
  }
);
// { token: "ey...", expires_at: "..." }
📡

Data & Intelligence

4 endpoints
GET x402 Oracle
Real-time price feeds, gas estimates, FX rates — live off-chain data
/api/v1/prices
$0.008 USDC

Parameters

  • tokens string[] — Token symbols (e.g. ["ETH","USDC"])
  • vs_currency string — Quote currency (default: "usd")
  • include_gas boolean — Include gas price estimates
Status: LiveLatency: ~120msCache: 10s

Example

const data = await client.get(
  "/api/v1/prices?tokens=ETH,USDC"
);
// { ETH: { usd: 2847.50, change_24h: 1.2 },
//   USDC: { usd: 1.00 },
//   gas: { base: "0.004 gwei" } }
▶ Try it live
GET x402 Analytics
Wallet analytics, portfolio scoring, transaction risk profiling
/api/v1/analytics
$0.01 USDC

Parameters

  • address string — Wallet or ENS to analyze
  • chain string — Chain to query (default: "base")
  • depth string — "summary" | "full"
Status: LiveLatency: ~800ms

Example

const report = await client.get(
  "/api/v1/analytics?address=vitalik.eth"
);
// { portfolio_value: "$1.2M",
//   risk_score: 12, tx_count: 4821 }
GET x402 Indexer
Pay-per-query blockchain indexing — tx history, balances across chains
/api/v1/index/query
$0.008 USDC

Parameters

  • address string — Wallet address to index
  • chains string[] — Chains to query
  • type string — "balances" | "history" | "nfts"
Status: Coming SoonLatency: ~1.5s

Example

const history = await client.get(
  "/api/v1/index/query", {
    address: "0xAb5...",
    chains: ["base", "ethereum"],
    type: "history"
  }
);
// { transactions: [...], total: 142 }
POST x402 AI Inference
Pay-per-call ML models — fraud detection, tx classification, clustering
/api/v1/ai/chat
$0.04 USDC

Parameters

  • model string — Model ID (OpenAI-compatible)
  • messages array — Chat messages array
  • max_tokens number — Max response tokens
Status: Live93 models (43 BlockRun + 50 OpenRouter)

Example

const resp = await client.post(
  "/api/v1/ai/chat", {
    model: "anthropic/claude-sonnet",
    messages: [{
      role: "user",
      content: "Classify this tx..."
    }]
  }
);
// { response: "This appears to be..." }
▶ Try it live
📧

Communication & Notification

3 endpoints
POST x402 Email/SMS
Payment confirmations, alerts, receipts via AgentMail & Twilio
/api/v1/notify/send
$0.01 USDC

Parameters

  • channel string — "email" | "sms"
  • to string — Recipient address or phone
  • subject string — Email subject line
  • body string — Message body (text or HTML)
Email: Live (AgentMail)SMS: Pending (Twilio)

Example

await client.post("/api/v1/notify/send", {
  channel: "email",
  to: "[email protected]",
  subject: "Payroll Complete",
  body: "50 recipients paid via Spraay"
});
// { sent: true, id: "msg_a1b2c3" }
POST x402 Webhook
Pay-per-delivery event forwarding — tx confirmations, status callbacks
/api/v1/webhook/register
$0.01 USDC

Parameters

  • url string — Your webhook endpoint URL
  • events string[] — Events to subscribe to
  • secret string — Signing secret for verification
Status: Coming SoonEvents: tx.confirmed, batch.complete, payment.received

Example

await client.post("/api/v1/webhook/register", {
  url: "https://myapp.com/hooks",
  events: ["batch.complete"],
  secret: "whsec_..."
});
// { id: "wh_x9y8", active: true }
POST x402 XMTP Relay
Agent-to-agent & agent-to-user encrypted messaging via XMTP
/api/v1/xmtp/send
$0.01 USDC

Parameters

  • to string — Recipient wallet or ENS
  • message string — Message content
  • content_type string — "text" | "attachment"
Provider: XMTP (Fly.io)Status: Coming Soon

Example

await client.post("/api/v1/xmtp/send", {
  to: "0xRecipient...",
  message: "Payment of 50 USDC sent",
  content_type: "text"
});
// { sent: true, conversation_id: "..." }
💰

Financial Primitives

5 endpoints
POST x402 Escrow
Conditional batch payments — milestone-based, time-locked escrow contracts
/api/v1/escrow/create
$0.10 USDC

Parameters

  • token string — Token symbol or address
  • amount string — Amount to escrow
  • recipient string — Recipient address
  • conditions object — Release conditions (milestone, time-lock)
Status: Live

Example

const escrow = await client.post(
  "/api/v1/escrow/create", {
    token: "USDC",
    amount: "5000",
    recipient: "0xFreelancer...",
    conditions: {
      type: "milestone",
      deadline: "2025-04-01"
    }
  }
);
// { escrow_id: "esc_...", tx: "0x..." }
GET x402 Swap
Atomic swap quotes & execution via Uniswap V3 / Aerodrome
/api/v1/swap/quote
$0.008 USDC

Parameters

  • from string — Input token symbol
  • to string — Output token
  • amount string — Input amount
  • slippage number — Max slippage % (default: 0.5)
Status: LiveDEXs: Uniswap V3, Aerodrome

Example

const quote = await client.get(
  "/api/v1/swap/quote?from=USDC&to=WETH&amount=100"
);
// { amountOut: "0.0351",
//   route: "USDC→WETH",
//   priceImpact: "0.02%" }
▶ Try it live
POST x402 Bridge
Cross-chain token transfers across Spraay's 11-chain footprint
/api/v1/bridge/transfer
$0.05 USDC

Parameters

  • from_chain string — Source chain
  • to_chain string — Destination chain
  • token string — Token to bridge
  • amount string — Amount
Status: LiveChains: 11 supported

Example

const bridge = await client.post(
  "/api/v1/bridge/transfer", {
    from_chain: "base",
    to_chain: "arbitrum",
    token: "USDC",
    amount: "1000"
  }
);
// { bridge_id: "br_...", eta: "~2 min" }
POST x402 Payroll
Agent-driven payroll via StablePay — recurring batch payments
/api/v1/payroll/run
$0.10 USDC

Parameters

  • name string — Payroll run name
  • token string — Payment token
  • employees array — [{address, amount, memo}]
  • schedule string — "once" | "weekly" | "monthly"
Status: LivePowered by: StablePay

Example

const run = await client.post(
  "/api/v1/payroll/run", {
    name: "March 2025",
    token: "USDC",
    employees: [
      { address: "0x...", amount: "3500" },
      { address: "0x...", amount: "4200" }
    ]
  }
);
// { payroll_id: "pr_...", tx: "0x..." }
POST x402 Invoice
On-demand invoice generation with payment tracking & receipts
/api/v1/invoice/create
$0.05 USDC

Parameters

  • to string — Client wallet or email
  • items array — Line items [{desc, amount}]
  • token string — Accepted payment token
  • due_date string — Payment deadline
Status: Live

Example

const inv = await client.post(
  "/api/v1/invoice/create", {
    to: "[email protected]",
    items: [{ desc: "Dev work",
              amount: "2500" }],
    token: "USDC",
    due_date: "2025-04-15"
  }
);
// { invoice_id: "inv_...",
//   pay_link: "https://..." }
🖧

Infrastructure & DevOps

4 endpoints
POST x402 RPC
Premium multi-chain RPC via Alchemy — 7 chains behind one paywall
/api/v1/rpc
$0.001 USDC

Parameters

  • chain string — Target chain
  • method string — JSON-RPC method
  • params array — Method parameters
Provider: AlchemyChains: 7

Example

const block = await client.post(
  "/api/v1/rpc", {
    chain: "base",
    method: "eth_blockNumber",
    params: []
  }
);
// { result: "0x1a2b3c" }
POST x402 IPFS/Arweave
Permanent storage pinning for receipts, proofs, metadata via Pinata
/api/v1/storage/pin
$0.01 USDC

Parameters

  • content string|object — Content to pin
  • name string — Pin name/label
  • backend string — "ipfs" | "arweave"
Provider: PinataStatus: Coming Soon

Example

const pin = await client.post(
  "/api/v1/storage/pin", {
    content: { receipt: "...", tx: "0x..." },
    name: "payroll-receipt-march",
    backend: "ipfs"
  }
);
// { cid: "Qm...", url: "https://..." }
POST x402 Cron/Scheduler
Scheduled tasks — recurring payments, DCA triggers, automated sprays
/api/v1/cron/schedule
$0.01 USDC

Parameters

  • cron string — Cron expression
  • action object — API call to execute
  • max_runs number — Max executions (0 = unlimited)
Status: Coming Soon

Example

await client.post("/api/v1/cron/schedule", {
  cron: "0 9 1 * *",  // 1st of month
  action: {
    endpoint: "/api/v1/payroll/run",
    body: { name: "Monthly" }
  },
  max_runs: 12
});
// { job_id: "cron_...", next: "..." }
POST x402 Logging
Structured log ingestion & querying for debugging agent workflows
/api/v1/logs
$0.002 USDC

Parameters

  • action string — "ingest" | "query"
  • entries array — Log entries to store
  • filter object — Query filters
Status: Coming Soon

Example

await client.post("/api/v1/logs", {
  action: "ingest",
  entries: [{
    level: "info",
    msg: "Batch sent to 50 recipients",
    tx: "0x..."
  }]
});
// { stored: 1, id: "log_..." }
🖥️

GPU / Compute

3 endpoints
POST x402 GPU Run
Run AI model inference via Replicate — image, video, LLM, audio, utility
/api/v1/gpu/run
$0.06 USDC

Parameters

  • model string — Shortcut (flux-pro, llama-70b, whisper) or full ID
  • input object — Model-specific inputs
  • version string? — Specific model version (optional)
  • webhook string? — Async result delivery URL
Status: LiveProvider: Replicate13 model shortcuts

Example

const img = await client.post(
  "/api/v1/gpu/run", {
    model: "flux-pro",
    input: {
      prompt: "a serene mountain lake"
    }
  }
);
// { id: "abc123", status: "succeeded",
//   output: ["https://replicate.delivery/..."] }
▶ Browse models (free)
GET x402 GPU Status
Poll prediction status for async GPU jobs (video gen, large models)
/api/v1/gpu/status/:id
$0.005 USDC

Parameters

  • id string — Prediction ID from /gpu/run
Status: Live

Example

const status = await client.get(
  "/api/v1/gpu/status/abc123xyz"
);
// { id: "abc123xyz", status: "succeeded",
//   output: [...], metrics: { predict_time: 4.2 } }
GET x402 GPU Models
List available model shortcuts — image, video, LLM, audio, utility
/api/v1/gpu/models
FREE

No parameters required

Status: LiveCost: Free

Example

const models = await client.get(
  "/api/v1/gpu/models"
);
// { total: 13, categories: {
//   image: [{ shortcut: "flux-pro", ... }],
//   video: [...], llm: [...], ... } }
▶ Try it live
🤖

Robotics / RTP

8 endpoints

Robot Task Protocol (RTP) — the open standard for AI agents to discover, commission, and pay for physical robot tasks via x402. Proposed as an x402 extension in #1569.

POST RTP Register Robot
Register a robot with capabilities, pricing, and connection config
/api/v1/robots/register
FREE

Parameters

  • name string — Human-readable device name
  • capabilities string[] — e.g. ["pick", "place", "scan"]
  • price_per_task string — USDC per task (e.g. "0.05")
  • payment_address string — Operator wallet for payments
  • connection object — {type: "webhook"|"xmtp"|"wifi"|"websocket", webhookUrl: "..."}
Status: LiveReturns: robot_id, rtp_uri, x402_endpoint

Example

const robot = await client.post(
  "/api/v1/robots/register", {
    name: "WarehouseBot-01",
    capabilities: ["pick", "place", "scan"],
    price_per_task: "0.05",
    payment_address: "0xYourWallet",
    connection: {
      type: "webhook",
      webhookUrl: "https://yourserver.com/rtp/task"
    }
  }
);
// { status: "registered",
//   robot_id: "robo_138fd1f8e0ee51a",
//   rtp_uri: "rtp://gateway.spraay.app/robo_..." }
POST RTP Dispatch Task
Pay x402 to dispatch a task to a robot — escrow holds payment until completion
/api/v1/robots/task
$0.05 USDC

Parameters

  • robot_id string — Target robot identifier
  • task string — Capability verb: pick, place, scan, deliver, etc.
  • parameters object — Task-specific params (e.g. {item, from_location})
  • callback_url string? — URL to receive result on completion
  • timeout_seconds number? — Max execution time (default: 60)
Status: LivePayment: x402 + escrow

Example

const result = await client.post(
  "/api/v1/robots/task", {
    robot_id: "robo_138fd1f8e0ee51a",
    task: "pick",
    parameters: {
      item: "SKU-00421",
      from_location: "bin_A3"
    },
    timeout_seconds: 60
  }
);
// { status: "DISPATCHED",
//   task_id: "task_xyz789",
//   escrow_id: "escrow_001" }
POST RTP Complete Task
Robot reports task result — triggers escrow release or refund
/api/v1/robots/complete
FREE

Parameters

  • task_id string — Task identifier from dispatch
  • status string — "COMPLETED" | "FAILED"
  • result object — {success, output, data, error}
Status: LiveEscrow: COMPLETED = released, FAILED = refunded

Example

await client.post(
  "/api/v1/robots/complete", {
    task_id: "task_xyz789",
    status: "COMPLETED",
    result: {
      success: true,
      output: "Picked SKU-00421 from bin_A3"
    }
  }
);
// { task_id: "task_xyz789",
//   status: "COMPLETED", escrow: "released" }
GET RTP Discover Robots
Find registered robots — filter by capability, chain, max price, status
/api/v1/robots/list
$0.005 USDC

Parameters

  • capability string? — Filter by verb: pick, scan, deliver, etc.
  • chain string? — Payment chain (default: base)
  • max_price string? — Max USDC per task
  • status string? — "online" | "offline" | "busy"
Status: Live

Example

const robots = await client.get(
  "/api/v1/robots/list?capability=pick&max_price=0.10"
);
// { robots: [{ robot_id: "robo_...",
//   name: "WarehouseBot-01",
//   capabilities: ["pick","place","scan"],
//   price_per_task: "0.05" }], total: 1 }
GET RTP Task Status
Poll task lifecycle: PENDING, DISPATCHED, IN_PROGRESS, COMPLETED, FAILED, TIMEOUT
/api/v1/robots/status
$0.002 USDC

Parameters

  • task_id string — Task identifier to check
Status: Live

Example

const status = await client.get(
  "/api/v1/robots/status?task_id=task_xyz789"
);
// { task_id: "task_xyz789",
//   status: "COMPLETED",
//   result: { success: true, output: "..." } }
GET RTP Robot Profile
Full robot capability profile, pricing, connection type, and metadata
/api/v1/robots/profile
$0.002 USDC

Parameters

  • robot_id string — Robot identifier
Status: Live

Example

const profile = await client.get(
  "/api/v1/robots/profile?robot_id=robo_138fd1f8e0ee51a"
);
// { robot_id: "robo_...", name: "WarehouseBot-01",
//   capabilities: ["pick","place","scan"],
//   price_per_task: "0.05", status: "online",
//   rtp_uri: "rtp://gateway.spraay.app/robo_..." }
PATCH RTP Update Robot
Update robot name, capabilities, pricing, connection config, or status
/api/v1/robots/update
FREE

Parameters

  • robot_id string — Robot identifier (required)
  • name string? — Updated name
  • capabilities string[]? — Updated capability list
  • price_per_task string? — Updated USDC price
  • connection object? — Updated connection config
  • status string? — "online" | "offline" | "maintenance"
Status: Live

Example

const updated = await client.patch(
  "/api/v1/robots/update", {
    robot_id: "robo_138fd1f8e0ee51a",
    price_per_task: "0.08",
    capabilities: ["pick", "place", "scan", "deliver"]
  }
);
// { status: "updated",
//   robot_id: "robo_138fd1f8e0ee51a",
//   updated_fields: ["price_per_task", "capabilities"] }
POST RTP Deregister Robot
Remove a robot from the registry — blocked if active tasks exist
/api/v1/robots/deregister
FREE

Parameters

  • robot_id string — Robot identifier to remove
Status: LiveNote: Fails with 409 if robot has active tasks

Example

await client.post(
  "/api/v1/robots/deregister", {
    robot_id: "robo_138fd1f8e0ee51a"
  }
);
// { status: "deregistered",
//   robot_id: "robo_138fd1f8e0ee51a",
//   name: "WarehouseBot-01" }
🛡️

Compliance & Audit

2 endpoints
GET x402 Audit Trail
Immutable, queryable payment audit logs for enterprise & grant reporting
/api/v1/audit/query
$0.03 USDC

Parameters

  • wallet string — Wallet to audit
  • from string — Start date (ISO 8601)
  • to string — End date
  • format string — "json" | "csv" | "pdf"
Status: Coming Soon

Example

const report = await client.get(
  "/api/v1/audit/query", {
    wallet: "0xTreasury...",
    from: "2025-01-01",
    to: "2025-03-31",
    format: "csv"
  }
);
// Returns CSV of all batch payments
// with tx hashes, timestamps, amounts
POST x402 Tax
Per-request crypto tax calculation and reporting
/api/v1/tax/calculate
$0.08 USDC

Parameters

  • wallet string — Wallet address
  • tax_year number — Tax year
  • jurisdiction string — "US" | "UK" | "EU"
  • method string — "fifo" | "lifo" | "hifo"
Status: Coming Soon

Example

const taxes = await client.post(
  "/api/v1/tax/calculate", {
    wallet: "0x...",
    tax_year: 2025,
    jurisdiction: "US",
    method: "fifo"
  }
);
// { gains: { short: "$420",
//   long: "$1200" }, events: 84 }
👛

Agent Wallet

5 endpoints

Smart contract wallet provisioning for AI agents on Base. Forked from Abstract Global Wallet — factory-deployed minimal proxies with session keys, spending limits, and time-bound permissions.

POST Provision Agent Wallet
Deploy a smart contract wallet for an AI agent via CREATE2 factory
/api/v1/agent-wallet/provision
$0.05

Parameters

  • agentId string — Unique agent identifier
  • agentType string — Framework: "langchain" | "eliza" | "crewai" | "custom"
  • mode string — "managed" (server generates key) | "self-custody" (provide ownerAddress)
  • ownerAddress string — Required for self-custody mode
Factory: 0xFBD832Db6D9a05A0434cd497707a1bDC43389CfDStatus: Live

Example

// Provision a managed wallet for a LangChain agent
const wallet = await spraay.agentWallet.provision({
  agentId: "trading-bot-007",
  agentType: "langchain",
  mode: "managed"
});
// { walletAddress: "0x...", chainId: 8453,
//   encryptedKey: "base64...", txHash: "0x..." }
POST Add Session Key
Grant a temporary signer with spending limits, expiry, and target restrictions
/api/v1/agent-wallet/session-key
$0.02

Parameters

  • walletAddress string — Agent wallet contract address
  • sessionKeyAddress string — Address to authorize as session key
  • spendLimitEth string — Max ETH the session key can spend
  • durationHours number — Hours until session key expires
  • allowedTargets string[] — Whitelisted contract addresses (optional)
Status: Live

Example

// Add a session key: 0.5 ETH limit, 24 hours
const session = await spraay.agentWallet.addSessionKey({
  walletAddress: "0xWallet...",
  sessionKeyAddress: "0xSigner...",
  spendLimitEth: "0.5",
  durationHours: 24,
  allowedTargets: ["0xBatchContract"]
});
// { txHash: "0x...", expiresAt: "2026-03-21T..." }
GET Wallet Info
Balance, metadata, owner, and active session keys for an agent wallet
/api/v1/agent-wallet/info
$0.005

Parameters

  • address string — Agent wallet contract address
Status: Live

Example

const info = await spraay.agentWallet.info({
  address: "0xWallet..."
});
// { balanceEth: "0.42", agentId: "trading-bot-007",
//   agentType: "langchain", sessionKeys: [...] }
POST Revoke Session Key
Immediately revoke a session key — on-chain + database
/api/v1/agent-wallet/revoke-key
$0.02

Parameters

  • walletAddress string — Agent wallet contract address
  • sessionKeyAddress string — Session key to revoke
Status: Live
GET Predict Address
Predict wallet address before deployment via CREATE2 — useful for pre-funding
/api/v1/agent-wallet/predict
$0.001

Parameters

  • ownerAddress string — Wallet owner address
  • agentId string — Agent identifier for salt generation
Status: Live
💧

XRP Ledger

3 endpoints
POST XRP Batch Payment
Send XRP to multiple recipients in sequential Payment transactions
/api/v1/xrpl/batch
$0.02 USDC

Parameters

  • recipients array — Array of { address, amount } objects (r-addresses)
  • token string — "XRP" (default, native drops conversion handled)
  • sender_secret string — Sender's secret key for signing
Status: LiveChain: XRP Ledger MainnetSDK: xrpl.js

Example

const result = await client.post(
  "/api/v1/xrpl/batch", {
    recipients: [
      { address: "rN7n3...", amount: "10" },
      { address: "rK4x2...", amount: "25" },
      { address: "rP9m7...", amount: "15" }
    ]
  }
);
// { success: true, tx_count: 3,
//   hashes: ["A1B2C3...", ...],
//   total_sent: "50 XRP" }
POST XRP Batch Estimate
Estimate fees and validate recipients before executing a batch
/api/v1/xrpl/batch/estimate
$0.005 USDC

Parameters

  • recipients array — Array of { address, amount } objects
  • token string — "XRP" (default)
Status: LiveLatency: ~200ms

Example

const est = await client.post(
  "/api/v1/xrpl/batch/estimate", {
    recipients: [
      { address: "rN7n3...", amount: "10" }
    ]
  }
);
// { valid: true, tx_count: 1,
//   estimated_fee: "0.000012 XRP",
//   total_amount: "10 XRP" }
GET XRP Chain Info
Network info, fee address, and supported features for XRP Ledger
/api/v1/xrpl/batch/info
$0.005 USDC

Parameters

  • No parameters required
Status: LiveFee Address: rpyynY82uCCgjjyPbxE6iYu6EzNZu6Hg1w

Example

const info = await client.get(
  "/api/v1/xrpl/batch/info"
);
// { chain: "xrpl", chain_id: 15,
//   fee_address: "rpyynY82uCC...",
//   features: ["batch", "estimate"],
//   method: "sequential_payments",
//   sdk: "xrpl.js" }

Stellar

4 endpoints
POST Stellar Batch Payment
Send XLM or any Stellar asset to up to 100 recipients in one atomic transaction
/api/v1/stellar/batch
$0.02 USDC

Parameters

  • recipients array — Array of { address, amount } (G-addresses, up to 100)
  • token string — "XLM", "USDC", "EURC", or asset code
  • asset_issuer string — Issuer address (required for non-XLM assets)
  • sender_secret string — Sender's Stellar secret key
  • memo string — Optional transaction memo
Status: LiveSDK: @stellar/stellar-sdkAtomic: Up to 100 ops/tx

Example

const result = await client.post(
  "/api/v1/stellar/batch", {
    token: "XLM",
    recipients: [
      { address: "GCXK...", amount: "100" },
      { address: "GDPJ...", amount: "250" },
      { address: "GBWQ...", amount: "75" }
    ],
    memo: "Q1 payroll"
  }
);
// { success: true, tx_hash: "a4f8...",
//   recipients_paid: 3,
//   total_sent: "425 XLM",
//   fee: "0.00003 XLM" }
POST Stellar Batch Estimate
Estimate fees, validate recipients and trustlines before execution
/api/v1/stellar/batch/estimate
$0.005 USDC

Parameters

  • recipients array — Array of { address, amount } objects
  • token string — Asset code ("XLM", "USDC", etc.)
  • asset_issuer string — Issuer for non-XLM assets
Status: LiveLatency: ~150ms

Example

const est = await client.post(
  "/api/v1/stellar/batch/estimate", {
    token: "USDC",
    asset_issuer: "GA5ZS...",
    recipients: [
      { address: "GCXK...", amount: "100" }
    ]
  }
);
// { valid: true, ops_count: 1,
//   tx_count: 1, fee: "0.00001 XLM",
//   trustline_issues: [] }
GET Stellar Chain Info
Network info, supported assets, and batch operation limits
/api/v1/stellar/batch/info
$0.005 USDC

Parameters

  • No parameters required
Status: LiveMax Ops/Tx: 100

Example

const info = await client.get(
  "/api/v1/stellar/batch/info"
);
// { chain: "stellar", chain_id: 16,
//   max_ops_per_tx: 100,
//   method: "multi_operation_tx",
//   supported_assets: ["XLM","USDC","EURC"],
//   sdk: "@stellar/stellar-sdk",
//   finality: "~5 seconds" }
POST Stellar Path Batch
Cross-asset batch: send XLM, recipients receive USDC via Stellar DEX path payments
/api/v1/stellar/path-batch
$0.03 USDC

Parameters

  • recipients array — Array of { address, amount, dest_asset } objects
  • send_asset string — Asset to send ("XLM" default)
  • max_slippage number — Max slippage percentage (default: 1%)
  • sender_secret string — Sender's Stellar secret key
Status: Coming SoonUnique to Stellar: Cross-asset atomic batch via DEX

Example

const result = await client.post(
  "/api/v1/stellar/path-batch", {
    send_asset: "XLM",
    recipients: [
      { address: "GCXK...",
        amount: "50",
        dest_asset: "USDC" },
      { address: "GDPJ...",
        amount: "100",
        dest_asset: "USDC" }
    ],
    max_slippage: 1.5
  }
);
// { success: true, tx_hash: "b7c9...",
//   paths_used: 2,
//   total_xlm_spent: "1250.45 XLM",
//   total_usdc_received: "150.00 USDC" }