Skip to main content
You do not need to be a programmer to start. An AI assistant can explain how the exchange works, write a script for you, and read live prices. This page takes you there in three steps. Each step adds one thing, and nothing on this page places an order.
Keep your API key out of every chat. A key can trade your balance. Never paste it into a prompt, a screenshot or a shared file. Put it in an environment variable, as shown in step 2. If a key leaks, revoke it at once on magicmarkets.com under Settings, then API.
AI assistants make mistakes. Check what they tell you against these docs, and read any code before you run it. You are responsible for every order your account places.

Step 1: Learn the concepts

You need no key and no install. Give the assistant the full API reference, then ask questions. The reference is one file: https://magicmarkets.com/llms-full.txt. Paste this into Claude, ChatGPT, Gemini or any other assistant:
If the assistant cannot open links, download the file and attach it. Every page on this site also has a menu at the top to copy the page, or to open it in ChatGPT or Claude. Questions to ask next:
  • What is a betslip, and why do I need one before an order?
  • What does a decimal price of 2.50 mean? How does it relate to a price in cents?
  • What is the difference between a for and an against bet type?
  • What is the tick schedule, and what happens if my price is not on it?
  • What happens to my open orders if my program crashes?
  • Why should every order carry a request_uuid?

Step 2: Write a first script

This script only reads. It checks your key, lists upcoming football matches, and shows the best price for each outcome of one match. You need:
  • An API key. Sign in at magicmarkets.com, go to Settings, then API, and click Add API Key. API access needs a minimum deposit of 10 USDT. See Authentication.
  • Python 3. Check with python3 --version.
1

Put the key in an environment variable

Run this in the terminal where you will run the script. Replace your-key with your key.
The variable lasts until you close that terminal.
2

Ask the assistant for the script

Or start from this version, which we tested against the live API:
first_look.py
3

Run it

You see your balance, five matches with their start times, then three lines such as for,h: 1.64 for up to 2.13 USDT. A price of 1.64 on for,h means a 1 USDT position on the home team returns 1.64 USDT if the home team wins.

Change it one step at a time

Ask for one change, run the script, then ask for the next. Good next prompts:
  • “Show only matches that start in the next 24 hours, sorted by start time.”
  • “Next to each price, print the price in cents: 100 divided by the decimal price.”
  • “Print home, draw and away for all five matches as one table.”
  • “Save the prices to a CSV file every 60 seconds for one hour. Stay well inside the rate limits in llms-full.txt.”
When something fails, paste the full error message back to the assistant. Remove your key from anything you paste.

Step 3: Connect an Agent to live markets

The Model Context Protocol (MCP) lets an assistant call MagicMarkets directly, so you can ask about live markets in plain language. You choose between two servers: For learning, the local server is the safer choice, because it cannot trade unless you switch trading on. The hosted server is quicker to set up.
In Claude on the web or desktop, open Settings, then Connectors, and add a custom connector with this URL:
Claude asks you to sign in with your MagicMarkets account.In Claude Code:
The hosted server gives the assistant trading tools from the start, and place_order spends real money. Set your client to ask before each tool call, and approve only tools that read.
Start each session with this prompt:
Then ask:
  • “List the football matches that start in the next three hours, with the best home, draw and away prices.”
  • “Show the full book for the first match, both sides, and explain what the depth tells me.”
  • “What is my balance, and how much is in open stakes?”
  • “Snap a price of 2.345 to the tick schedule and explain the result.”
  • “Check this bet type for me and explain when it wins: for,ah,h,-2.”

When you are ready to trade

There is no separate test environment. Every order is real and uses real USDT, so move slowly:
  1. Read Safety first: idempotent orders, heartbeats, and how limits are honoured.
  2. Follow Place an order in Python with the smallest amount the market accepts.
  3. Prefer tools that ask before they commit. The CLI asks for confirmation before each order, and the Claude skill examples run as a dry run unless you add --live.
  4. Ask the assistant to explain any code that places or closes orders before you run it.

Tips for better answers

  • Name the source. “Using llms-full.txt” keeps the assistant on the current API and away from guesses.
  • Say what it must not do. “Read only” and “never place an order” are worth repeating in every new chat.
  • Ask for one change at a time, and run the code between changes.
  • Ask it to explain. “Explain each line” teaches you the API as you go.
  • For Claude Code, install the Claude skill. It gives Claude the guide, the references and tested examples.