https://api.chipipay.com/v1
When to use
/ai/think and /ai/execute work together to power autonomous DeFi agents. Think decides what to do; Execute builds the how.
What you can build
- Autonomous DeFi agent —
/thinkruns on a schedule (hourly, daily), if it says “buy” →/executebuilds the swap → your agent signs and submits via session key. Fully automated, gasless. - Portfolio advisor app — Show users a dashboard with AI recommendations.
/thinkwith their real balances + chosen risk level. They review the suggestion and approve manually. - Risk-managed vault — A smart contract-backed strategy where
/thinkenforces risk params (max drawdown, min stablecoins) before any rebalance. - Telegram trading bot — User sends portfolio snapshot, bot calls
/think, replies with the recommendation and a “execute” button that triggers/execute. - Yield optimizer —
/thinkincludes DeFi yield data from DefiLlama. An agent can compare swap gains vs. yield APY and pick the better move.
/think automatically fetches live signals (RSI, MACD, Fear & Greed, yields) — you don’t need to call /signals first. Just send the portfolio.POST /ai/think
DeFi portfolio advisor. Analyzes your portfolio with real-time market signals (RSI, MACD, Fear & Greed, yields) and returns a structured JSON decision: hold, buy, or sell — with confidence and reasoning. Cost: Per token (same as /chat — the model call is the cost)Request body
Risk parameter overrides
All optional. Defaults scale linearly withriskScore. Override any individual param without affecting others.
How risk scoring works
Risk parameters scale withriskScore from conservative (1) to aggressive (10):
The
/think endpoint automatically injects live market data (signals, yields, Fear & Greed) into the AI prompt. You don’t need to fetch signals separately — just send the portfolio and risk score.POST /ai/execute
Build unsigned swap calldata from AVNU (Starknet DEX aggregator). Returns the transaction calls — you sign and submit via session key or wallet. Cost: $0.002 per call (flat, not per token)Request body
Putting it together: Think + Execute
A typical DeFi agent flow:- Think — send portfolio + risk score, get a decision
- If decision is
buyorsell→ Execute — get unsigned swap calldata - Sign the calls with your wallet or session key
- Submit via Chipi’s gasless paymaster
