---
title: "Update Genai Lens"
method: PUT
path: "/genai-lens/v1/lenses/{lens_id}"
tags: ["genai-lens"]
---

# Update Genai Lens

`PUT /genai-lens/v1/lenses/{lens_id}`

## Request

- Base URL: `https://api.galileo.ai`
- URL: `https://api.galileo.ai/genai-lens/v1/lenses/{lens_id}`
- Auth: one of:
  - API key in header `Splunk-AO-API-Key`
  - API key in header `Galileo-API-Key`
  - OAuth 2
    - Password
    - Token URL: `https://api.galileo.ai/login`
  - HTTP basic

## Path parameters

- `lens_id` string, uuid4, required

## Request body

- GenaiLensRequest: A complete lens, sent to create or replace one.
  - `name` string, required
  - `description` string, nullable
  - `start_date` string, date, nullable
  - `end_date` string, date, nullable
  - `group_id` string, uuid4, nullable
  - `match` 'all' | 'any': How a lens combines its criteria when it counts a root trace.
  - `criteria` union[], required
    - union
      - GenaiLensAgentCriterion: Counts a root trace that involves this inventory agent.
        - `kind` 'agent', required
        - `agent_id` string, required
      - GenaiLensEvalCriterion: Counts a root trace whose evaluation has this result.
        - `kind` 'eval', required
        - `evaluation_name` string, required
        - `result` 'success' | 'failure', required
      - GenaiLensMetadataCriterion: Counts a root trace whose tag or metadata value matches.
        - `kind` 'metadata', required
        - `key` string, required
        - `operator` 'equals' | 'not_equals', required
        - `value` string, required
  - `supporting_agents` GenaiLensSupportingAgent[], required
    - `agent_id` string, required
    - `cost_allocation_pct` number
  - `value_rules` union[], required
    - union
      - GenaiLensAgentValueRule: A value for each matched root trace that involves this inventory agent.
        - `source_kind` 'agent', required
        - `agent_id` string, required
        - `value_per_result_cents` integer, required
      - GenaiLensEvalValueRule: A value for each true result of a boolean evaluation.
        - `source_kind` 'eval', required
        - `evaluation_name` string, required
        - `value_per_result_cents` integer, required
      - GenaiLensMetricValueRule: A value for each unit of a numeric evaluation.
        - `source_kind` 'metric', required
        - `evaluation_name` string, required
        - `value_per_result_cents` integer, required

## Response `200`

Successful Response

- GenaiLensResponse
  - `name` string, required
  - `description` string, nullable
  - `start_date` string, date, nullable
  - `end_date` string, date, nullable
  - `group_id` string, uuid4, nullable
  - `match` 'all' | 'any': How a lens combines its criteria when it counts a root trace.
  - `criteria` union[], required
    - union
      - GenaiLensAgentCriterion: Counts a root trace that involves this inventory agent.
        - `kind` 'agent', required
        - `agent_id` string, required
      - GenaiLensEvalCriterion: Counts a root trace whose evaluation has this result.
        - `kind` 'eval', required
        - `evaluation_name` string, required
        - `result` 'success' | 'failure', required
      - GenaiLensMetadataCriterion: Counts a root trace whose tag or metadata value matches.
        - `kind` 'metadata', required
        - `key` string, required
        - `operator` 'equals' | 'not_equals', required
        - `value` string, required
  - `supporting_agents` GenaiLensSupportingAgent[], required
    - `agent_id` string, required
    - `cost_allocation_pct` number
  - `value_rules` union[], required
    - union
      - GenaiLensAgentValueRule: A value for each matched root trace that involves this inventory agent.
        - `source_kind` 'agent', required
        - `agent_id` string, required
        - `value_per_result_cents` integer, required
      - GenaiLensEvalValueRule: A value for each true result of a boolean evaluation.
        - `source_kind` 'eval', required
        - `evaluation_name` string, required
        - `value_per_result_cents` integer, required
      - GenaiLensMetricValueRule: A value for each unit of a numeric evaluation.
        - `source_kind` 'metric', required
        - `evaluation_name` string, required
        - `value_per_result_cents` integer, required
  - `id` string, uuid4, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

## Changes

> 35 revisions in range; 2 not diffed.

- **2026-10-28** `4cf49e96b632`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/galileo/apis/galileo-api-server/changes/genai-lens/v1/lenses/:lens_id/put.md)

---

[API](https://skmtc.dev/galileo/apis/galileo-api-server.md) - [All operations](https://skmtc.dev/galileo/apis/galileo-api-server/llms.txt) - [OpenAPI document](https://skmtc.dev/galileo/apis/galileo-api-server/revisions/4cf49e96b632?raw)
