> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cartesia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Metric to Agent

> Add a metric to an agent. Once the metric is added, it will be run on all calls made to the agent automatically from that point onwards.



## OpenAPI

````yaml /latest.yml POST /agents/{agent_id}/metrics/{metric_id}
openapi: 3.0.1
info:
  title: Cartesia API
  version: 0.0.1
servers:
  - url: https://api.cartesia.ai
    description: Production
security: []
paths:
  /agents/{agent_id}/metrics/{metric_id}:
    post:
      tags:
        - Agents
      summary: Add Metric to Agent
      description: >-
        Add a metric to an agent. Once the metric is added, it will be run on
        all calls made to the agent automatically from that point onwards.
      operationId: agents_add-metric-to-agent
      parameters:
        - $ref: '#/components/parameters/CartesiaVersionHeader'
        - name: agent_id
          in: path
          description: The ID of the agent.
          required: true
          schema:
            type: string
        - name: metric_id
          in: path
          description: The ID of the metric.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: ''
      security:
        - APIKeyAuth: []
components:
  parameters:
    CartesiaVersionHeader:
      name: Cartesia-Version
      in: header
      description: API version header.
      required: true
      schema:
        type: string
        format: date
        example: '2026-03-01'
        enum:
          - '2026-03-01'
  securitySchemes:
    APIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Cartesia API key (`sk_car_...`). Get one at
        [play.cartesia.ai/keys](https://play.cartesia.ai/keys).

````