Developer docs

No API key. Connect in one line.

Everything below works without an account or key, built for BNB Hack Bangkok. Check a token with one request, or give your AI agent the guard in one line.

Step 1 · no key

Try it in 10 seconds

Paste this in a terminal. It checks TRX for a $1,000 buy on BNB Smart Chain and records the answer on chain.

Terminal
curl "https://guard.coingraph.ai/api/check?token=0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3&usd=1000"

Change token to any BNB Smart Chain contract address and usd to your order size (1 to 100,000). You get back proceed, caution or avoid, every reason, and a BscScan link to the record. Prefer clicking? Use the check box on the homepage.

Step 2 · no key, no sign-in

Connect your AI agent

The guard is an MCP server. Add it to your AI tool and it can check any token before it buys.

Claude Code

Terminal
claude mcp add --transport http coingraph-guard https://guard.coingraph.ai/mcp

Cursor, Windsurf, VS Code and other MCP clients

mcp.json
{
  "mcpServers": {
    "coingraph-guard": { "url": "https://guard.coingraph.ai/mcp" }
  }
}

Then just ask

Example:"Before buying, check $1,000 of CAKE on BNB Chain with coingraph-guard. Only buy if it says proceed."
ToolWhat it does
check_tokenChecks a token for an order size: buy and sell simulated on PancakeSwap, CoinMarketCap data, Atlas Oracle price, Cournot market risk, and what Living Brain remembers about the token. Returns the verdict with reasons and records it on BNB Smart Chain.
bnb_top50The 50 largest assets on BNB Chain with a verdict for each and their contract addresses.
token_memoryWhat CoinGraph remembers about a token from earlier checks, using Living Brain: past verdicts, reasons and their on-chain records.
market_riskCournot's current probability of a sharp BNB drop, with its evidence.
Step 3 · no key

Use it from code

Call the check before every buy, and stop unless it says proceed.

TypeScript
async function safeToBuy(token: string, usd: number) {
  const url = `https://guard.coingraph.ai/api/check?token=${token}&usd=${usd}`;
  const check = await (await fetch(url)).json();
  if (check.verdict !== "proceed") {
    console.log("Stopped:", check.findings[0].text);
    return false;
  }
  console.log("OK. Record:", check.proof?.explorer);
  return true;
}
Python
import requests

def safe_to_buy(token: str, usd: int) -> bool:
    check = requests.get("https://guard.coingraph.ai/api/check",
                         params={"token": token, "usd": usd}, timeout=120).json()
    if check["verdict"] != "proceed":
        print("Stopped:", check["findings"][0]["text"])
        return False
    return True

All free endpoints

EndpointReturns
GET /api/check?token=&usd=The full check for one token and order size, recorded on chain.
GET /api/boardBNB Chain top 50, each with a verdict for a $500 buy.
GET /api/top10The top 10 with full findings.
GET /api/market-riskCournot's probability of a sharp BNB drop, with evidence.
GET /api/proofsHow many answers are recorded on chain, and the cost.
POST /mcpThe MCP server (tools above).

All on https://guard.coingraph.ai.

On chain

Guard contract

The guard wraps a PancakeSwap v2 buy. It swaps only with a recent CoinGraph answer, signed for that exact agent, token and amount, that says proceed. Anything else reverts and the BNB stays in the wallet.

ContractAddress (BNB Smart Chain mainnet)
CoinGraphGuard0x7f914975c2af57253a707fb2c2e44776dc45000b
CoinGraphGuardAtlas0xf86e3867cee19d56cacfb704dabb1b138af8b0ed · also verifies Atlas Oracle's signed price in the same transaction
ProofLog0x186ef344dcd0dd74d292a5d2b4433d77e19f5f7d · every answer recorded before the trade
Solidity
struct Answer {
  address agent;        // who may use this answer
  address token;        // the token that was checked
  uint256 maxAmountIn;  // largest BNB amount (wei) it covers
  uint8   verdict;      // 1 proceed, 2 caution, 3 avoid
  uint64  issuedAt;     // valid for 5 minutes, once
  bytes32 evidenceHash; // keccak256 of the full check
}

function buy(Answer calldata a, bytes calldata sig,
             uint256 amountOutMin, address[] calldata path,
             uint256 deadline) external payable;

Why a buy reverts

ErrorMeaning
NotProceedThe answer says caution or avoid.
OracleDeviationThe pool price is too far from Atlas Oracle's signed price (Atlas guard).
AmountTooLargeMore BNB than the answer covers.
AnswerExpired / AnswerUsedOlder than 5 minutes, or already used.
NotYourAnswer / WrongToken / WrongSignerSigned for another agent or token, or not by CoinGraph.
Using the guard with your own agent:signed answers are issued for your agent's wallet address. During the hackathon this is set up per team: open an issue on GitHub or email support@coingraph.ai.
Reference

Reading a response

GET /api/check (shortened)
{
  "symbol": "TRX",
  "orderUsd": 1000,
  "verdict": "proceed",              // proceed | caution | avoid
  "findings": [                      // worst first, each with level and text
    { "level": "ok", "check": "oracle_price",
      "text": "PancakeSwap price $0.303 vs Atlas Oracle TRX/USD $0.303: 0.13% apart." }
  ],
  "numbers": { "liquidityUsd": 276454, "priceImpactPct": 0.73, "atlas": { … }, "cournot": { … } },
  "proof": { "recorded": true, "txHash": "0x…", "evidenceHash": "0x…", "explorer": "https://bscscan.com/tx/0x…" }
}

Treat anything other than proceed as a stop. A finding the check could not measure is never assumed safe.

Reference

Limits

SurfaceKeyLimit
Guard API and MCPNone12 checks per minute per connection
Board, Top 10, market riskNoneCached, refreshed in the background
Reference

Verify an answer

Every response includes proof.page (a page for that transaction) and proof.raw (the exact JSON whose hash is on chain). Open guard.coingraph.ai/proof, paste any transaction, and your browser recomputes the hash and matches it to the ProofLog event.

Terminal
curl -s https://guard.coingraph.ai/api/proof/<txHash>          # the on-chain record
curl -s https://guard.coingraph.ai/api/evidence/<evidenceHash> # the exact raw output
Optional · free CoinGraph account

More with a CoinGraph key

You don't need this for the hackathon. With a free account, the wider CoinGraph platform adds the top 1,000 tokens on every chain, sized checks with your own rules, and five ready-made agents (Trade Gatekeeper, Wallet Guard, Due Diligence Analyst, Portfolio Checkup, Daily Market Brief).

  1. Get a key at coingraph.ai/account/keys (Google or email). New accounts get 500 free credits.
  2. Call the API with it:
curl
curl -X POST https://coingraph.ai/api/v1/evaluate \
  -H "Authorization: Bearer $COINGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{"token": "chainlink", "size_usd": 1000}'

Full reference: coingraph.ai/docs · agents playground: coingraph.ai/agents.