Generate Metrics API

Automatically generate a set of evaluation metrics for an agent which can then be used to create metrics.

API Endpoint

MethodEndpoint
POSThttps://new-prod.vocera.ai/test_framework/v1/metrics-external/generate_metrics/

Authentication

Include your API key in the request headers:

HeaderDescription
X-VOCERA-API-KEYYour API key obtained from the dashboard

Request Parameters

ParameterTypeRequiredDescription
agent_idintegerYesID of the agent to generate metrics for
assistant_idstringYes*The assistant ID associated with agent to generate metrics for
num_metricsintegerYesNumber of metrics to generate

* Only either of agent_id or assistant_id is required

Example Request Body

{

    "agent_id": 1,

    "num_metrics": 5

}

Response

The API returns an array of generated metric objects.

Response Fields

FieldTypeDescription
namestringGenerated name for the metric
descriptionstringDetailed description of what the metric evaluates
agentintegerID of the associated agent
eval_typestringType of metric evaluation

Example Response

[

    {

        "name": "introduction_clarity",

        "description": "This metric evaluates whether the AI voice agent clearly introduces itself and the purpose of the call...",

        "agent": 1,

        "eval_type": "binary_workflow_adherence"

    }

    // Additional metrics...

]

Code Examples

curl -X POST https://new-prod.vocera.ai/test_framework/v1/metrics-external/generate_metrics/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

    "agent_id": 1,

    "num_metrics": 5

  }'