← For AI agents
QUICKSTART · FOR AGENTS AND BUILDERS

Read Coil from your agent in a few lines.

Three ways in, from least to most commitment: a free MCP connection, a free key, or pay per read over x402 with a wallet. Working code for Python, TypeScript and curl, and the one table that says which endpoint answers which question.

x402 · MCP · no account needed to start

Coil sells a scored stock-market board to AI agents, pay per read over x402 or over MCP. This page is the shortest route to a working call. The code below was run against Coil’s live 402 response with the packages named, up to the signed retry; a real retry moves USDC on-chain, so it is yours to run with a wallet you fund.

Pick a path

  • Free MCP, no key. A sample of the board, one market day delayed. Connect over MCP.
  • Free key or wallet sign-in. A small daily allowance of live reads on the cheap slices. Get a key.
  • Pay per read over x402. No account, no key: a wallet with USDC. Pay per read.
  • A flat subscription. Coil Live gives your agent the full live feed over MCP.

Pay per read over x402

A paid route answers a GET with HTTP 402 and a PAYMENT-REQUIRED header. Your x402 client signs one of the listed payment options and repeats the request with a PAYMENT-SIGNATURE header; the second response is the data. One signed payment buys one read. Payment is USDC on Base, Solana or Algorand, and the signature is an authorization, so the wallet does not need the chain’s gas token. Set a spend cap in your client to the most you are willing to pay per call.

If the wallet holds no USDC on the chain the client chose, the retry does not return data. It comes back as another 402 whose body carries "error": "invalid_payload" and an error_help field that explains it: the simulated transfer reverted, which usually means no USDC on that chain. A wallet that is short of funds can instead be refused with an insufficient-funds or simulation_failed error, whose error_help says the payment could not settle, usually an unfunded wallet on that chain. Either way: fund it, pick another chain from accepts, or sign in with the same wallet for the free tier (see the free key section below).

Python

The x402 package on PyPI (Python 3.10 or newer). It also ships an async httpx client, x402HttpxClient.

pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# A wallet holding a little USDC on Base. The key stays in your environment.
signer = EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"]))
client = x402ClientSync()
register_exact_evm_client(client, signer)

session = x402_requests(client)          # a requests.Session that pays 402s
resp = session.get("https://coil.trade/api/crypto/gate")
print(resp.status_code)
print(resp.json())

TypeScript

@x402/fetch wraps the global fetch. Run it as an ES module, for example with npx tsx.

npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A wallet holding a little USDC on Base. The key stays in your environment.
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);

const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:*", client: new ExactEvmScheme(account) }],
});

const res = await fetchWithPayment("https://coil.trade/api/crypto/gate");
console.log(res.status);
console.log(await res.json());

curl

curl shows the protocol, and stops where a wallet has to sign. The crypto gate is the cheapest read Coil sells.

# 1. Ask with no payment header. The answer is HTTP 402.
curl -si https://coil.trade/api/crypto/gate | head -n 1

# 2. Read what it wants. PAYMENT-REQUIRED is base64 JSON (x402 v2): accepts[] lists each chain.
curl -si https://coil.trade/api/crypto/gate \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 -d | jq '.accepts[0]'

# 3. Sign one accepts[] entry with your wallet (the clients above do this for you),
#    then repeat the request with the signed payload, base64-encoded, in PAYMENT-SIGNATURE.
curl -s https://coil.trade/api/crypto/gate -H "PAYMENT-SIGNATURE: $SIGNED_PAYLOAD"

Checked against the live service on 2026-10-25 with x402 2.25 (PyPI) and @x402/fetch 2.28 (npm). Client packages move quickly; if a call differs, the package’s own README wins over this page.

Connect over MCP

The free MCP server needs no key and no account. It returns a sample of the board (the top three names per book, headline fields), one market day delayed.

Claude Code

claude mcp add --transport http coil https://mcp.coil.trade/mcp

Or commit it to a project’s .mcp.json:

{
  "mcpServers": {
    "coil": {
      "type": "http",
      "url": "https://mcp.coil.trade/mcp"
    }
  }
}

Claude Desktop and claude.ai

Open Customize, then Connectors, choose Add, then Add custom connector, name it Coil and paste https://mcp.coil.trade/mcp. The steps follow Anthropic’s custom connector guide, which is the authority if the menu names change. Coil is also listed in the Claude connector directory; its free tools work there with no sign-in.

First calls: get_morning_brief for the whole market in one read, or get_market_regime, then get_buy_list. To use a free key inside MCP, add it as a header:

claude mcp add --transport http coil https://mcp.coil.trade/mcp --header "X-Coil-Key: coilfree_..."

The key unlocks the live versions of three tools: get_market_regime_live, get_hold_state_live and get_crypto_night_live.

A free key, or sign in with a wallet

One POST mints a key, with no password. The response states the daily allowance and which reads it covers.

curl -X POST https://coil.trade/api/key \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@yourdomain.dev"}'

# the response carries "key": "coilfree_...". Send it on a read:
curl https://coil.trade/api/board/regime -H "X-Coil-Key: coilfree_..."

No email? Every 402 declares a sign-in-with-x extension: sign the message it carries with your wallet (the signature proves control of the address and moves no funds) and send it as the SIGN-IN-WITH-X header. That gives the same free tier. The full flow is in auth.md.

Which endpoint for which question

All paths are on https://coil.trade. The paths and prices in this table are read from the same registry the 402 itself quotes, so they cannot drift from what you will be asked to pay.

Your agent asksEndpointPrice per read
Is the stock market worth trading right now?GET /api/board/regime$0.005
What is the whole market read in one call?GET /api/board/brief$0.05
Which stocks are set up to buy today?GET /api/board/buylist$0.05
How strong is this ticker, or my watchlist?GET /api/board/name?sym=NVDA$0.005
Is the trend behind a position I hold still intact?GET /api/board/hold?sym=NVDA$0.005
Which stocks are leading the tape?GET /api/board/leaders$0.01
Which sectors is money rotating into?GET /api/board/rotation$0.005
What changed since my last read?GET /api/board/diff?since=<state_hash>$0.01
Is crypto risk-on right now?GET /api/crypto/gate$0.001
What does the 24/7 crypto board look like?GET /api/crypto/day$0.005
I want everything in one payload.GET /api/board/agent$0.25
What did Coil publish on a past date?GET /api/board/asof$0.05

The free reads to try first are /api/board/free, /api/board/status and the change-detection hash at /api/board/state, which is free to poll: buy a paid read only when the hash changes. The full catalogue is on /agents, in openapi.json and at /.well-known/x402.

Where to go next

Impersonal research publication. Everything Coil publishes is identical for every reader: scores and states about stocks, never individualized advice and never a recommendation to buy or sell a particular security for you. Markets can lose money, and an agent that acts on a score can lose it faster. Coil never sends orders and never sees your wallet key or your brokerage account. See the terms and the disclosures.