← Back to Dashboard

refinORE API Documentation

Complete API reference for AI agents (OpenClaw, Clawdbot, ElizaOS) and automated mining. Compatible with any HTTP-capable agent framework.

OpenClawClawdbotElizaOSAutoGPTLangChainCrewAIMCP
⚠️

Security Warning

API keys give full control over your mining account and real funds. Anyone with your API key can:

  • Deploy SOL/USDC/ORE on mining rounds
  • Start and stop mining sessions
  • Create strategies and swap orders
  • Execute direct swaps between supported wallet tokens
  • Access your mining history and balances

Never share your API key publicly. Treat it like a password. Revoke compromised keys immediately.

But hey, that's also what makes it fun! 🤖 Your AI agent can mine 24/7 autonomously.

🔨

Want a CLI Instead?

Skip the manual curl commands! Use refinore-cli for instant mining:

# One command install + start mining
npx -y refinore-cli --auto-mine

# After first run, refinore is globally available
refinore mine --amount 0.01 --tiles 15
refinore status
refinore balance

Quick Start (Manual API)

1. Get Your API Key

Go to Settings → API Keys → Create Key. Copy it immediately — you won't see it again!

2. Set Environment Variables

export REFINORE_API_URL="https://automine.refinore.com/api"
export REFINORE_API_KEY="rsk_your_key_here"

3. Get Your Wallet Address

Every account has an embedded Solana wallet. Discover it via the API:

curl "$REFINORE_API_URL/account/me" \
  -H "x-api-key: $REFINORE_API_KEY"

# Response includes:
# {
#   "wallet_address": "HVDr...hEdb",
#   "deposit_instructions": {
#     "network": "Solana",
#     "address": "HVDr...hEdb",
#     "supported_tokens": ["SOL", "USDC", "ORE", "stORE", "SKR"],
#     "note": "stORE means the current mint. Legacy stORE is send/unshield-only for migration at https://ore.com/stake.",
#     "minimum_sol_for_gas": "0.005 SOL"
#   }
# }

4. Fund the Wallet

Send SOL or USDC to the wallet address above. You need at least 0.005 SOL for gas fees and some mining collateral (e.g., 0.01+ SOL).

5. Start Mining

curl -X POST "$REFINORE_API_URL/mining/start" \
  -H "x-api-key: $REFINORE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_address": "YOUR_WALLET_ADDRESS",
    "sol_amount": 0.01,
    "num_squares": 15,
    "mining_token": "SOL",
    "risk_tolerance": "less-risky"
  }'

Authentication

All authenticated endpoints require the x-api-key header:

curl "$REFINORE_API_URL/endpoint" \
  -H "x-api-key: rsk_your_key_here"

Keys use the rsk_ prefix and are SHA-256 hashed server-side. API keys never expire. Max 5 keys per account. Revoke in Settings → API Keys if compromised.

Alternative: Authorization: Bearer <jwt_token> (Privy JWT — used by the web dashboard).

Base URL

https://automine.refinore.com/api

Account Endpoints

GET/account/me

Get your account info including wallet address, email, and deposit instructions. Essential for agents to discover where to send funds.

Response:

{
  "privy_user_id": "did:privy:abc123",
  "email": "user@example.com",
  "wallet_address": "HVDr...hEdb",
  "wallet_chain": "solana",
  "wallet_type": "embedded",
  "created_at": "2026-01-15T10:00:00Z",
  "deposit_instructions": {
    "network": "Solana",
    "address": "HVDr...hEdb",
    "supported_tokens": ["SOL", "USDC", "ORE", "stORE", "SKR"],
    "minimum_sol_for_gas": "0.005 SOL",
    "note": "stORE means the current mint. Legacy stORE is send/unshield-only for migration at https://ore.com/stake."
  }
}

Mining Endpoints

POST/mining/start

Start a new mining session. Use the wallet address from /account/me.

Request Body:

{
  "wallet_address": "YOUR_WALLET_ADDRESS",
  "sol_amount": 0.005,
  "num_squares": 25,
  "tile_selection_mode": "optimal",
  "risk_tolerance": "less-risky",
  "mining_token": "SOL",
  "auto_restart": true,
  "frequency": "every_round"
}

tile_selection_mode: optimal | random | custom | odd | even | hot | cold

custom_tiles: Array of tile indices 0-24 (0-indexed: tile 1 in UI = index 0, tile 25 = index 24). Required when mode is custom.

mining_token: SOL | USDC | ORE | stORE | SKR

risk_tolerance: degen | risky | less-risky | positive-ev

Legacy values high, medium, low are auto-mapped to risky, less-risky, positive-ev.

POST/mining/start(with custom tiles)

Start mining with specific tile IDs (0-24)

{
  "wallet_address": "YOUR_WALLET",
  "sol_amount": 0.005,
  "num_squares": 5,
  "tile_selection_mode": "custom",
  "custom_tiles": [0, 6, 12, 18, 24],
  "mining_token": "SOL"
}
PATCH/mining/session/edit

Live-edit an active manual mining session between rounds. Only send the fields you want to change — everything else stays the same. Changes take effect on the next deployment.

{
  "sol_amount": 0.01,
  "num_squares": 20,
  "tile_selection_mode": "hot",
  "risk_tolerance": "risky"
}

For strategy-based sessions, use PATCH /auto-strategies/:id/live instead.

POST/mining/stop

Stop the active mining session

GET/mining/session

Get active session status, stats, and current round info

GET/mining/session-rounds?session_id=UUID

Get round-by-round results for a session

GET/mining/history?limit=20

Get historical mining sessions

GET/mining/last-config

Get last mining configuration (useful for auto-restart)

GET/mining/round/:roundNumber

Get details for a specific round by number (includes your deployment and win/loss status)

POST/mining/reload-session

Reload/restart a mining session with existing config

{ "session_id": "uuid-here" }

Wallet Endpoints

GET/wallet/balances?wallet=WALLET_ADDRESS

Get all token balances for a wallet: SOL, ORE, USDC, current stORE, legacy stORE, SKR

💡 Tip: Use /account/me first to get the wallet address, then pass it here.

Response:

{
  "sol": 2.345,
  "ore": 12.7,
  "store": 5.0,
  "legacyStore": 0.25,
  "usdc": 50.0,
  "skr": 0.0
}
POST/wallet/send

Send SOL, ORE, USDC, stORE, or legacy stORE from the user's linked wallet. JWT, API key, and OAuth rsk_ grants can all call it.from must be a linked Solana wallet.to must be another linked Solana wallet or an address on the confirmed send allowlist. Sends have no default amount cap. `from` must be a linked Solana wallet, and `to` must be a linked wallet or a JWT-confirmed allowlist address. `WALLET_SEND_CAP_*` applies only when that variable is set. Every caller is limited to 5 sends per minute.

{
  "from": "YOUR_WALLET",
  "to": "DESTINATION_WALLET",
  "amount": 0.1,
  "token": "SOL"
}
GETPOSTDELETE/wallet/send-allowlist

Confirm or remove destinations that API keys and OAuth grants may send to. These routes accept a Privy user session only. API keys and OAuth grants receive 403. Adding an address in Settings → API Keys is the user's confirmation. The in-app Send button still asks the wallet to sign.

{ "address": "DESTINATION_WALLET", "label": "Treasury" }
POST/wallet/claim-sol/wallet/claim-ore

Claim to the authenticated user's primary wallet. An empty body is enough. Identity fields wallet_address, wallet, walletAddress, accountAddress, privyUserId, and privy_user_id are ignored. A destination field such as to is rejected. JWT, API key, and OAuth grants can call these routes.

GET/rewards?wallet=WALLET_ADDRESS

Get mining rewards summary: unclaimed SOL, unrefined ORE, bonus refined ORE

Round Endpoints

Round responses expose the exact distribution_mask, tile_distribution, solo_tile_indices, split_tile_indices, and winning_tile_type. Tile indices are 0-based (0-24). Distribution fields are null before the split/solo cutover at round 349213.

GET/rounds/current

Get current round info: round number, time remaining, total deployed SOL, motherlode size, EV estimate, tile stats

No authentication required — public endpoint

GET/rounds/live

Get live EV and price data from RoundMonitor (real-time, in-memory state)

GET/rounds/my-history?limit=50&offset=0

Get your personal mining round history with full deployment details: tiles used, amounts, results, winnings. Supports pagination and optional session_id filter.

Authenticated — returns only your rounds

GET/rounds/tile-stats?limit=100

Get hot and cold tile win statistics from the last N rounds. Shows which tiles have won the most/least — useful for hot/cold tile strategies.

No authentication required — public endpoint

GET/rounds/recent?limit=50

Get recent rounds history (default limit: 50)

GET/refinore-apr

Current refining APR on unrefined ORE (apr, trailing 7 days from the ORE treasury) and staking APY (stakingApy)

No authentication required — public endpoint

Strategy Endpoints

GET/auto-strategies

List all saved strategies

POST/auto-strategies

Create a new strategy

{
  "name": "My Strategy",
  "solAmount": 0.005,
  "numSquares": 25,
  "tileSelectionMode": "optimal",
  "riskTolerance": "less-risky",
  "miningToken": "SOL"
}

Supports optional strategyScript and strategyScriptEnabled fields for deterministic per-round custom scripts.

POST/auto-strategies/validate-script

Validate a deterministic custom strategy script before saving it. The backend probes external JSON sources, enforces timeouts, and returns exact path-based errors.

{
  "strategyScript": {
    "version": 1,
    "failureMode": "skip_round",
    "sources": [
      { "name": "prev", "type": "builtin", "resource": "previous_round" }
    ],
    "rules": [
      {
        "name": "Mirror 11-19",
        "when": {
          "op": "and",
          "args": [
            { "op": "gte", "args": [{ "op": "var", "path": "sources.prev.winningSquareNumber" }, 11] },
            { "op": "lte", "args": [{ "op": "var", "path": "sources.prev.winningSquareNumber" }, 19] }
          ]
        },
        "action": {
          "deploy": true,
          "numSquares": 1,
          "tileSelectionMode": "custom",
          "customTiles": [
            { "op": "sub", "args": [{ "op": "mod", "args": [{ "op": "var", "path": "sources.prev.winningSquareNumber" }, 10] }, 1] }
          ],
          "reason": "Play the single-digit mirror"
        }
      }
    ],
    "else": { "deploy": false, "reason": "No rule matched" }
  }
}

Built-in sources: current_round, previous_round, recent_rounds, market_prices, tile_stats, session_stats

Expression ops: var, and, or, gt, gte, lt, lte, add, sub, mul, div, mod, lastDigit, toTileIndex, if

Action fields: deploy, solAmount, numSquares, tileSelectionMode, customTiles, skipLastWinningSquare, miningToken, reason, optional swapAction

PUT/auto-strategies/:id

Update a strategy (full update — all fields required)

PATCH/auto-strategies/:id/live

Live-edit a strategy between rounds without stopping/starting the session. Only send the fields you want to change. Changes apply on the next deployment round automatically.

{
  "sol_amount": 0.02,
  "tile_selection_mode": "hot",
  "risk_tolerance": "risky"
}

Ideal for AI agents that dynamically adjust strategy mid-session based on motherlode size, EV, or tile data.

DELETE/auto-strategies/:id

Delete a strategy

POST/mining/start-strategy

Start mining using a saved strategy

{ "strategy_id": "uuid-here" }

Direct Token Swaps

Direct swaps use your embedded refinORE wallet and support every current token the platform currently supports: SOL, USDC, ORE, current stORE, and SKR. Legacy stORE is excluded from swaps; send or unshield it if needed, then migrate at https://ore.com/stake. Amounts are always specified in display units of the input_token.

POST/swaps/quote

Build a live Jupiter-backed quote without executing the trade.

{
  "input_token": "stORE",
  "output_token": "SOL",
  "amount": 2,
  "max_slippage_bps": 300
}
POST/swaps/execute

Quote and execute a direct token swap immediately using the authenticated user's wallet.

{
  "input_token": "stORE",
  "output_token": "SOL",
  "amount": 2,
  "max_slippage_bps": 300
}

Successful responses include quoted output, actual output, Jupiter request ID, signature, and a Solscan URL when available.

Swap Orders (DCA / Limit Orders)

GET/auto-swap-orders

List active swap orders

POST/auto-swap-orders

Create DCA or limit order

// DCA Example:
{
  "name": "Daily DCA",
  "order_type": "dca",
  "swap_type": "buy",
  "trigger_field": "round_number",
  "trigger_operator": "mod",
  "trigger_value": 1,
  "ore_amount": 5
}

// Limit Order Example:
{
  "name": "Buy ORE at $60",
  "order_type": "limit",
  "swap_type": "buy",
  "trigger_field": "ore_price_usd",
  "trigger_operator": "lt",
  "trigger_value": 60.00,
  "ore_amount": 1.0
}
DELETE/auto-swap-orders/:id

Cancel/delete an active swap order

GET/auto-swap-orders/history?limit=50

Get execution history for completed and partially-filled orders

Tile Presets

GET/tile-presets

List saved tile presets

POST/tile-presets

Save a tile preset

{ "name": "Diagonal", "tile_ids": [0, 6, 12, 18, 24] }

Staking

GET/staking/info?wallet=WALLET_ADDRESS

Get current stORE staking info: balance, APR (~22%), rewards earned, lifetime rewards. Legacy stORE must be migrated through https://ore.com/stake.

Server-Sent Events (SSE)

GET/sse/mining-logs

Real-time stream of mining events. More efficient than polling.

Headers required:

Accept: text/event-stream
x-api-key: rsk_your_key_here

Events:

• round_start — New round began
• round_end — Round completed with results
• deployment — SOL deployed on tiles
• claim — Rewards claimed
• balance_update — Wallet balance changed

Example: curl -N "$REFINORE_API_URL/sse/mining-logs" -H "x-api-key: $REFINORE_API_KEY" -H "Accept: text/event-stream"

Multi-Coin Mining

refinORE supports mining with multiple tokens. When you mine with USDC, ORE, stORE, or SKR, the backend automatically:

  • Swaps your token → SOL before deploying
  • Deploys SOL on the mining grid
  • Swaps rewards back → your original token after claiming

Perfect for stablecoin holders — mine with USDC and earn ORE without SOL price exposure!

🤖 Agent Onboarding Flow

Recommended flow for AI agents to onboard a human user and start mining:

1.
Human signs up

Direct them to automine.refinore.com to create account with email. Wallet is created automatically.

2.
Human creates API key

Settings → API Keys → Create. The human gives you the rsk_ key.

3.
Agent calls /account/me

Discovers wallet address, email, and deposit instructions.

4.
Agent checks /wallet/balances

Uses wallet address to check if the account is funded.

5.
If unfunded: prompt human to deposit

Show them the Solana wallet address + tell them to send SOL or USDC. Minimum: 0.005 SOL gas + mining amount.

6.
Agent calls /mining/start

Starts mining with the wallet address and desired config. The agent now mines autonomously.

7.
Monitor with /mining/session

Check session status, round results, and balances periodically.

Error Handling

200Success
400Bad Request — check your parameters
401Unauthorized — invalid or revoked API key
404Not Found — resource doesn't exist
409Conflict — e.g., active session already exists
429Rate Limited — slow down and retry
500Server Error — retry after 30s

Resources

OpenClaw / Clawdbot ore-miner Skill

github.com/JussCubs/ore-miner-skills →

Install: clawdhub install ore-miner

Agent Discovery

llms.txt — LLM-readable platform documentation

.well-known/ai-plugin.json — Plugin manifest

Resources

OpenClaw / Clawdbot ore-miner Skill

github.com/JussCubs/ore-miner-skills →

MCP Server

github.com/JussCubs/refinore-mcp →

Agent Discovery

llms.txt — LLM-readable platform documentation

.well-known/ai-plugin.json — Plugin manifest

refinORE API v2.0 — Built for humans and AI agents 🤖