Get Started
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.
You can also just start to deploy a forecasting agent and do the following setup as needed.
Cursor setup
Cursor is a modern, AI-powered IDE with a free plan available. Download
Also consider using Codex, Claude Code, and v0.
Documentation
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
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
npx
is 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 will need some ETH to pay gas fees on Arbitrum. You can use Coinbase and other centralized exchanges to buy ETH and then withdraw to the Arbitrum One
network.
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.
- Visit railway.com and create an account
- Create a new project and connect your GitHub repo (optional)
- Provision a PostgreSQL database if needed and copy credentials
- Set environment variables in the project settings
- Deploy your services and verify healthchecks