import { T2000 } from '@t2000/sdk';
const agent = await T2000.create();
const coinId = 'sui'; // CoinGecko id
const [markets, news, narrative] = await Promise.all([
agent.pay({
url: 'https://mpp.t2000.ai/coingecko/v1/markets',
method: 'POST',
body: JSON.stringify({ vs_currency: 'usd', ids: coinId, sparkline: true }),
}),
agent.pay({
url: 'https://mpp.t2000.ai/newsapi/v1/search',
method: 'POST',
body: JSON.stringify({ q: 'Sui blockchain', pageSize: 5, sortBy: 'publishedAt' }),
}),
agent.pay({
url: 'https://mpp.t2000.ai/perplexity/v1/chat/completions',
method: 'POST',
body: JSON.stringify({
model: 'sonar',
messages: [{ role: 'user', content: 'What is the current narrative and recent developments for the Sui blockchain? Cite sources.' }],
}),
}),
]);
const take = await agent.pay({
url: 'https://mpp.t2000.ai/anthropic/v1/messages',
method: 'POST',
headers: { 'anthropic-version': '2023-06-01' },
body: JSON.stringify({
model: 'claude-sonnet-4-5',
max_tokens: 600,
messages: [{
role: 'user',
content:
`Write a 200-word deep-dive on ${coinId}. Lead with price + 24h/7d move, then the narrative ` +
`and key catalysts. Keep the citations from the research.\n\n` +
`MARKETS: ${JSON.stringify(markets.body)}\n\nNEWS: ${JSON.stringify(news.body)}\n\nNARRATIVE: ${JSON.stringify(narrative.body)}`,
}],
}),
});
console.log((take.body as { content: { text: string }[] }).content[0].text);