Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

HTTP API

The hosted HTTP API at mcp.gage.cash, its routes, parameters, answers and errors, and the bug report endpoint for agents.

Base URL:

https://mcp.gage.cash

The same reads and prepares as the MCP server, but for the LP lane's four reads, which only MCP serves, over HTTP, on Robinhood Chain mainnet (4663). No key or sign-in. Requests and answers are JSON, and every amount is a raw integer as a decimal string. Answers carry Cache-Control: no-store, and browsers may call the API from any origin, without credentials.

First request

curl --fail-with-body https://mcp.gage.cash/v1/capabilities

Check network (mainnet), chainId (4663) and app (https://gage.cash, where review links open). Read the allowed terms and the rules from this answer rather than hard-coding them. GET / answers the plain-text guide; GET /health reports liveness only.

Routes

Route
Parameters
Answers

GET /v1/capabilities

None

network, chainId, contracts (usdg, core, factory, loopRouter, rolloverRouter, cashoutRouter), terms (seconds, days), originationFeeBps, newLoansPaused, usdgDecimals, actions, rules (those of the actions served), app, lendAssets (each other asset gage lends: token, symbol, decimals, stable, core, factory, terms, and loopRouter, putRouter, rolloverRouter and cashoutRouter where it has them) and lpLane (the LP lane: core, registry, vaults, adapters, pools, terms, originationFeeBps, ltvCapBps, newLoansPaused)

GET /v1/assets

None

status: "partial" and unread while part of the list has not been read, and assets, each token gage admits as collateral now: token, symbol, name, decimals, lane, minAmount, maxPerLoan (null for no per-loan cap, as on the core new loans use; the minimum still applies), leverage, vaults (how many partner vaults lend against it now; 0 means none does yet, and a quote refuses NO_VAULT_LENDS), terms (those of the allowed terms a partner vault lending against it takes now, seconds and days; null while that cannot be read), paused (true while the token cannot move: a repayment or a cancellation still goes through, and what would move it waits), uiMultiplier (a stock's display multiplier, 18 decimals, or null), link (its Borrow page, https://gage.cash/borrow/<link>, or null) and asset, what a loan against it is paid in

GET /v1/borrow-quote

token, term, and maxCollateral, or collateral and principal and optionally costBps, your own cost; optional wallet, lendAsset

With maxCollateral, the largest loan the partner vaults fund whole now: pledge, collateralValueUSDG, principal, receive (after the origination fee), originationFee, repay, costBps, modelCostBps (the model's cost for it), grade (its Loan grade), ltvBps, term, vaultsThatCanFund, expiresAt, summary, note and a prepare object. With collateral and principal, that one loan (mode: "exact") at the lowest cost the vaults funding it accept, which can be under the model's cost that gage.cash's Borrow card starts from, or at your costBps: pledge, collateralValueUSDG, principal, receive, originationFee, repay, costBps, modelCostBps, grade, grades (each Loan grade's cost, and how many vaults take it there), ltvBps, term, fundsNow, accepted, waitsFor (why it would wait, or null), lowestAcceptedCostBps and largestAccepted (the least cost the vaults' settings take it whole at, and the most they take at this cost), summary, note and a prepare object. A loan in another asset names asset, and collateralValue in place of collateralValueUSDG

GET /v1/leverage-quote

token, own, multiple (1.1 to 3, at most two decimals), term; optional wallet

A preview, nothing reserved: own, buy, held, principal, repay, costBps, maxPurchaseCostUSDG, pledgeValueUSDG, expiresAt, summary and a prepare object

GET /v1/loans/{id}

Optional engine (the current core when omitted; a lend asset's core for its loans)

state, borrower, reclaimRightHolder, token, symbol, collateral, principal, repay, costBps, term, fundedQuarters, fundingDeadline, fundedAt, endsAt, collateralPaused, lenders, actions (what can be done now: cancel a listing; reclaim, cash_out, roll and auto_roll a running loan, and cancel_auto_roll while an instruction stands; collect the collateral of a loan repaid or cancelled, until it is taken. Those this service does not prepare read as done on gage.cash; while the token is paused, only what still goes through), closedBy (roll or cash_out for a loan they repaid, whose collateral does not come back; else null) and autoRoll, the loan's instruction to roll over by itself (borrower, executor, term, window, rollsLeft, withRewards, until, maxCost, maxTopUp) or null

GET /v1/portfolio/{wallet}

None

loans the wallet borrowed or holds the reclaim right of, on every gage engine and lend asset's core, each with its token, term, sgageClaimable (raw sGAGE, 18 decimals, earned and not yet claimed; a loan on an earlier engine may pay it in parts) and autoRoll (true while an instruction to roll it over by itself stands); earn, its partner vault holdings (shares, valueUSDG, withdrawableNowUSDG, claimsReady, rewards, link; a stock-token vault's value and withdrawableNow are in its asset); usdgCredit, and credits, each lend asset's credit apart; exitOwed, what exit sales paid the wallet, with each holding's open exit; lp, its LP loans, credits on the lane, LP vault shares and bonuses; and unread, a core or vault that could not be read just now, missing rather than empty

GET /v1/earn/vaults

None

vaults: vault, name, manager (the address that runs it), link (https://gage.cash/v/<link>, or null), lends, performanceFeeBps, longestLoanDays, tokens, asset, and for a USDG vault totalAssetsUSDG, freeCashUSDG and usdgPerShare, the raw USDG one whole share (10^18 raw) redeems for now; a stock-token vault's are totalAssets, freeCash and assetsPerShare, in its asset

GET /v1/earn/vaults/{vault}/free-cash

None

One partner vault's free cash: vault, name, link, and for a USDG vault freeCashUSDG (what withdrawals are paid from now), settlingUSDG (what loans past their end bring back once settled), schedule (what comes back as its loans end, one entry a day: by, amountUSDG) and totalAssetsUSDG; another asset's vault has freeCash, settling, schedule (by, amount) and totalAssets, in its asset. Both count only what borrowers repay. Then bufferBps (the share of the vault a new loan must leave free), settlementDue, asset and note

POST /v1/prepare

JSON body { action, wallet, … }

The next unsigned transaction, the steps after it, a summary, a review link and, when a vault's settle must be mined first, again: true: see Prepare a transaction

A quote for at most 5 tokens of 18 decimals, for 7 days, then one exact loan, 500 USDG on 5 tokens:

A loan's state is FUNDING, ACTIVE, REPAID, DEFAULTED or CANCELLED. lendAsset is USDG when omitted; another asset is accepted only once capabilities lists it under lendAssets. Inputs are strict: an unknown field in a prepare body, or an unknown query key on the quote and loan routes, is refused (INVALID_INPUT).

Prepare bodies

action

Fields besides wallet

borrow

token, collateral, principal, cap (the repayment) and term; optional lendAsset. The borrow quote's prepare object holds all of them.

leverage

token, own, multiple, term and maxCostBps (1 to 5,000: the highest loan cost accepted, in bps of the amount borrowed). The leverage quote's prepare object sets it to the quoted cost.

cancel, reclaim

loanId; optional engine

earn_deposit

vault and amount; optional maxSlippageBps (0 to 500, 50 when omitted)

earn_redeem

vault; optional shares (everything the vault can pay now when omitted) and maxSlippageBps

collect

None

cash_out

loanId; optional engine, maxSlippageBps (1 to 100, 50 when omitted), minNet: the least you accept, raw units of the loan's asset

roll

loanId; optional engine, term (the loan's own when omitted)

feedback

score, a whole number from 0 to 100: the wallet's own rating of gage, once a wallet (Rate gage)

auto_roll and cancel_auto_roll are gage-sdk's and gage-mcp's: here they answer 400 ACTION_NOT_SERVED, and the wallet's owner leaves a loan to roll over by itself on gage.cash.

Add wallet, the address that will sign, to a quote's prepare object and post it as the body. For example, a deposit of 10 USDG into a partner vault; the vault lends it, so you may end up holding the collateral instead of USDG:

The answer, with view left out:

view carries the figures the review page draws. The review page's own routes, POST /v1/reviews/open and POST /v1/reviews/advance, take the link's token in the body; they serve gage.cash, and an agent has no need of them.

Errors

Branch on code, never on message. retryable says whether the same request may succeed later, unchanged. Some refusals add details, figures to act on, as over MCP: details.minimum (token, symbol, decimals, raw) with COLLATERAL_BELOW_MINIMUM, details.maxPrincipal with PRINCIPAL_TOO_HIGH.

HTTP status
Codes
What to do

400

INVALID_INPUT (the message names the field), UNKNOWN_LEND_ASSET, ACTION_NOT_SERVED

Correct the request. Leaving a loan to roll over by itself is done on gage.cash, or with gage-mcp for an agent's own wallet.

403

NOT_YOUR_LOAN, OWN_ENTRY

Prepare for the borrower, or for the holder of the loan's reclaim right. A wallet that owns or operates gage's ERC-8004 entry cannot rate it.

404

NOT_FOUND, LOAN_NOT_FOUND, UNKNOWN_ENGINE, UNKNOWN_VAULT

Check the route, the id or the address. A private loan answers as an unknown one.

409

TERM_NOT_ALLOWED, UNSUPPORTED_COLLATERAL, COLLATERAL_BELOW_MINIMUM, COLLATERAL_ABOVE_MAXIMUM, PRINCIPAL_TOO_HIGH, SETTLEMENT_DUE, LISTINGS_PAUSED, INSUFFICIENT_BALANCE, INSUFFICIENT_CAPACITY, PRICE_ABOVE_LIMIT, PRICE_MOVED, TERM_ENDED, NOT_REPAYABLE, NOT_CANCELLABLE, TOKEN_PAUSED (retryable), FUNDING_CLOSED, INSUFFICIENT_LIQUIDITY, ALREADY_RATED, SIMULATION_FAILED and others

Read the current state and resolve the reason before preparing again.

410

REVIEW_EXPIRED

The review link is over 30 minutes old: prepare again.

413

BODY_TOO_LARGE

Keep the body under 32 KiB.

429

RATE_LIMITED

Wait the seconds in Retry-After.

503

UNAVAILABLE, UPSTREAM_UNAVAILABLE, RATES_UNAVAILABLE

Try again shortly when retryable is true.

The ceilings are 600 requests and 120 prepares a minute for every caller together, and 120 requests and 30 prepares from one address. See Data and limits.

Submit a finding

Read the agent research checklist first. Prioritize customer funds in partner lending and native V2, and identify the actual engine, custody account and connected contracts from the target inventory. Historical-only or future-conditional findings must be labelled, and a paid submission needs the wallet owner's authorization.

Agents reviewing gage contracts can send a bug bounty report straight to the team. The endpoint lives on the support service, not on mcp.gage.cash, and is priced by x402: a refundable deposit of 15 USDC on Base (eip155:8453), returned with every valid report and kept for duplicates, non-reproducible claims and spam. The full policy is on Bug bounty.

Without a payment the endpoint answers 402 with a PAYMENT-REQUIRED header describing the deposit. An x402 client signs a USDC transfer authorization and retries; nothing is charged until the report has been validated. The body is the Immunefi template as JSON. This is a format example, not a finding; replace the title, severity, addresses and snapshot block with your verified evidence:

A TypeScript client with the official libraries:

The answer is 201 { ticket, token, statusUrl }. Poll GET /tickets/{ticket.id} with the header x-gage-ticket-token: {token} to read staff replies and the outcome (PENDING, ACCEPTED, DUPLICATE, REJECTED), or open statusUrl in a browser. One report per paying wallet per day; a 4xx answer is never charged. GET /health on the same service reports the current bounty.price and bounty.network.

Last updated

Was this helpful?