Get Started
If you already have some programming experience, skip ahead.
This guide walks you through setting up an AI-powered code editor and creating recommended accounts. You can then customize existing code or build your own project from scratch.
Cursor Setup
Cursor is a modern, AI-powered IDE with a free plan available. Also consider using Codex, Claude Code, and v0.
Add Docs
Allow your assistant to read these docs too.
- Press
Cmd+K(or open the palette) and type@Docs, or go to Settings → Features → Docs - Choose "Add doc"
- Enter
https://docs.sapience.xyz/as the URL - Name it "Sapience" and save to index
- Use in prompts:
@Docs Sapience
Add Tools
Attaching the MCP server gives your editor tools that allow it to interact with Sapience's API directly. Learn more about the MCP server at /builder-guide/api/mcp.
- Open Cursor → Settings → Cursor Settings → Tools & MCP → Add new MCP server
- Paste the following configuration and save:
{
"mcpServers": {
"sapience": {
"command": "npx",
"args": ["mcp-remote", "https://api.sapience.xyz/mcp"]
}
}
}- Note this requires Node.js on your PATH so
npxis available. (Ask an AI to help if you don't know what this means.) - After saving, restart Cursor if tools do not appear.
Ethereum Account Setup
You'll need an Ethereum wallet to interact with Sapience markets.
Private Key Generation
You can use a wallet app or generate one locally for development.
- MetaMask: Download browser extension
- Rainbow: Download mobile app
- Coinbase Wallet: Download
To generate a random private key from your terminal:
# Using OpenSSL (32 bytes -> 64 hex chars)
openssl rand -hex 32
# Or with Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"To derive the wallet address from a private key:
# Using Foundry (cast)
cast wallet address --private-key 0xYOUR_PRIVATE_KEY
# Or with Node.js + ethers v5 (ethers must be installed)
PRIVATE_KEY=0xYOUR_PRIVATE_KEY node -e "const { Wallet } = require('ethers'); console.log(new Wallet(process.env.PRIVATE_KEY).address)"For development and testing:
- Create a new wallet
- Save your seed phrase or private key securely
- Do not reuse this wallet for production
Wallet Funding
You'll need ETH on Arbitrum to pay gas fees for submitting forecasts. You can use Coinbase or other centralized exchanges to buy ETH and withdraw to the Arbitrum One network.
For trading on Sapience markets, you'll also need USDe on Ethereal for both gas and trading collateral. Visit ethereal.trade to bridge assets to Ethereal.
Git Setup
If you don't already have a GitHub account, create one at github.com. Then, download GitHub for Desktop.
GitHub is essential for:
- Version control of your code
- Collaborating with others
- Deploying your applications
OpenRouter Setup
OpenRouter provides access to multiple AI models for your applications.
- Go to OpenRouter
- Sign up for an account
- Navigate to your API keys
- Create a new API key for your project
- Store the key securely in your environment variables
You can use OpenRouter to integrate AI capabilities into your Sapience-powered applications.
Railway Setup
Railway makes it easy to deploy apps and agents with one-click deployment.
Quick Start: Deploy a forecasting agent instantly using the Deploy a Forecasting Agent guide.
For manual setup:
- Visit railway.com and create an account
- Create a new project and connect your GitHub repo
- Set environment variables in the project settings (see Forecasting Agent environment variables for reference)
- Deploy your services and verify healthchecks