POST
/
runs
/
{runId}
/
records
import Scorecard from 'scorecard-ai';

const client = new Scorecard({
  apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const record = await client.records.create('135', {
    inputs: { question: 'What is the capital of France?' },
    labels: { idealAnswer: 'Paris is the capital of France' },
    outputs: { response: 'The capital of France is Paris.' },
    testcaseId: '248',
  });

  console.log(record.id);
}

main();
{
  "id": "135",
  "testcaseId": "248",
  "inputs": {
    "question": "What is the capital of France?"
  },
  "labels": {
    "idealAnswer": "Paris is the capital of France"
  },
  "outputs": {
    "response": "The capital of France is Paris."
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

runId
string
required

The ID of the Run.

Example:

"135"

Body

application/json

Response

201
application/json

Record created successfully

A record of a system execution in the Scorecard system.