Chainstack Self-Hosted is now available! Launch production-grade blockchain nodes on infrastructure you control.    Get started
  • Agents
  • Pricing

Base RPC for AI agents: infrastructure and setup (2026)

Created Jul 13, 2026 Updated Jul 13, 2026
Base RPC for AI agents — infrastructure architecture with AgentKit, MCP, and Chainstack

TL;DR

LLMs gave AI agents the ability to answer questions, analyze information, write code, and plan complex tasks. But an LLM’s capabilities stop at the point of execution, limiting them to being a copilot. To become truly autonomous, they need infrastructure that enables them to take action.

Give your agents wallets, onchain identities, and the ability to execute transactions, interact with smart contracts, and perform onchain actions — all through a single Base RPC — to build production-ready AI agents with Base AgentKit, powered by the x402 protocol.

Prerequisites

Before setting up an AI agent on Base, have the following ready:

  • Node.js 18+ or Python 3.10+, depending on your SDK choice
  • An LLM provider API key (OpenAI, Anthropic, or any framework-compatible model)
  • A Base RPC endpoint from a dedicated infrastructure provider
  • Familiarity with basic wallet concepts: private keys, gas, and transaction signing
  • A package manager: npm/pnpm for TypeScript, pip/poetry for Python

What are Base Agents (and what is AgentKit)?

It all started with a dormant HTTP status code: 402 Payment Required. Originally reserved for a web-native payment flow for future use, HTTP 402 has found a new purpose onchain with AI agents.

📖 Learn more about how the HTTP 402 status code is being used by the x402 protocol.

AI agents are no longer limited to answering questions. They can hold wallets, execute transactions, manage liquidity, deploy contracts, and interact with decentralized applications autonomously.

Built by Coinbase, Base provides a low-cost, high-throughput environment that makes autonomous onchain actions economically viable. Combined with frameworks like AgentKit, developers can build AI agents capable of interacting with smart contracts, managing assets, and executing complex workflows onchain.

Base AgentKit provides the core infrastructure for building autonomous onchain agents, abstracting away wallet management, transaction execution, and payment flows into reusable components so developers can focus on agent logic. AgentKit equips agents with everything they need to operate onchain:

  • Built-in agent skills. Plug-and-play actions such as authentication, funding, transfers, trading, and earning, without implementing transaction logic from scratch.
  • Native x402 support. A payment protocol designed for machine-to-machine interactions, enabling agents to pay for APIs, compute, and services programmatically.
  • Gasless execution on Base. Keep agents running continuously without manually managing gas balances.
  • Agent CLI. Provision wallets, fund agents, and manage capabilities from the command line in minutes.
  • Security by default. Programmable spending limits, secure key isolation, and compliance guardrails powered by Coinbase’s infrastructure.
Tweet 2052396407600910344 logo

As agent frameworks mature, the challenge shifts away from model capabilities and toward infrastructure reliability. An AI agent that misses a market opportunity because of stale blockchain data, fails a transaction due to rate limits, or loses context because of inconsistent RPC responses quickly becomes unusable in production. Chainstack provides the infrastructure that supports every stage of an AI agent’s onchain workflow:

  • Read onchain data. Query balances, token prices, contract state, events, and historical data through high-performance RPC endpoints, indexed APIs, or ingest the entire Chainstack documentation as a structured knowledge source using chainstack.com/llms.txt or the more comprehensive llms-full.txt.
  • Sign and execute transactions. Connect AgentKit wallets or other custody solutions to securely submit transactions. With a Chainstack API key, agents can also deploy and manage blockchain nodes that power transaction execution.
  • Make programmable payments. Integrate payment protocols such as x402 to let agents pay for APIs, compute, and other machine-to-machine services as part of autonomous workflows.
  • Swap and bridge assets. Build agents that automatically swap tokens, rebalance portfolios, and bridge assets across supported blockchain networks using onchain protocols.
  • Participate in governance. Enable agents to monitor proposals, delegate voting power, and cast votes across DAOs based on predefined policies.
  • Build onchain identity. Create attestations, establish reputation, and integrate with identity standards such as ERC-8004, allowing agents to become trusted participants in decentralized ecosystems.

AgentKit enables agents to act onchain, while Chainstack MCP gives them direct access to the blockchain infrastructure they need. Compatible with Claude Code, Cursor, Codex, ChatGPT, Gemini, and other MCP-enabled assistants.

Base RPC infrastructure for AI agents: endpoints, WebSocket, Flashblocks

Base provides a fully Ethereum-compatible JSON-RPC interface and was originally built on the OP Stack, maintaining compatibility with the OP Stack specification. It has since evolved into the unified base/base stack, consolidating sequencer, consensus, execution, and fault-proof components into a Reth-based architecture (base-reth-node + base-consensus) to improve scalability, upgrade velocity, and operational efficiency. This architecture introduces Flashblocks (~200ms preconfirmations), optimized state management, and a modular foundation for advanced TEE/ZK proving systems while exposing a fully Ethereum-compatible JSON-RPC interface.

📖 If you are building AI agents or making RPC calls through AgentKit, the base/base node-software migration does not affect you. The JSON-RPC interface, chain ID, and contract addresses stay the same, and Chainstack handles the underlying node transition. If you run your own Base node, operate validating infrastructure, or are otherwise affected at the node-software layer, refer to the Base chain migration guide: from OP Stack to base/base.

Production RPC through Chainstack provides access to Base Mainnet and Base Sepolia with JSON-RPC methods, WebSocket connectivity, archive infrastructure, and Flashblocks-aware endpoints for sub-second preconfirmations. Base RPC is available on both Mainnet and Sepolia.

Mainnet

  • Chain ID: 8453
  • HTTPS: https://base-mainnet.core.chainstack.com
  • WebSocket: wss://base-mainnet.core.chainstack.com

Testnet (Sepolia)

  • Chain ID: 84532
  • HTTPS: https://base-sepolia.core.chainstack.com

Since Base exposes the standard Ethereum JSON-RPC interface, common methods work exactly as they do on Ethereum. For example, you can retrieve the latest block number using eth_blockNumber:

const options = {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ jsonrpc: '2.0', method: 'eth_blockNumber', id: 1 })
};

fetch('https://base-mainnet.core.chainstack.com/<KEY>', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Production applications often rely on WebSocket connections for real-time updates such as new blocks, pending transactions, and contract events. Chainstack provides dedicated WebSocket endpoints for Base:

wss://base-mainnet.core.chainstack.com

⚠️ The public Base RPC URLs do not support WebSocket connections. If your application requires subscriptions such as eth_subscribe or real-time event streaming, use a dedicated provider such as Chainstack.

The following example subscribes to newly produced Flashblock transactions using eth_subscribe:

const WebSocket = require('ws');

const webSocket = new WebSocket('CHAINSTACK_WSS_URL');

async function subscribeToFlashblockTransactions() {
  const request = {
    id: 1,
    jsonrpc: '2.0',
    method: 'eth_subscribe',
    params: ['newFlashblockTransactions'],
  };

  const onOpen = (event) => {
    webSocket.send(JSON.stringify(request));
  };

  const onMessage = (event) => {
    const response = JSON.parse(event.data);
    console.log(response);
  };

  try {
    webSocket.addEventListener('open', onOpen);
    webSocket.addEventListener('message', onMessage);
  } catch (error) {
    console.error(error);
  }
}

subscribeToFlashblockTransactions();

For agent code that reads balances or nonces ahead of a transaction, an AgentKit action provider can request preconfirmed state by passing pending instead of latest on eth_getBalance or eth_getTransactionCount, cutting the effective wait for fresh state from roughly 2000ms down to 300–500ms. Chainstack’s Base nodes also support the eth_subscribe, newFlashblockTransactions, and pendingLogs subscription types over WebSocket, for agents that need to react to individual preconfirmed transactions or filtered event logs rather than polling.

Archive-enabled infrastructure also supports advanced debugging methods such as debug_traceTransaction, useful for reconstructing exactly how an agent’s transaction executed after the fact:

const options = {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'debug_traceTransaction',
    id: 1,
    params: ['0x317888c89fe0914c6d11be51acf758742afbe0cf1fdac11f19d35d6ed652ac29']
  })
};

fetch('https://base-mainnet.core.chainstack.com/<KEY>', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Transactions are submitted to the Base sequencer through the standard eth_sendRawTransaction RPC method. The following example sends a signed transaction to the sequencer:

const options = {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_sendRawTransaction',
    id: 1,
    params: ['0xsigned_tx']
  })
};

fetch('https://base-mainnet.core.chainstack.com/<KEY>', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Once the sequencer accepts the transaction, the standard block includes it within roughly 2 seconds — or as fast as 200ms if reading through the Flashblocks-aware pending tag. Full finality against Ethereum L1 follows separately, in roughly 15 to 20 minutes once the batch is posted and finalized. Base has no public mempool, since a single sequencer orders transactions, which means the RPC endpoint an agent submits through is the only path in, making endpoint latency a direct factor in inclusion speed.

For a complete reference covering supported endpoints, authentication, archive access, WebSocket connectivity, and Flashblocks integration, see the Base documentation.

How to set up a Base AI agent with Chainstack MCP

Provisioning RPC infrastructure manually — opening a console, clicking through project settings, copying an endpoint — is a workflow built for humans. An agent’s RPC traffic profile differs from a typical dApp frontend in a specific way: it is bursty and event-triggered rather than steady and human-paced. A liquidation-scanning agent might issue a handful of calls per minute during quiet markets, then fire hundreds of eth_call and eth_getLogs requests within seconds when a price move triggers its logic. Infrastructure that rate-limits aggressively or bills unpredictably under burst conditions becomes the actual bottleneck, not the LLM.

MCP (Model Context Protocol) shifts blockchain infrastructure from raw JSON-RPC requests to a structured tool interface designed for AI agents. Rather than constructing payloads such as eth_getBalance or parsing hexadecimal RPC responses, an agent invokes typed tools like get_balance with named parameters and receives structured outputs it can reason about directly. The underlying communication still uses JSON-RPC, but MCP abstracts node interactions into discoverable, self-describing capabilities that are significantly easier for LLMs to orchestrate autonomously.

Through the Chainstack MCP server, exposed as a remote Streamable HTTP endpoint at mcp.chainstack.com, AI agents can provision blockchain nodes, retrieve RPC endpoints, search documentation, monitor platform status, and access pricing information directly from a prompt.

Connect Chainstack MCP in Claude Code

Paste this into Claude Code or Claude Desktop chat:

get mcp.chainstack.com

Option 1: Skill mode (no MCP registration)

The agent pulls a SKILL.md on demand and calls tools over HTTP without keeping them loaded in context every session.

mkdir -p ~/.claude/skills/chainstack
curl -o ~/.claude/skills/chainstack/SKILL.md https://mcp.chainstack.com/skill

Option 2: Register as an MCP server

Tools stay available in every session.

claude mcp add --transport http chainstack https://mcp.chainstack.com/mcp

# Available across all projects:
claude mcp add --transport http chainstack https://mcp.chainstack.com/mcp --scope user

# Verify:
claude mcp list

Passing the Chainstack Platform API key:

claude mcp add --transport http chainstack https://mcp.chainstack.com/mcp \
  --header "Authorization: Bearer YOUR_API_KEY" -s user

Windsurf, GitHub Copilot, Gemini CLI, Antigravity, Claude.ai, and ChatGPT are all supported; the fastest way into any of them is simply typing get mcp.chainstack.com into the agent, which fetches the onboarding page and self-configures.

Full connection guides are available for Claude and Codex.

What Chainstack MCP tools are available

Tool access is split into two tiers.

No API key needed. Works immediately, no account required.

ToolDescription
search_docsSearch Chainstack documentation
get_doc_pageFetch the full content of a documentation page
get_platform_statusCheck platform status, active incidents, and network health
contact_chainstackSubmit a message to the Chainstack team
get_chainstack_pricingFetch a live Chainstack pricing snapshot

API key required. All tools appear in the agent’s tool list regardless of auth. The tools below execute only when the key is configured. Calls without it return an auth error.

ToolDescription
get_organizationGet organization name and ID
get_deployment_optionsList available blockchain/cloud/region combinations
list_projectsList all projects
create_projectCreate a new project
get_projectGet project details
update_projectUpdate a project’s name or description
delete_projectDelete a project
list_nodesList all nodes with status and endpoints
get_nodeGet a node’s full details including RPC endpoints
create_nodeDeploy a new blockchain node
update_nodeRename a node
delete_nodeDelete a node
request_testnet_fundsTop up a testnet address from the Chainstack faucet

How to deploy a Base node by prompt

With the server registered, provisioning the Base RPC endpoint for your agent becomes a single prompt inside your coding assistant:

Deploy a Base mainnet Global Node on Chainstack and give me the HTTPS endpoint.

The agent calls create_node with the Base protocol and mainnet network, then get_node to return the live HTTPS and WSS endpoints, ready to drop directly into your AgentKit wallet provider configuration. The same pattern works for Base Sepolia during testing:

Create a Base Sepolia node with Chainstack and show me the RPC endpoint.

Other prompts worth knowing while building:

What's the correct method to get an account's ETH balance on Base? Write the call.

This routes through search_docs and get_doc_page, so the agent grounds its answer in Chainstack’s actual RPC reference instead of generating a plausible-looking but incorrect method signature — a common failure mode when LLMs write blockchain code from memory.

Any upcoming maintenance on Base I should plan around?

This calls get_platform_status, useful for scheduling agent deployments or pausing a live trading agent ahead of a known maintenance window.

Trace transaction [signedTx] and explain what happened step by step.

For migrating an existing agent off another provider, the MCP server can inventory current usage and estimate savings directly, since Chainstack bills 1 request unit per standard call and 2 for archive or debug/trace calls, with no per-method multiplier — a structural difference from providers that weight individual methods at 20 to 26 times a base call.

I'm on a provider spending ~$2k/mo on these methods. Assess my setup, plan the move to Chainstack, and tell me how much I'd save.

Tools for building AI agents on Base

Build the next generation of AI agents on Base using the builder tools below:

Base On X — Builder Tools Announcement logo
  • AgentKit SDK (TypeScript & Python) — Open-source framework for building autonomous onchain AI agents with wallet management, transaction execution, and built-in agent actions.
  • Model Context Protocol (MCP) — AgentKit support for MCP-compatible AI assistants and development environments.
  • Base Agents Overview — Introduction to the Base agent ecosystem, architecture, and capabilities.
  • Base Agent Documentation — Resources for deploying, configuring, and scaling autonomous agents on Base.
  • Chainstack MCP server — Official guide for connecting AI assistants to Base through MCP and building agent-powered applications.
  • Chainstack llms.txt — Structured documentation context optimized for AI assistants and LLM-powered workflows.
  • Coinbase Developer Platform (CDP) — API key management, wallet infrastructure, and developer tooling for Base applications.
  • x402 Protocol — Documentation and tooling for machine-to-machine payments and autonomous agent transactions.
  • Claude Code — MCP-compatible coding environment for building and provisioning Base agent infrastructure.
  • Cursor — AI-native development environment with MCP support for blockchain workflows.
  • GitHub Copilot — AI-assisted coding platform compatible with Chainstack MCP tools.
  • Gemini CLI — Command-line AI assistant with support for MCP-based blockchain infrastructure management.
  • Codex — MCP-enabled AI assistant by ChatGPT capable of provisioning infrastructure and interacting with blockchain development tools directly from natural language prompts.

Considerations

  • Testnet-first development is not optional. Every action provider should be exercised on base-sepolia, including failure paths, before any mainnet key is funded.
  • Use eth_simulateV1 before submission. Simulating a multi-step transaction sequence in a single call catches failures before gas is spent, which matters for an autonomous agent that cannot manually retry a failed transaction the way a human would.
  • Implement application-level failover. An agent that depends on a single RPC endpoint fails completely when that endpoint has an incident. Chainstack’s Global Nodes provide built-in geo-failover, so a regional degradation reroutes automatically without additional application logic.
  • Monitor nonce. Agents that submit transactions in quick succession are prone to nonce collisions if two tool calls race. Track the expected nonce in application state rather than re-fetching it from eth_getTransactionCount for every submission.
  • Custody model shapes risk. A CDP-managed MPC wallet, a Privy embedded wallet, and a self-managed viem signer each carry different operational and security trade-offs. The right choice depends on whether the agent’s funds are custodial, semi-custodial, or fully self-directed by the end user.
  • Set spending guardrails. Prompt instructions telling an LLM to limit spend are not a security boundary. Enforce transaction value limits and allow-listed contract addresses in the wallet provider or action provider logic itself.
  • Log every action provider call. Since agents act autonomously, a clear audit trail of what was called, with what parameters, and what the RPC response was, is the primary tool for debugging unexpected agent behavior.

Conclusion

Building an AI agent on Base comes down to three coordinated layers: an LLM that reasons about actions, AgentKit that translates those decisions into structured wallet and contract operations, and Chainstack’s Base RPC that reliably executes them onchain. The first two layers are increasingly standardized through Coinbase’s open-source tooling. The third is where most production incidents originate, since agent traffic is bursty in a way that most RPC pricing models were not designed to absorb gracefully.

Chainstack’s request-based pricing, archive and trace support, and geo-failover infrastructure address this mismatch directly, making it a practical foundation for AgentKit deployments moving from prototype to production on Base. Setting it up no longer requires leaving the coding assistant: register the Chainstack MCP server, provision a Base node by prompt, and drop the returned endpoint straight into your AgentKit wallet provider.

FAQs

What is Base AgentKit and why is it useful for AI agents?

Base AgentKit is an open-source framework from Coinbase that helps developers build AI agents capable of performing onchain actions. Instead of manually handling wallets, transaction signing, payments, and smart contract interactions, developers can use AgentKit’s built-in tools to give agents the ability to transfer assets, interact with decentralized applications, and execute blockchain transactions autonomously.

Can I build and test my AI agent on Base Sepolia before deploying to mainnet?

Yes. Base Sepolia is the recommended environment for development and testing. Developers should validate wallet operations, smart contract interactions, transaction simulations, and error-handling workflows on Base Sepolia before funding wallets or deploying agents on Base Mainnet. This approach helps identify issues early and reduces the risk of costly mistakes. Fund your testnet wallet through the Chainstack Base Sepolia faucet.

What is the x402 protocol and how does it help AI agents?

The x402 protocol repurposes the HTTP 402 Payment Required status code to enable machine-to-machine payments. For AI agents, this creates a standardized way to pay for APIs, compute resources, infrastructure services, and other digital products programmatically. Combined with AgentKit, x402 allows agents to participate in autonomous economic activities without requiring manual payment approvals.

How can AI agents benefit from Flashblocks on Base?

Flashblocks provide preconfirmations that can make blockchain state available in as little as a few hundred milliseconds. By reading pending state and subscribing to Flashblock-related events, AI agents can react more quickly to market changes, monitor transactions in near real time, and execute time-sensitive workflows with lower latency than waiting for full block confirmations.

Is MCP required to use Base AgentKit?

No. AgentKit can be used independently with any compatible RPC endpoint. However, MCP significantly improves the developer experience by allowing AI coding assistants to provision infrastructure, retrieve documentation, monitor platform status, and manage blockchain resources through structured tools instead of raw API calls. This makes agent development faster and more automated.

What are the most important security considerations when deploying AI agents on Base?

Security should focus on wallet custody, spending limits, transaction validation, and audit logging. Developers should enforce hard transaction limits in code, maintain detailed logs of every onchain action, carefully manage private keys or MPC wallets, monitor nonce handling, and test extensively on Base Sepolia before deploying agents with access to real funds.

SHARE THIS ARTICLE
Utkarshini Arora

Utkarshini Arora

A SheFi Scholar and dedicated Blockchain Researcher. As an educator and content creator, she focuses on creating clear tools and explanations that help developers understand and apply modern technologies.


Customer Stories

CertiK

CertiK cut Ethereum archive infrastructure costs by 70%+ for its radical take on Web3 security.

SMARTy Pay

Automating infrastructure network operations with databases and the blockchain application.

Kenshi Oracle Network

Contributing towards a swifter Web3 for all with secure, efficient, and robust oracle infrastructure.