Skip to content

Your First Trade

This guide walks you through signing up for Bankr, connecting to the Agent API, and executing your very first token swap. By the end, you will have authenticated, submitted prompts, polled for results, and completed a real trade on Base.

  1. Sign up at bankr.bot

    Go to bankr.bot and click Sign In. Enter your email address. You will receive a one-time password (OTP) — check your inbox, enter the code, and you are in. No seed phrases, no wallet setup. Bankr provisions a cross-chain wallet for you automatically via Privy.

  2. Create an API key

    Navigate to bankr.bot/api and click Create New API Key. Make sure Agent API access is enabled. Your key will look like bk_xxxxxxxxxxxxxxxx. Copy it immediately — you will not be able to see it again.

    Store your API key securely. Never commit it to a public repository or share it in plain text.

  3. Check your balance

    Now let’s verify your connection works. Submit a prompt to check your ETH balance on Base:

    Check your balance
    curl -X POST https://api.bankr.bot/agent/prompt \
    -H "X-API-Key: bk_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{"prompt": "What is my ETH balance on Base?"}'

    You will receive a response with a jobId:

    Response
    {
    "jobId": "job_abc123def456",
    "status": "pending"
    }

    Now poll for the result using that jobId:

    Poll for result
    curl -X GET https://api.bankr.bot/agent/prompt/job_abc123def456 \
    -H "X-API-Key: bk_YOUR_KEY"

    Once the job completes, you will see your balance:

    Completed response
    {
    "jobId": "job_abc123def456",
    "status": "completed",
    "response": "Your ETH balance on Base is 0.05 ETH (~$162.35)."
    }
  4. Check a token price

    Same pattern — submit a prompt, then poll. Let’s check the price of USDC:

    Check a token price
    curl -X POST https://api.bankr.bot/agent/prompt \
    -H "X-API-Key: bk_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{"prompt": "What is the price of USDC on Base?"}'

    Poll with the returned jobId:

    Poll for price
    curl -X GET https://api.bankr.bot/agent/prompt/job_xyz789 \
    -H "X-API-Key: bk_YOUR_KEY"

    Expected response:

    Completed response
    {
    "jobId": "job_xyz789",
    "status": "completed",
    "response": "USDC on Base is currently $1.00."
    }
  5. Make a small swap

    Time for a real trade. Start with a very small amount — 0.001 ETH is about $3. This keeps your risk minimal while you learn the flow.

    Execute a swap
    curl -X POST https://api.bankr.bot/agent/prompt \
    -H "X-API-Key: bk_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{"prompt": "Swap 0.001 ETH for USDC on Base"}'
    Response
    {
    "jobId": "job_swap_001",
    "status": "pending"
    }
  6. Poll for the swap result

    Poll for swap result
    curl -X GET https://api.bankr.bot/agent/prompt/job_swap_001 \
    -H "X-API-Key: bk_YOUR_KEY"

    When the swap completes, you will see the transaction details:

    Completed swap response
    {
    "jobId": "job_swap_001",
    "status": "completed",
    "response": "Swapped 0.001 ETH for 3.24 USDC on Base. Transaction: 0x1a2b3c...d4e5f6"
    }

    You can verify the transaction on BaseScan using the transaction hash.

  7. Verify in your portfolio

    Finally, confirm the swap went through by checking your full portfolio:

    Check portfolio
    curl -X POST https://api.bankr.bot/agent/prompt \
    -H "X-API-Key: bk_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{"prompt": "Show my portfolio on Base"}'

    Poll the result:

    Poll for portfolio
    curl -X GET https://api.bankr.bot/agent/prompt/job_portfolio_001 \
    -H "X-API-Key: bk_YOUR_KEY"
    Portfolio response
    {
    "jobId": "job_portfolio_001",
    "status": "completed",
    "response": "Your portfolio on Base:\n- 0.049 ETH (~$158.95)\n- 3.24 USDC (~$3.24)\nTotal: ~$162.19"
    }

In this tutorial, you completed the full Bankr workflow:

  • Authentication — Creating an API key and authenticating requests with X-API-Key
  • Prompt submission — Sending natural language prompts to the Agent API
  • Job polling — Checking the status of async jobs until they complete
  • Executing a trade — Making a real token swap on Base through the API

This is the same pattern you will use for everything in Bankr: submit a prompt, get a job ID, poll for the result. Whether you are checking balances, launching tokens, or claiming fees, the flow is identical.