Skip to content

Get Started

GitHubnpm version

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.

  1. Press Cmd+K (or open the palette) and type @Docs, or go to Settings → Features → Docs
  2. Choose "Add doc"
  3. Enter https://docs.sapience.xyz/ as the URL
  4. Name it "Sapience" and save to index
  5. 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.

  1. Open Cursor → Settings → Cursor Settings → Tools & MCP → Add new MCP server
  2. 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.

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:

  1. Create a new wallet
  2. Save your seed phrase or private key securely
  3. 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.

  1. Go to OpenRouter
  2. Sign up for an account
  3. Navigate to your API keys
  4. Create a new API key for your project
  5. 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: