Install
Install the TypeScript SDK and set REQRUN_API_KEY to a project API key from the dashboard.
npm install @reqrun/sdkSubmit the task
Use wait=false when your agent task can continue in the background. Store the rr_ id next to your own task record.
const response = await reqrun.chat.completions.create({
model: "gpt-5-nano",
messages: [{ role: "user", content: "Run the agent task." }],
wait: false,
idempotency_key: "agent-task-991",
});
if (response.object === "chat.completion.async") {
const request = await reqrun.requests.get(response.id);
console.log(request.status, request.attempts);
}