Welcome to Agents Academy

Module 03 · Agent basics · ~5 min

Crash course.

By the end of this module, your agent has the basic vocabulary to talk to Limitless, enough to ask which markets are open and what positions it’s holding. The minimum surface area to wire the exchange as something an LLM can reach for.

To get there, you’ll cover just enough Limitless API to wire it as agent tools. Ten minutes, no fluff. Every later module assumes you can talk to Limitless from both TypeScript and Python.

Agent basics tier · Reference card

New here? Install Node or Python, mint a Limitless key + an LLM provider key, and drop them into a .env before you dive in, Setup Guide →

Quick answer

How does an AI agent talk to the Limitless API?

Four things cover the surface: every request hits https://api.limitless.exchange (no version prefix); auth is HMAC via three headers the SDK signs for you; endpoints split into three families (/markets/*, /portfolio/*, /orders/*); and both SDKs share one shape, an HttpClient passed to Fetcher classes. You set the scoped HMAC token, LMTS_TOKEN_ID (the token id) and LMTS_TOKEN_SECRET (base64), in your environment; the SDK auto-loads both, signs each request with HMAC-SHA256, and emits lmts-api-key, lmts-timestamp, and lmts-signature; the legacy LIMITLESS_API_KEY still works. Wallet signing is a separate step needed only when placing orders, and the SDK handles it internally too. The crash course then runs two reads, active markets and your own portfolio, in both TypeScript and Python: exactly the surface area Module 04 wraps as your agent’s first tools.

Foundational facts verified 2026-06-10; the crash-course code is illustrative by design.

Authenticated calls carry the three HMAC headers (lmts-api-key + lmts-timestamp + lmts-signature); the legacy X-API-Key is deprecated. Full scheme in API Academy Module 03.

Section 01

The four things you need to know.

Before you write a line of agent code, internalize four things about the Limitless API: where to point requests, how auth works, what endpoint families exist, and how the SDKs are shaped. Get these wrong and every later module breaks. Read the card below once, then come back whenever you wire a new tool, these four pieces predict every import path and method name you’ll see in the rest of this academy.

A. Base URL

Every request hits https://api.limitless.exchange. No version prefix in the path.

B. Auth = HMAC, three headers

Set LMTS_TOKEN_ID (token id) and LMTS_TOKEN_SECRET (base64) in your environment; the legacy LIMITLESS_API_KEY still works. The SDK auto-loads the token, then signs every request with HMAC-SHA256 and emits lmts-api-key, lmts-timestamp, and lmts-signature. Wallet signing is a separate step, only required for placing orders, the SDK handles it internally too. Canonical scheme: docs.limitless.exchange/developers/authentication.

C. Three endpoint families

  • /markets/*, discover markets, read prices, read orderbooks
  • /portfolio/*, your positions, fills, profile
  • /orders/*, place, cancel, manage

D. SDK shape

Both TypeScript and Python SDKs follow the same pattern: an HttpClient + a set of Fetcher classes (MarketFetcher, PortfolioFetcher, …). You construct one client and pass it to as many fetchers as you need.

Section 02

Install & first read.

Install the SDK, construct an HttpClient, and fetch the active markets list. This is the call your agent will use to “browse” Limitless before deciding what to trade.

How to run this

  1. Set LIMITLESS_API_KEY in your environment, or drop it into a .env file in the same folder as your script.
  2. Save as browse-markets.ts, then run npx tsx browse-markets.ts.
  3. Ten market slugs and titles print to your terminal, newest first, the exact payload your browse_markets tool will return in Module 04.
// Module 03: Install & First Read
// Browse the active markets on Limitless.
//
// $ npm install @limitless-exchange/sdk

import { HttpClient, MarketFetcher } from '@limitless-exchange/sdk';

const httpClient = new HttpClient({
  baseURL: 'https://api.limitless.exchange',
  apiKey:  process.env.LIMITLESS_API_KEY,
});

async function browseMarkets() {
  const marketFetcher = new MarketFetcher(httpClient);

  const markets = await marketFetcher.getActiveMarkets({
    limit:  10,
    sortBy: 'newest',
  });

  for (const market of markets) {
    console.log(market.slug, ',', market.title);
  }
}

browseMarkets().catch(console.error);

If market titles print, your SDK install is healthy. This call will become your agent’s browse_markets tool in Module 04.

Section 03

Read your portfolio.

The other primitive your agent absolutely needs: knowing what it owns. PortfolioFetcher.getPositions() returns the agent’s open CLOB and AMM positions, current points balance, and reward state. Wire this as a get_my_positions tool and the agent can reason about its own book before placing new trades.

// Module 03: Read Your Portfolio
// Fetch your own positions (CLOB + AMM) so the agent knows what it owns.

import { HttpClient, PortfolioFetcher } from '@limitless-exchange/sdk';

const httpClient = new HttpClient({
  baseURL: 'https://api.limitless.exchange',
  apiKey:  process.env.LIMITLESS_API_KEY,
});

async function getMyPortfolio() {
  const portfolio = new PortfolioFetcher(httpClient);
  const positions = await portfolio.getPositions();

  console.log('Points:', positions.points);
  console.log('CLOB positions:', positions.clob.length);
  console.log('AMM positions: ', positions.amm.length);

  for (const pos of positions.clob) {
    console.log('•', pos.market.title);
  }
}

getMyPortfolio().catch(console.error);

How to run this

  1. Keep LIMITLESS_API_KEY set from Section 02, this endpoint is authenticated and reads your own account.
  2. Save as get-my-positions.ts, then run npx tsx get-my-positions.ts.
  3. Your point total, CLOB count, and AMM count print to the terminal. Zero counts are fine, the agent’s book is simply empty, and Module 04 will still wire this as a tool.

Together with the markets fetch, you now have the two reads every agent needs: browse_markets for what’s tradeable, get_my_positions for what you already own. Module 04 wraps both as LLM-callable tools.

Section 04

Where to go next.

The crash course deliberately stopped short of the long tail: order placement internals, websockets, error handling, backtesting, market making. Agents Academy assumes you’ll wire most of those through the CLI tools in Modules 07–10, not by writing raw SDK code. But if you want depth on any one topic, the parallel track exists, every callout below is a soft prerequisite, optional but recommended.

Take API Academy first if you want depth, but you can keep going with Agents Academy without it. The next module (Tool Use 101) only assumes what’s in this crash course.

Common questions

Limitless API for agents: what people ask

Each answer also ships invisibly as schema.org FAQ data for search engines and AI assistants. Tap a question to expand.

  1. How does Limitless authenticate an agent’s API calls?
    Via HMAC. Set LMTS_TOKEN_ID (the token id) and LMTS_TOKEN_SECRET (the base64 secret) in your environment; the SDK auto-loads both, signs every request with HMAC-SHA256, and emits the lmts-api-key, lmts-timestamp, and lmts-signature headers. The legacy X-API-Key header is deprecated, though the legacy LIMITLESS_API_KEY env var still works. Wallet signing is a separate step the SDK also handles internally, required only when you place an order.
  2. Which SDK packages does a Limitless agent install?
    npm install @limitless-exchange/sdk for TypeScript or pip install limitless-sdk for Python. Both follow the same pattern: construct one HttpClient and pass it to as many Fetcher classes as you need (MarketFetcher, PortfolioFetcher, and so on). That shape predicts every import path and method name you will see in the rest of the academy.
  3. What are the three Limitless endpoint families?
    /markets/* to discover markets and read prices and orderbooks, /portfolio/* for your positions, fills, and profile, and /orders/* to place, cancel, and manage orders. All of them sit on the base URL https://api.limitless.exchange, with no version prefix in the path.
  4. What two reads does every trading agent need first?
    Browsing markets and reading its own book. MarketFetcher.getActiveMarkets() lists what is tradeable and becomes the browse_markets tool; PortfolioFetcher.getPositions() returns the agent’s open CLOB and AMM positions, points balance, and reward state, and becomes get_my_positions. With those two, the agent can reason about its own book before placing new trades; Module 04 wraps both as LLM-callable tools.
  5. Do you need the full API Academy before building an agent?
    No. The 10-minute crash course is deliberately enough to follow the rest of Agents Academy, which wires most depth through CLI tools in Modules 07–10 rather than raw SDK code. The parallel track is optional but recommended: API Academy Module 05 for order placement internals, 07 for real-time streams, 10 for error handling and retries, 12 for backtesting, 15 for market making.

Module checklist

Five quick confirmations.

Tick each item once you’ve actually done it. The Continue button unlocks at 5/5.

Module 03 complete

Limitless on the wire.

Your agent now knows there’s an exchange out there. When the LLM decides “I need to know what markets are active,” the answer is one tool call away, not a paragraph of context you wrote in the system prompt and have to keep refreshing.

Concretely, you can talk to Limitless from both languages. Two reads, one mental map of the surface area, and a sense of what to skip until the API Academy track if you ever need depth.

01

A mental map of the Limitless API surface, base URL, one-header auth, and the three endpoint families (/markets, /portfolio, /orders) your agent will reach for.

02

A working HttpClient + MarketFetcher / PortfolioFetcher install in TypeScript or Python, with LIMITLESS_API_KEY loaded from your environment.

03

Two runnable read calls, browseMarkets and getMyPortfolio, that become the agent’s first two tools in Module 04.

Next up: how LLM tool use actually works, schemas, function-calling, and wrapping these two reads as LLM-callable skills.

Complete the checklist above to unlock