developer api · v1.1

Copy-trade Polymarket from any agent, script, or app.

PolyZig exposes a full REST API and a first-party Model Context Protocol server. Mint a scoped pzk_* key from your dashboard, point Claude Desktop or Cursor at /api/mcp, and your agent can discover top traders, start copy configs, monitor PnL, and place orders — with sub-500ms execution.

Built for autonomous agents

Scoped, revocable credentials

Mint API keys from the dashboard with explicit scopes (read:positions, trade:execute, …). Deny-by-default — a handler that lacks scope coverage is unreachable. Revoke any key independently of your account password.

Idempotency on trading writes

Set Idempotency-Key on a trading POST (claim, sell, market order, withdraw, copy-config changes) and we cache the response for 24h — a retried claim or sell on a network blip never double-fires. Two routes deliberately opt out: POST /keys (the one-time secret must not be cached) and POST /mcp (JSON-RPC errors travel in 200 envelopes). See AGENTS.md for the full contract.

Machine-first contracts

Every error has a stable code. Pagination metadata in response headers. Money serialized as decimal strings (*_dec mirror fields). OpenAPI 3.1 spec published at /openapi.json and Swagger UI at /api/docs.

Quick start

1. Mint a key

Sign in, visit /dashboard/keys, and create a key with the scopes your agent needs. The secret is shown once.

2. Verify with curl

bash
curl https://api.polyzig.com/api/users/me \
  -H "Authorization: Bearer pzk_live_..."

3. Start mirroring a trader

Always set paper_trading: true on the first run for any new target — watch a session, check PnL, then promote.

bash
# Create a paper-trading copy config for a target wallet
curl -X POST https://api.polyzig.com/api/configs \
  -H "Authorization: Bearer pzk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "target_address": "0xWHALE_ADDRESS",
    "target_name":    "polymarket-whale",
    "size_multiplier": "0.1",
    "paper_trading":   true
  }'

Or skip curl — use MCP

Drop this into Claude Desktop's claude_desktop_config.json (or Cursor's equivalent). Your agent gets the full tool catalogue, scoped to what your key allows.

claude_desktop_config.json
{
  "mcpServers": {
    "polyzig": {
      "type": "http",
      "url": "https://api.polyzig.com/api/mcp",
      "headers": {
        "Authorization": "Bearer pzk_live_..."
      }
    }
  }
}
Auto-discovery

Clients that consult /.well-known/mcp.json pick up the endpoint, transport, and scope list automatically.

Scopes

Default to the minimum scopes your agent needs. A monitoring agent should not have trade:execute; a copy-trading agent should not have wallet:write.

ScopeGrants
read:accountProfile, balance, PnL summary
read:positionsOpen + paper positions
read:tradesTrade history and fills
read:marketsMarket search, open orders, leaderboard data
trade:executePlace orders; create + start + stop copy configs
trade:cancelCancel resting CLOB orders
wallet:writeClaim resolved positions, withdraw, wrap-to-pUSD

MCP tool catalogue

19 first-party tools. The MCP server returns only the subset your key's scopes permit — so an agent doing read-only monitoring doesn't even see the write tools.

Discovery

  • get_platform_stats
    Median/p95 execution latency, recent fill volume.
  • search_marketsread:markets
    Full-text search across Polymarket markets.

Read your state

  • list_open_positionsread:positions
    On-chain Polymarket positions with PnL.
  • list_paper_positionsread:positions
    Paper-trading positions — no real funds.
  • list_tradesread:trades
    Fill history with detection + execution latency.
  • get_user_summaryread:account
    Lifetime trade count + fees paid.

Manage copy configs

  • list_copy_configsread:account
    Every wallet you’re currently copying.
  • get_copy_configread:account
    Single config detail.
  • get_config_pnlread:account
    PnL breakdown for one config.
  • get_config_tradesread:trades
    Trades attributed to one config.
  • suggest_multiplierread:markets
    Recommended sizing for the user’s balance.
  • create_copy_configtrade:execute
    Start mirroring a target wallet.
  • start_copyingtrade:execute
    Activate a copy config.
  • stop_copyingtrade:execute
    Deactivate (positions stay open).
  • delete_copy_configtrade:execute
    Permanent delete.

Direct trading

  • place_market_ordertrade:execute
    Market buy/sell on a Polymarket outcome.
  • list_open_ordersread:markets
    Resting CLOB orders.
  • cancel_ordertrade:cancel
    Cancel a single order by ID.
  • claim_positionswallet:write
    Redeem resolved positions on-chain.

Ready to build?

Sign in and mint your first key in under a minute. Start with read:* scopes — promote to write access once you trust the agent loop.

Open the API keys dashboard