Examples
JavaScript
Node 18+ with fetch.
const H = { Authorization: `Bearer ${process.env.TAKEN_API_KEY}`, "Content-Type": "application/json" };
const { data: task } = await (await fetch("https://taken.trade/api/public/v1/agent/tasks", { method: "POST", headers: H,
body: JSON.stringify({ instruction: "Open example.com and tell me the page title" }) })).json();
let t;
do {
({ data: t } = await (await fetch(`https://taken.trade/api/public/v1/agent/tasks/${task.id}`, { headers: H })).json());
console.log(t.status);
} while (!t.done);
console.log("Result:", t.result);