// Synchronous
const response = await fetch("https://sequencer-v2.heurist.xyz/mesh_request", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: "YOUR_API_KEY",
agent_id: "CoinGeckoTokenInfoAgent",
input: {
query: "What is the current price of Bitcoin?",
raw_data_only: false
}
})
});
// Asynchronous
const taskResponse = await fetch("https://sequencer-v2.heurist.xyz/mesh_task_create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
api_key: "YOUR_API_KEY",
agent_id: "CoinGeckoTokenInfoAgent",
task_details: {
query: "What is the current price of Bitcoin?",
raw_data_only: false
}
})
});
const { task_id } = await taskResponse.json();