This guide explains how to obtain API keys and credentials for each platform supported by PredictBot.
- Polymarket Setup
- Kalshi Setup
- Manifold Markets Setup
- PredictIt Setup
- AI Services Setup
- Polyseer Setup
Polymarket is a decentralized prediction market on the Polygon blockchain. You'll need an Ethereum wallet and a Polygon RPC endpoint.
- Install MetaMask browser extension
- Create a new wallet or import an existing one
- Create a new account specifically for trading
- Export the private key:
- Click the three dots menu → Account Details
- Click "Export Private Key"
- Enter your password
- Copy the private key (starts with
0x)
from eth_account import Account
account = Account.create()
print(f"Address: {account.address}")
print(f"Private Key: {account.key.hex()}")-
Get USDC on Polygon:
- Bridge USDC from Ethereum to Polygon using Polygon Bridge
- Or buy USDC directly on Polygon via exchanges that support Polygon withdrawals
-
Get MATIC for gas:
- You need a small amount of MATIC (1-5 MATIC is plenty) for transaction fees
- Buy from exchanges or use a faucet for small amounts
You need an RPC endpoint to interact with the Polygon blockchain.
- Go to Infura
- Create a free account
- Create a new project
- Select "Polygon" network
- Copy the HTTPS endpoint URL
- Go to Alchemy
- Create a free account
- Create a new app for Polygon Mainnet
- Copy the HTTPS URL
https://polygon-rpc.com
POLY_PRIVATE_KEY=0x... # Your wallet private key
POLY_RPC_URL=https://polygon-mainnet.infura.io/v3/YOUR_PROJECT_IDKalshi is a CFTC-regulated prediction market exchange.
- Go to Kalshi
- Click "Sign Up"
- Complete identity verification (required for trading)
- Fund your account via bank transfer or wire
- Log in to your Kalshi account
- Go to Settings → API Access
- Click "Generate API Key"
- Save both the API Key ID and API Secret
⚠️ The secret is only shown once!
KALSHI_API_KEY=your_api_key_id
KALSHI_API_SECRET=your_api_secret- Kalshi API Docs
- Rate limits: 60 requests/minute for most endpoints
Manifold is a play-money prediction market platform.
- Go to Manifold Markets
- Sign up with Google or email
- You'll receive starting Mana (play money)
- Log in to Manifold
- Go to your Profile → Edit Profile
- Scroll down to API Key
- Click "Generate" or copy existing key
MANIFOLD_API_KEY=your_api_key
MANIFOLD_USERNAME=your_username- Manifold API Docs
- Rate limits: Generally permissive, ~100 requests/minute
PredictIt is a real-money political prediction market. API access is limited.
- Go to PredictIt
- Create an account
- Complete identity verification
- Fund your account (max $850 per market)
Note: PredictIt has limited official API support. Options include:
https://www.predictit.org/api/marketdata/all/
This endpoint provides market data but not trading capabilities.
- Log in to PredictIt in your browser
- Open Developer Tools (F12)
- Go to Application → Cookies
- Find and copy the session cookie value
PREDICTIT_API_TOKEN=your_session_token # If available
# OR
PREDICTIT_USERNAME=your_username
PREDICTIT_PASSWORD=your_password # Less secure- No official trading API
- $850 maximum investment per market
- 10% fee on profits
- Limited automation support
- Go to OpenAI Platform
- Create an account or sign in
- Go to API Keys section
- Click "Create new secret key"
- Copy the key (starts with
sk-)
Pricing: Pay-per-use. GPT-4 is ~$0.03/1K input tokens, $0.06/1K output tokens.
OPENAI_API_KEY=sk-...- Go to Anthropic Console
- Create an account
- Go to API Keys
- Generate a new key
Pricing: Similar to OpenAI. Claude 3 Opus is premium tier.
ANTHROPIC_API_KEY=sk-ant-...- Go to xAI
- Request API access (may have waitlist)
- Generate API key when available
XAI_API_KEY=your_xai_keyFor cost-effective operation:
# Use GPT-4 for primary analysis
OPENAI_API_KEY=sk-...
AI_MODEL=openai:gpt-4
# Set monthly budget limit
AI_MONTHLY_BUDGET=50.0Polyseer is an AI research assistant that requires a Valyu API key.
- Go to Valyu.ai
- Create an account
- Navigate to API settings
- Generate an API key
VALYU_API_KEY=your_valyu_key
POLYSEER_ENABLED=true- ✅ Use dedicated wallets for trading
- ✅ Store secrets in
.envfile (never commit to git) - ✅ Use environment variables, not hardcoded values
- ✅ Rotate API keys periodically
- ✅ Set spending limits where available
- ✅ Start with DRY_RUN=1 for testing
- ❌ Share API keys or private keys
- ❌ Commit
.envfiles to version control - ❌ Use your main crypto wallet
- ❌ Store large amounts in trading wallets
- ❌ Disable DRY_RUN without thorough testing
- Verify the key is copied correctly (no extra spaces)
- Check if the key has expired
- Ensure you're using the correct environment (prod vs sandbox)
- Reduce request frequency
- Implement exponential backoff
- Check platform-specific rate limits
- Verify wallet/account balance
- Check for pending transactions
- Ensure you have gas (for Polymarket)
- Verify RPC URL is correct
- Check internet connectivity
- Try alternative RPC endpoints
| Platform | Key Variables | Where to Get |
|---|---|---|
| Polymarket | POLY_PRIVATE_KEY, POLY_RPC_URL |
MetaMask + Infura |
| Kalshi | KALSHI_API_KEY, KALSHI_API_SECRET |
Kalshi Dashboard |
| Manifold | MANIFOLD_API_KEY, MANIFOLD_USERNAME |
Manifold Profile |
| PredictIt | PREDICTIT_API_TOKEN |
Browser DevTools |
| OpenAI | OPENAI_API_KEY |
platform.openai.com |
| Anthropic | ANTHROPIC_API_KEY |
console.anthropic.com |
| Polyseer | VALYU_API_KEY |
valyu.ai |