How to score many answers at once

There is no batch endpoint. Each answer is one call. Use clearrun score folder/ or a loop in your code, keep a steady pace under your plan's per-minute limit, and handle 429 by waiting.

Last updated

Steps

  1. From files

    clearrun score responses/ --json > results.json

    The CLI scores files one after another.

  2. In code, with a steady pace

    for (const answer of answers) {
      const { verdict } = await clearrun.score({ responseText: answer });
      results.push(verdict);
      await new Promise((r) => setTimeout(r, 2100)); // about 28 a minute, under Pro's 30
    }

Credits

100 answers is 100 calls. Check your balance first. See How to keep ClearRun credit use predictable.