---
title: "POST /v1/{+location}:generateLossClusters"
method: POST
path: "/v1/{+location}:generateLossClusters"
tags: ["projects"]
---

# POST /v1/{+location}:generateLossClusters

`POST /v1/{+location}:generateLossClusters`

Generates loss clusters from evaluation results. This is a statelss API method that would not modify the EvaluationSet resource.

## Path parameters

- `location` string, required

## Request body

- GoogleCloudAiplatformV1GenerateLossClustersRequest — Request message for EvaluationAnalyticsService.GenerateLossClusters.
  - `evaluationSet` string — Reference to a persisted EvaluationSet. The service will read items from this set.
  - `inlineResults` GoogleCloudAiplatformV1GenerateLossClustersRequestEvaluationResultList — A wrapper to allow providing a list of items inline.
    - `evaluationResults` GoogleCloudAiplatformV1EvaluationResult[] — Required. The list of evaluation results to analyze.
      - `evaluationRun` string — Required. The evaluation run that was used to generate the result. Format: projects/{project}/locations/{location}/evaluationRuns/{evaluation_run}
      - `evaluationRequest` string — Required. The request item that was evaluated. Format: projects/{project}/locations/{location}/evaluationItems/{evaluation_item}
      - `metric` string — Required. The metric that was evaluated.
      - `candidateResults` GoogleCloudAiplatformV1CandidateResult[] — Optional. The results for the metric.
        - `additionalResults` unknown
        - `score` number, float — Optional. The score for the metric.
        - `rubricVerdicts` GoogleCloudAiplatformV1RubricVerdict[] — Optional. The rubric verdicts for the metric.
          - `evaluatedRubric` GoogleCloudAiplatformV1Rubric — Message representing a single testable criterion for evaluation. One input prompt could have multiple rubrics.
            - `type` string — Optional. A type designator for the rubric, which can inform how it's evaluated or interpreted by systems or users. It's recommended to use consistent, well-defined, upper snake_case strings. Examples: "SUMMARIZATION_QUALITY", "SAFETY_HARMFUL_CONTENT", "INSTRUCTION_ADHERENCE".
            - `importance` 'IMPORTANCE_UNSPECIFIED' | 'HIGH' | 'MEDIUM' | 'LOW' — Optional. The relative importance of this rubric.
            - `rubricId` string — Unique identifier for the rubric. This ID is used to refer to this rubric, e.g., in RubricVerdict.
            - `content` GoogleCloudAiplatformV1RubricContent — Content of the rubric, defining the testable criteria.
              - …
          - `verdict` boolean — Required. Outcome of the evaluation against the rubric, represented as a boolean. `true` indicates a "Pass", `false` indicates a "Fail".
          - `reasoning` string — Optional. Human-readable reasoning or explanation for the verdict. This can include specific examples or details from the evaluated content that justify the given verdict.
        - `metric` string — Required. The metric that was evaluated.
        - `explanation` string — Optional. The explanation for the metric.
        - `candidate` string — Required. The candidate that is being evaluated. The value is the same as the candidate name in the EvaluationRequest.
        - `error` GoogleRpcStatus — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
          - `code` integer — The status code, which should be an enum value of google.rpc.Code.
          - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
          - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
      - `metadata` unknown
      - `request` GoogleCloudAiplatformV1EvaluationRequest — A single evaluation request supporting input for both single-turn model generation and multi-turn agent execution traces. Valid input modes: 1. Inference Mode: `prompt` is set (containing text or AgentData context). 2. Offline Eval Mode: `prompt` is unset, and `candidate_responses` contains `agent_data` (the completed execution trace). Validation Rule: Either `prompt` must be set, OR at least one of the `candidate_responses` must contain `agent_data`.
        - `prompt` GoogleCloudAiplatformV1EvaluationPrompt — Prompt to be evaluated. This can represent a single-turn prompt or a multi-turn conversation for agent evaluations.
          - `text` string — Text prompt.
          - `agentData` GoogleCloudAiplatformV1AgentData — Represents data specific to multi-turn agent evaluations.
            - `agents` object — Optional. A map containing the static configurations for each agent in the system. Key: agent_id (matches the `author` field in events). Value: The static configuration of the agent.
            - `turns` GoogleCloudAiplatformV1ConversationTurn[] — Optional. A chronological list of conversation turns. Each turn represents a logical execution cycle (e.g., User Input -> Agent Response).
              - …
          - `value` unknown
          - `userScenario` GoogleCloudAiplatformV1EvaluationPromptUserScenario — User scenario to help simulate multi-turn agent running results.
            - `conversationPlan` string — Required. The plan for the conversation, used to drive the multi-turn agent run and generate the simulated agent evaluation dataset.
            - `startingPrompt` string — Required. The prompt that starts the conversation between the simulated user and the agent under test.
          - `promptTemplateData` GoogleCloudAiplatformV1EvaluationPromptPromptTemplateData — Message to hold a prompt template and the values to populate the template.
            - `values` object — The values for fields in the prompt template.
        - `goldenResponse` GoogleCloudAiplatformV1CandidateResponse — Responses from model or agent.
          - `candidate` string — Required. The name of the candidate that produced the response.
          - `error` GoogleRpcStatus — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
            - `code` integer — The status code, which should be an enum value of google.rpc.Code.
            - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
            - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
              - …
          - `text` string — Text response.
          - `agentData` GoogleCloudAiplatformV1AgentData — Represents data specific to multi-turn agent evaluations.
            - `agents` object — Optional. A map containing the static configurations for each agent in the system. Key: agent_id (matches the `author` field in events). Value: The static configuration of the agent.
            - `turns` GoogleCloudAiplatformV1ConversationTurn[] — Optional. A chronological list of conversation turns. Each turn represents a logical execution cycle (e.g., User Input -> Agent Response).
              - …
          - `value` unknown
        - `rubrics` object — Optional. Named groups of rubrics associated with this prompt. The key is a user-defined name for the rubric group.
        - `candidateResponses` GoogleCloudAiplatformV1CandidateResponse[] — Optional. Responses from model under test and other baseline models for comparison.
          - `candidate` string — Required. The name of the candidate that produced the response.
          - `error` GoogleRpcStatus — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
            - `code` integer — The status code, which should be an enum value of google.rpc.Code.
            - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
            - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
              - …
          - `text` string — Text response.
          - `agentData` GoogleCloudAiplatformV1AgentData — Represents data specific to multi-turn agent evaluations.
            - `agents` object — Optional. A map containing the static configurations for each agent in the system. Key: agent_id (matches the `author` field in events). Value: The static configuration of the agent.
            - `turns` GoogleCloudAiplatformV1ConversationTurn[] — Optional. A chronological list of conversation turns. Each turn represents a logical execution cycle (e.g., User Input -> Agent Response).
              - …
          - `value` unknown
  - `configs` GoogleCloudAiplatformV1LossAnalysisConfig[] — Required. Configuration for the analysis algorithm. Analysis for multiple metrics and multiple candidates could be specified.
    - `metric` string — Required. The metric to analyze (e.g., "tool_use_quality"). This filters the EvaluationItems in the EvalSet to only those where EvaluationResult.metric matches this value.
    - `candidate` string — Required. The candidate model/agent to analyze (e.g., "gemini-3.0-pro"). This targets the specific CandidateResult within the EvaluationResult.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/aiplatform.md) · [All operations](https://skmtc.net/google/apis/aiplatform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/aiplatform/versions/b608d71b91f0/schema)
