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

# Generate Metrics

> Generate metrics for an AI agent. Returns a progress_id that should be polled via the generate_metrics_progress endpoint.

<Note>
  This endpoint returns a `progress_id` — it does not create metrics directly.

  **Full workflow:**

  1. Call this endpoint to start metric generation → receive a `progress_id`
  2. Poll [Generate Metrics Progress](/api-reference/test_framework/generate-metrics-progress) with the `progress_id` until `status` is `"completed"`
  3. Take the `metrics` array from the progress response and pass it to [Create Metrics in Bulk](/api-reference/test_framework/create-metrics-in-bulk) to save them
</Note>


## OpenAPI

````yaml post /test_framework/v1/metrics/generate_metrics/
openapi: 3.1.0
info:
  title: Cekura API
  version: v1
  description: >-
    Complete API documentation for the Cekura platform. This API provides
    endpoints for testing, observing, and evaluating AI voice agents — including
    managing agents, running evaluators, defining metrics, and analyzing call
    quality.
servers:
  - url: https://api.cekura.ai
security: []
paths:
  /test_framework/v1/metrics/generate_metrics/:
    post:
      tags:
        - test_framework
      description: >-
        Generates suggested metrics for an AI agent. Returns a `progress_id` to
        poll via `generate_metrics_progress`. Results appear in the progress
        response but are not saved automatically — pass them to the metrics bulk
        create endpoint to persist. The agent must have a description of at
        least 100 characters.
      operationId: metrics-generate_2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaGenerateMetricsMetricCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SchemaGenerateMetricsMetricCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SchemaGenerateMetricsMetricCreate'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaGenerateMetricsResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  field_name:
                    type: array
                    items:
                      type: string
          description: ''
      security:
        - api_key: []
components:
  schemas:
    SchemaGenerateMetricsMetricCreate:
      type: object
      properties:
        agent_id:
          type: integer
          description: >-
            The ID of the AI agent to generate metrics for. Either agent_id or
            assistant_id must be provided.
        assistant_id:
          type: string
          description: >-
            The assistant ID to generate metrics for. Either agent_id or
            assistant_id must be provided.
        num_metrics:
          type: integer
          maximum: 100
          minimum: 1
          default: 1
          description: Number of metrics to generate
    SchemaGenerateMetricsResponse:
      type: object
      properties:
        progress_id:
          type: string
          format: uuid
          description: >-
            UUID to poll the generate_metrics_progress endpoint for status and
            results
      required:
        - progress_id
  securitySchemes:
    api_key:
      type: apiKey
      name: X-CEKURA-API-KEY
      in: header
      description: >-
        API Key Authentication. It should be included in the header of each
        request.

````