Learn

What Is Request Execution?

Request execution is the process of accepting a request, running it to completion, recording attempts, and making the outcome available later.

Why it matters

LLM requests can be slow, rate-limited, or interrupted by network and process failures. If the request matters, the application needs more than a synchronous function call.

A request execution layer creates a stable record that can be retried, inspected, and deduplicated without the caller guessing what happened.

How ReqRun approaches it

ReqRun accepts OpenAI-style chat completion requests, stores them in a durable queue, runs them through a worker, and exposes status through GET /v1/requests/{id}.

TypeScript
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);
}