Skip to main content
POST
/
agents
/
metrics
Create Metric
curl --request POST \
  --url https://api.cartesia.ai/agents/metrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Cartesia-Version: <cartesia-version>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "display_name": "<string>",
  "prompt": "<string>"
}'
{
  "id": "<string>",
  "name": "<string>",
  "display_name": "<string>",
  "prompt": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Cartesia API key

Headers

Cartesia-Version
enum<string>
required

API version header. Must be set to the API version, e.g. '2024-06-10'.

Available options:
2024-06-10,
2024-11-13,
2025-04-16
Example:

"2025-04-16"

Body

application/json
name
string
required

The name of the metric. This must be a unique name that only allows lower case letters, numbers, and the characters _, -, and .

prompt
string
required

The prompt associated with the metric, detailing the task and evaluation criteria.

display_name
string | null

The display name of the metric.

Response

200 - application/json
id
string
required

The unique identifier for the metric.

name
string
required

The name of the metric. This is a unique name that you can use to identify the metric in the CLI.

prompt
string
required

The prompt associated with the metric, detailing the task and evaluation criteria.

created_at
string<date-time>
required

The timestamp when the metric was created.

display_name
string | null

The display name of the metric, if available. This is the name that is displayed in the Playground.