# Tragent > Tragent is a personal trading agent for people (tragent.fyi), and two things for other agents, with no sign-up: a pay-per-answer API (research: one question about token prices or on-chain activity, answered with live data), and an account of the agent's own (its own Tragent to research, decide and trade with, and its own wallet on Base). Both are paid for over HTTP, in USDC on Base (x402) or by card through a Link wallet (Machine Payments Protocol). ## Index - Ask, pay per answer: `POST https://tragent.fyi/api/v1/x402/ask` in USDC, or `POST https://tragent.fyi/api/v1/mpp/ask` by card. See "The API". - An account of the agent's own: `POST https://tragent.fyi/api/v1/x402/plan` in USDC, or `POST https://tragent.fyi/api/v1/mpp/plan` by card; then its key from `POST https://tragent.fyi/api/v1/agent/keys`, and `https://tragent.fyi/api/v1/agent/*` with it. See "An account of the agent's own". - MCP server: `https://tragent.fyi/mcp` with the account's key; server card `https://tragent.fyi/mcp/server-card`; in the official MCP Registry as `fyi.tragent/tragent`. See "MCP". - The HTTP API, every route with its price: `https://tragent.fyi/openapi.json`. For people: `https://tragent.fyi/developers`. - Listed on: the official MCP Registry, x402scan and MPPScan. ## The API - Pay in USDC: `POST https://tragent.fyi/api/v1/x402/ask`, 0.25 USD an answer, x402 version 2, scheme `exact`, USDC on Base (`eip155:8453`, token `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`). Any x402 version 2 client can pay it; the payer needs no gas. - Pay by card: `POST https://tragent.fyi/api/v1/mpp/ask`, 0.50 USD an answer by card, Machine Payments Protocol, method `stripe`, intent `charge`. `link-cli mpp pay` can pay it from a Link wallet. - Body, on both: `{"question": "<1 to 2,000 characters>"}` and nothing else. Put the coin, contract address, wallet address or time frame in the question. - Answer, on both: `{"id", "answer" (Markdown), "sources": [{"label"}], "asOf"}`, in about 5 to 20 seconds. ## How to pay in USDC (x402) 1. Send the request with no payment. The reply is `402` with a `PAYMENT-REQUIRED` header (base64 JSON: amount, token, pay-to address, `maxTimeoutSeconds`). 2. Sign one `TransferWithAuthorization` (EIP-3009) for exactly that amount, valid for `maxTimeoutSeconds`. 3. Send the same request with the signed payment, base64 JSON, in a `PAYMENT-SIGNATURE` header. 4. The answer comes back as `200` with a `PAYMENT-RESPONSE` header naming the transaction. With the official client: `wrapFetchWithPayment(fetch, client)` from `@x402/fetch`, with `ExactEvmScheme` from `@x402/evm/exact/client` registered for `eip155:*`. ## How to pay by card (Machine Payments Protocol) 1. Send the request with no payment. The reply is `402` with a `WWW-Authenticate: Payment` header: the challenge (method `stripe`, intent `charge`, amount in cents, currency, the seller's profile, five minutes to pay). 2. Get a one-time payment token from the wallet for that amount and that seller. 3. Send the same request with `Authorization: Payment `: the challenge echoed, with the token. 4. The answer comes back as `200` with a `Payment-Receipt` header naming the payment. With link-cli, signed in to a Link wallet, one command does all four steps and asks the wallet's owner to approve: ``` link-cli mpp pay https://tragent.fyi/api/v1/mpp/ask -X POST -d '{"question": "..."}' --context "" ``` A payment token is good for one purchase. To retry after a time-out or a `503`, send the same request again with the same payment: the token is recognised and never charged twice. With link-cli, run the command again with `--spend-request-id ` (the id `link-cli spend-request list` shows). If Link will not let that purchase pay again, start a new one: a request that could not be answered is never charged (the hold is released within the hour; a card charged when you paid is refunded). ## What it covers - Live and past token prices. - On-chain activity: transfers, swaps, large holders, wallet balances and positions. - DEX markets: pairs, liquidity, volume, trending tokens. Not covered yet: news, macro data, derivatives. It is research, not financial advice. It cannot see or act on any account and does not place trades. ## Rules worth knowing - You pay only for a delivered answer. A refused or failed request is not charged, or is refunded if its payment was already collected. - By card, the amount is held when you pay and charged only when the answer is ready. If the request cannot be answered the hold is released. A payment that cannot be held first (its payment method does not allow it, or payments are not being held at that time) is charged when you pay, and refunded if the request cannot be answered. - A retry of the same question from the same wallet, or with the same payment token, within ten minutes gets the same answer and is not charged again. - `503` with code `settlement_pending` or `payment_check_unavailable` means the payment is being confirmed: wait `Retry-After` seconds and send the same request again. Do not pay again. - A payment is good for one question (`409 payment_reused` otherwise), and returns its answer for 15 minutes after it was first sent (`410 answer_expired` after that). - Up to 20 paid requests a minute from one wallet, and up to 10 new card payments a minute from one network address. After three card payments from one address are refused or cannot be answered, new ones from it are slowed to one a minute for ten minutes. ## An account of the agent's own For an agent that acts: its own Tragent (which researches, decides and trades on Base), its own wallet, and an API. 20.00 USD for 30 days, and 1,000 credits with each purchase. No person signs in and nobody approves its trades; it runs within the account's rules. 1. Make a P-256 key pair and keep the private half. Its public half, base64 SPKI DER, is the `ownerKey`: it owns the account and its wallet, signs the requests that issue API keys, and alone can export the wallet's key. It cannot be recovered if lost. 2. Buy: `POST https://tragent.fyi/api/v1/x402/plan` (USDC, paid first) or `POST https://tragent.fyi/api/v1/mpp/plan` (card, charged when you pay), body `{"ownerKey": "...", "sendTo": "0x..."}`. `sendTo` is the one address on Base money may ever leave the wallet to, fixed for good; in USDC it defaults to the paying wallet, by card it is required. Pay the `402` exactly as for an answer. 3. The reply: `{"id", "account": "agt_...", "wallet": {"address", "network": "base"}, "sendTo", "plan": {"status", "endsAt"}, "credits": {"left"}, "next", "asOf"}`. The same payment again returns the same account. Fund the wallet with USDC or ETH on Base. 4. Get an API key: sign the UTF-8 text `tragent-agent-key-v1\n\n\n` with the owner key (ECDSA P-256 over SHA-256, DER, base64; nonce 16 to 64 of `A-Za-z0-9_-`; expiry at most ten minutes ahead) and `POST https://tragent.fyi/api/v1/agent/keys` with `{"account", "nonce", "expiresAtMs", "signature"}`. The reply `{"key": "tgk_...", "account"}` is shown once; a new key replaces the earlier one. 5. With `Authorization: Bearer tgk_...`: - `GET /api/v1/agent/account`: plan, credits left, wallet and holdings, recent activity. - `POST /api/v1/agent/ask` `{"message", "clientMessageId", "session"?}`: one message to its Tragent, one JSON reply `{"message": {"text", "sources"}, "actions": [{"id", "status", "summary"?, "reason"?}]}`. Ask it to research, to decide, or to trade. The same `clientMessageId` returns the same reply and never runs twice. - `POST /api/v1/agent/withdraw` `{"token", "amount", "requestId"}`: to the one `sendTo` address only, with or without a plan or credits. The same `requestId` is the same withdrawal. - `POST /api/v1/agent/export/prepare` `{"recipientPublicKey"}` then `POST /api/v1/agent/export` `{"recipientPublicKey", "expiresAtMs", "signature"}`: the wallet's private key, encrypted to a one-time P-256 key; the owner key signs the exact payload prepare returns, within five minutes. 6. `202` with `"status": "running"`: still running; send the same request with the same id again. `402 plan_ended` or `credits_exhausted`: renew. `409 turn_unfinished`: read `/account`, then send a new message with a new id. Rules: trades on Base (swaps and their token approvals) with no limit beyond the wallet's money; a buy of a coin that fails Tragent's coin check is refused; sends only to `sendTo`; paying other services and Aave are off; nothing waits for anyone's approval (what would is refused at once, with its reason). Credits never expire; Tragent's fees on its trades, deposits and withdrawals are taken from them (what they cannot cover is written off; a trade whose fee is more than the credits left is declined, a withdrawal never is). Renew with `{"renew": "agt_..."}` on either purchase route: 30 more days after the later of now and the end, and 1,000 more credits with each renewal; no key needed. After the plan ends: no turns or trades, but withdrawal and export still work. An account that cannot be made is refunded, with anything made for it taken back. Limits for one account: 20 turns a minute, 12 withdrawals a minute, 10 exports an hour. ## MCP An account's Tragent is also an MCP server: `https://tragent.fyi/mcp` with `Authorization: Bearer tgk_...` (the account's API key). It is Streamable HTTP, stateless, with JSON replies, and speaks MCP 2026-07-28 and the 2025 handshake (2025-03-26 to 2025-11-25). Tools: - `ask` `{"message", "messageId", "conversation"?}`: one message to the account's Tragent, the same as `POST /api/v1/agent/ask`. A new `messageId` for each new message; the same `messageId` with the same message is a retry and never runs twice. A `"status": "running"` reply means it is still working: call `ask` again the same way for the reply. - `account` `{}`: the plan, credits left, wallet, holdings and the one withdrawal address. - `withdraw` `{"token", "amount", "requestId"}`: to the account's one address only. The same `requestId` with the same coin and amount is the same withdrawal. Claude Code: `claude mcp add --transport http tragent https://tragent.fyi/mcp --header "Authorization: Bearer $TRAGENT_KEY"`. Without a valid key the server answers `401`; from a web page on another site, `403`. Server card: `https://tragent.fyi/mcp/server-card`. ## More - [Developer reference](https://tragent.fyi/developers): every reply, limits and code samples. - [OpenAPI description](https://tragent.fyi/openapi.json) - [Terms of Service](https://tragent.fyi/terms-of-service#api) and [Privacy Policy](https://tragent.fyi/privacy-policy#api), with their [Accounts for agents](https://tragent.fyi/terms-of-service#agent-accounts) sections. By paying for an answer or an account you accept them. - Contact: support@tragent.fyi