Skip to main content
GET
/
projects
/
{projectId}
/
metrics
JavaScript
import Scorecard from 'scorecard-ai';

const client = new Scorecard({
  apiKey: 'My API Key',
});

// Automatically fetches more pages as needed.
for await (const metric of client.metrics.list('314')) {
  console.log(metric);
}
{
  "data": [
    {
      "id": "456",
      "name": "Response Accuracy",
      "description": "Evaluates if the response is factually accurate",
      "outputType": "boolean",
      "evalType": "ai",
      "guidelines": "Check if the response contains factually correct information",
      "promptTemplate": "Please evaluate if the following response is factually accurate: {{response}}",
      "evalModelName": "gpt-4o",
      "temperature": 0.1
    },
    {
      "id": "457",
      "name": "Response Quality",
      "description": "Human review of quality",
      "outputType": "float",
      "evalType": "human",
      "guidelines": "Rate the coherence of the response (0-1).",
      "passingThreshold": 0.8
    }
  ],
  "nextCursor": null,
  "hasMore": false
}

Authorizations

Authorization
string
header
required

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

Path Parameters

projectId
string
required

The ID of the Project to list Metrics for.

Example:

"314"

Query Parameters

limit
integer
default:20

Maximum number of items to return (1-100). Use with cursor for pagination through large sets.

Required range: x > 0
Example:

20

cursor
string

Cursor for pagination. Pass the nextCursor from the previous response to get the next page of results.

Example:

"123"

Response

Successfully retrieved Metrics.

data
(AI int metric · object | Human int metric · object | Heuristic int metric · object | AI float metric · object | Human float metric · object | Heuristic float metric · object | AI boolean metric · object | Human boolean metric · object | Heuristic boolean metric · object)[]
required
  • AI int metric
  • Human int metric
  • Heuristic int metric
  • AI float metric
  • Human float metric
  • Heuristic float metric
  • AI boolean metric
  • Human boolean metric
  • Heuristic boolean metric
nextCursor
string | null
required
hasMore
boolean
required
total
integer
Required range: x >= 0
I