SDK

Familiar OpenAI shape, smaller reliability surface.

The SDK keeps chat.completions.create and adds one status method for async request ids.

Current status

The canonical public package is @reqrun/sdk and it is now available on npm. The hosted HTTP API and the runnable example repos remain the best lower-level references when you want to inspect the exact signed request shape.

Planned client shape

TypeScript
import { ReqRun } from "@reqrun/sdk";

const reqrun = new ReqRun({
  apiKey: process.env.REQRUN_API_KEY!,
  signingSecret: process.env.REQRUN_SIGNING_SECRET!,
  baseURL: "https://api.reqrun.com",
});

const response = await reqrun.chat.completions.create({
  model: "gpt-5-nano",
  messages: [{ role: "user", content: "Hello" }],
  wait: true,
});

const request = await reqrun.requests.get("rr_abc123");

Async fallback

Use wait=false for background work, or handle the async object when wait=true cannot finish before the timeout.

TypeScript
const response = await reqrun.chat.completions.create({
  model: "gpt-5-nano",
  messages: [{ role: "user", content: "Run this background LLM task." }],
  wait: false,
  idempotency_key: "task-123",
});

if (response.object === "chat.completion.async") {
  await saveRequestId(response.id);
}

Recommended public path today

  • Use the hosted API at https://api.reqrun.com
  • Use POST /v1/chat/completions for request submission
  • Use GET /v1/requests/{id} for async status lookup
  • Use a ReqRun project API key plus the signing secret shown when the key was created

API surface

  • new ReqRun({ apiKey, signingSecret, baseURL? })
  • reqrun.chat.completions.create(params)
  • reqrun.requests.get(id)